From 8c6a5af791ea0ccf44b71577b4cb1a9cec92646c Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Tue, 9 May 2000 11:04:44 +0000 Subject: give control over insertion of tab when no non-blank character before cursor; add insert-tab style (11274) --- Src/Zle/zle_tricky.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Src/Zle/zle_tricky.c') diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index cb5770452..8accf52fb 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -77,6 +77,11 @@ mod_export int offs; /**/ mod_export int usemenu, useglob; +/* != 0 if we would insert a TAB if we weren't calling a completion widget. */ + +/**/ +mod_export int wouldinstab; + /* != 0 if we are in the middle of a menu completion. May be == 2 to force * * menu completion even if using different widgets. */ @@ -153,9 +158,15 @@ usetab(void) { unsigned char *s = line + cs - 1; + wouldinstab = 0; for (; s >= line && *s != '\n'; s--) if (*s != '\t' && *s != ' ') return 0; + if (compfunc) { + wouldinstab = 1; + + return 0; + } return 1; } -- cgit 1.4.1