zsh-workers
 help / color / mirror / code / Atom feed
* list-expand bug fix
@ 1995-07-06 20:40 Zefram
  0 siblings, 0 replies; only message in thread
From: Zefram @ 1995-07-06 20:40 UTC (permalink / raw)
  To: Z Shell workers mailing list

-----BEGIN PGP SIGNED MESSAGE-----

The patch below cleans up the way completion lists are shown.  Due to
my recent patch that keeps lists visible, refresh() will sometimes call
listmatches().  This patch makes all the bits of zle_tricky.c that call
listmatches() instead set the flag that tells refresh() to show the
list, with the exception of listlist() which is used for temporary
expansion lists.

This patch also fixes the bug that list-expand during a menu completion
didn't.  (docomplete() simply called do_menucmp(), which continued the
menu completion!)  This makes it possible to get the expansion of the
current menu choice, which will be shown instead of the menu list; the
menu list will return on a list-choices, redisplay or clear-screen, or
if completion makes the edit buffer take up more lines.

 -zefram

      *** Src/zle_tricky.c.old	Thu Jul  6 17:28:31 1995
      --- Src/zle_tricky.c	Thu Jul  6 21:26:41 1995
      ***************
      *** 94,103 ****
        
        static int validlist;
        
      - /* !=0 if we have shown the explanation string this time round. */
      - 
      - static int shownexpl;
      - 
        /* This flag is non-zero if we are completing a pattern (with globcomplete) */
        
        static int ispattern;
      --- 94,99 ----
      ***************
      *** 523,529 ****
        
            /* If we are doing a menu-completion... */
        
      !     if (menucmp) {
        	do_menucmp(lst);
        	return;
            }
      --- 519,525 ----
        
            /* If we are doing a menu-completion... */
        
      !     if (menucmp && lst != COMP_LIST_EXPAND) {
        	do_menucmp(lst);
        	return;
            }
      ***************
      *** 786,792 ****
        {
            /* Just list the matches if the list was requested. */
            if (lst == COMP_LIST_COMPLETE) {
      ! 	listmatches();
        	return;
            }
            /* Otherwise go to the next match in the array... */
      --- 782,788 ----
        {
            /* Just list the matches if the list was requested. */
            if (lst == COMP_LIST_COMPLETE) {
      ! 	showinglist = -2;
        	return;
            }
            /* Otherwise go to the next match in the array... */
      ***************
      *** 2204,2209 ****
      --- 2200,2206 ----
        docompletion(char *s, int lst, int incmd)
        {
            static int delit, compadd;
      +     int shownexpl;
        
            heapalloc();
            pushheap();
      ***************
      *** 2218,2227 ****
            /* To make sure we only print the explanation once... */
            shownexpl = 0;
        
      !     if (lst == COMP_LIST_COMPLETE)
        	/* All this and the guy only wants to see the list, sigh. */
      ! 	listmatches();
      !     else {
        	/* We have matches. */
        	if (delit) {
        	    /* If we have to delete the word from the command line, do it
      --- 2215,2225 ----
            /* To make sure we only print the explanation once... */
            shownexpl = 0;
        
      !     if (lst == COMP_LIST_COMPLETE) {
        	/* All this and the guy only wants to see the list, sigh. */
      ! 	showinglist = -2;
      ! 	shownexpl = 1;
      !     } else {
        	/* We have matches. */
        	if (delit) {
        	    /* If we have to delete the word from the command line, do it
      ***************
      *** 3232,3238 ****
        	    feep();
        	/* And finally list the matches if needed (and requested). */
        	if (isset(AUTOLIST) && !amenu)
      ! 	    listmatches();
            }
        }
        
      --- 3230,3236 ----
        	    feep();
        	/* And finally list the matches if needed (and requested). */
        	if (isset(AUTOLIST) && !amenu)
      ! 	    showinglist = -2;
            }
        }
        
      ***************
      *** 3681,3690 ****
        	    showinglist = -1;
        	} else
        	    clearflag = 0, putc('\n', shout);
      - 
      -     shownexpl = 1;
      - 
      -     fflush(shout);
        }
        
        /* This is used to print expansions. */
      --- 3679,3684 ----

-----BEGIN PGP SIGNATURE-----
Version: 2.6.i

iQBVAgUBL/xKN2WJ8JfKi+e9AQFCxgIAgH9hhmtMiFCtxd4VUIgjv534xwmSu/6V
D2wx0vklm1ft6u8vafjnFQQQIqRepV4jBkiUaLHCkx4CQZCJB4H7Jg==
=k4uX
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-07-06 20:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-07-06 20:40 list-expand bug fix Zefram

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).