about summary refs log tree commit diff
path: root/Src/lex.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-23 08:20:56 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-23 08:20:56 +0000
commit7f9f81f3e22a58d6a8af77f05cd05c94faf88d93 (patch)
treeea885f65d2b29f8fe5b733683333973a7e7351db /Src/lex.c
parentde2c2a89c6341adeb4e033ec8877d67eb0c2110c (diff)
downloadzsh-7f9f81f3e22a58d6a8af77f05cd05c94faf88d93.tar.gz
zsh-7f9f81f3e22a58d6a8af77f05cd05c94faf88d93.tar.xz
zsh-7f9f81f3e22a58d6a8af77f05cd05c94faf88d93.zip
save and restore more variables in bufferwords(); move gotword() into core (11523)
Diffstat (limited to 'Src/lex.c')
-rw-r--r--Src/lex.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/Src/lex.c b/Src/lex.c
index 53c46f5d3..0c16db60c 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -93,6 +93,11 @@ mod_export int inwhat;
 /**/
 mod_export int addedx;
 
+/* wb and we hold the beginning/end position of the word we are completing. */
+
+/**/
+mod_export int wb, we;
+
 /* 1 if aliases should not be expanded */
  
 /**/
@@ -1483,6 +1488,19 @@ parse_subst_string(char *s)
     return 0;
 }
 
+/* Called below to report word positions. */
+
+/**/
+mod_export void
+gotword(void)
+{
+    we = ll + 1 - inbufct + (addedx == 2 ? 1 : 0);
+    if (cs <= we) {
+	wb = ll - wordbeg + addedx;
+	zleparse = 0;
+    }
+}
+
 /* expand aliases and reserved words */
 
 /**/