From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: removing completion lists
Date: Fri, 12 Feb 1999 13:40:18 +0100 (MET) [thread overview]
Message-ID: <199902121240.NAA09845@beta.informatik.hu-berlin.de> (raw)
This patch does two things:
1) cleanup for the code that removes the completion list for zle
functions that use the statusline; This is very simple now, you
only have to set the variable `clearlist' to non-zero and
zrefresh() will do the rest
2) use this to remove completion lists when completion is attempted
and generates no match; I'm not if you like this, but somehow this
`feels' good if you have all the beeps turned off (only now will
you get visual feedback that something went wrong)
Anyway, if 2) is not wanted, I can easily produce a patch without it.
Bye
Sven
diff -u os/Zle/zle_hist.c Src/Zle/zle_hist.c
--- os/Zle/zle_hist.c Fri Feb 12 12:03:21 1999
+++ Src/Zle/zle_hist.c Fri Feb 12 13:18:08 1999
@@ -663,10 +663,7 @@
static char *previous_search = NULL;
static int previous_search_len = 0;
- invalidatelist();
- moveto(0, 0);
- clearflag = 0;
- resetneeded = 1;
+ clearlist = 1;
strcpy(ibuf, ISEARCH_PROMPT);
memcpy(ibuf + NORM_PROMPT_POS, (dir == 1) ? "fwd" : "bck", 3);
@@ -948,10 +945,7 @@
zsfree(visrchstr);
visrchstr = NULL;
}
- invalidatelist();
- moveto(0, 0);
- clearflag = 0;
- resetneeded = 1;
+ clearlist = 1;
statusline = sbuf;
sbuf[0] = (visrchsense == -1) ? '?' : '/';
selectkeymap("main", 1);
diff -u os/Zle/zle_main.c Src/Zle/zle_main.c
--- os/Zle/zle_main.c Fri Feb 12 12:03:21 1999
+++ Src/Zle/zle_main.c Fri Feb 12 13:12:07 1999
@@ -792,10 +792,7 @@
if (statusline)
return;
- invalidatelist();
- moveto(0, 0);
- clearflag = 0;
- resetneeded = 1;
+ clearlist = 1;
statusline = "Describe key briefly: _";
statusll = strlen(statusline);
zrefresh();
diff -u os/Zle/zle_misc.c Src/Zle/zle_misc.c
--- os/Zle/zle_misc.c Fri Feb 12 12:03:21 1999
+++ Src/Zle/zle_misc.c Fri Feb 12 13:12:21 1999
@@ -612,10 +612,7 @@
char *ptr;
char *okeymap = curkeymapname;
- invalidatelist();
- moveto(0, 0);
- clearflag = 0;
- resetneeded = 1;
+ clearlist = 1;
cmdbuf = halloc(l + NAMLEN + 2);
strcpy(cmdbuf, prmt);
statusline = cmdbuf;
diff -u os/Zle/zle_refresh.c Src/Zle/zle_refresh.c
--- os/Zle/zle_refresh.c Fri Feb 12 12:03:21 1999
+++ Src/Zle/zle_refresh.c Fri Feb 12 13:11:58 1999
@@ -60,6 +60,11 @@
/**/
int clearflag;
+/* Non-zero if zrefresh() should clear the list below the prompt. */
+
+/**/
+int clearlist;
+
#ifdef HAVE_SELECT
/* cost of last update */
/**/
@@ -248,6 +253,13 @@
if (inlist)
return;
+ if (clearlist) {
+ invalidatelist();
+ moveto(0, 0);
+ clearflag = 0;
+ resetneeded = 1;
+ clearlist = 0;
+ }
#ifdef HAVE_SELECT
cost = 0; /* reset */
#endif
diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c Fri Feb 12 12:03:22 1999
+++ Src/Zle/zle_tricky.c Fri Feb 12 13:29:33 1999
@@ -3278,9 +3278,9 @@
if (makecomplist(s, incmd, lst)) {
/* Error condition: feeeeeeeeeeeeep(). */
feep();
+ clearlist = 1;
goto compend;
}
-
if (lst == COMP_LIST_COMPLETE)
/* All this and the guy only wants to see the list, sigh. */
showinglist = -2;
diff -u os/Zle/zle_vi.c Src/Zle/zle_vi.c
--- os/Zle/zle_vi.c Fri Feb 12 12:03:22 1999
+++ Src/Zle/zle_vi.c Fri Feb 12 13:18:25 1999
@@ -816,10 +816,7 @@
void
vicapslockpanic(void)
{
- invalidatelist();
- moveto(0, 0);
- clearflag = 0;
- resetneeded = 1;
+ clearlist = 1;
zbeep();
statusline = "press a lowercase key to continue";
statusll = strlen(statusline);
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
reply other threads:[~1999-02-12 12:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199902121240.NAA09845@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).