From 88a37cc187c0f6c5b7130a943c7ddd87474a0f69 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 14 Jan 2005 13:04:47 +0000 Subject: c.f. 20675: improve zle as a basis for Unicode. unposted: update version to 4.2.3-dev-1 --- Src/lex.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'Src/lex.c') diff --git a/Src/lex.c b/Src/lex.c index 952daf14d..482090ad1 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -71,16 +71,12 @@ int inalmore; /**/ int nocorrect; -/* the line buffer */ - -/**/ -mod_export unsigned char *line; - -/* cursor position and line length */ -/* N.B.: must use the real names here, for the .export file */ +/* + * Cursor position and line length in zle + */ /**/ -mod_export int zshcs, zshll; +mod_export int zlecs, zlell; /* inwhat says what exactly we are in * * (its value is one of the IN_* things). */ @@ -525,10 +521,10 @@ add(int c) } } -#define SETPARBEGIN {if (zleparse && !(inbufflags & INP_ALIAS) && cs >= ll+1-inbufct) parbegin = inbufct;} +#define SETPARBEGIN {if (zleparse && !(inbufflags & INP_ALIAS) && zlecs >= zlell+1-inbufct) parbegin = inbufct;} #define SETPAREND {\ if (zleparse && !(inbufflags & INP_ALIAS) && parbegin != -1 && parend == -1) {\ - if (cs >= ll + 1 - inbufct)\ + if (zlecs >= zlell + 1 - inbufct)\ parbegin = -1;\ else\ parend = inbufct;} } @@ -1297,7 +1293,7 @@ dquote_parse(char endchar, int sub) int pct = 0, brct = 0, bct = 0, intick = 0, err = 0; int c; int math = endchar == ')' || endchar == ']'; - int zlemath = math && cs > ll + addedx - inbufct; + int zlemath = math && zlecs > zlell + addedx - inbufct; while (((c = hgetc()) != endchar || bct || (math && ((pct > 0) || (brct > 0))) || @@ -1424,7 +1420,7 @@ dquote_parse(char endchar, int sub) err = intick || endchar || err; else if (err == 1) err = c; - if (zlemath && cs <= ll + 1 - inbufct) + if (zlemath && zlecs <= zlell + 1 - inbufct) inwhat = IN_MATH; return err; } @@ -1553,9 +1549,9 @@ parse_subst_string(char *s) mod_export void gotword(void) { - we = ll + 1 - inbufct + (addedx == 2 ? 1 : 0); - if (cs <= we) { - wb = ll - wordbeg + addedx; + we = zlell + 1 - inbufct + (addedx == 2 ? 1 : 0); + if (zlecs <= we) { + wb = zlell - wordbeg + addedx; zleparse = 0; } } -- cgit 1.4.1