Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug in completing named dirs (pws-3)?



Phil Pennock wrote:

> 
> Using 3.1.5-pws-3, there seems to be something curious with named dirs
> completion.  Tab completion removes the tilde.

And the same for completion after `='. Below is the fix (I forgot to
put ic in ipre ;-).

Bye
 Sven

P.S.: ic is the `ignored character' known from older versions, ipre is 
      the `ignored prefix' added for the or'ing stuff.

diff -c os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
*** os/Zle/zle_tricky.c	Wed Dec 16 11:48:23 1998
--- Src/Zle/zle_tricky.c	Thu Dec 17 10:12:05 1998
***************
*** 3801,3815 ****
  
  	/* Completion after `~', maketildelist adds the usernames *
  	 * and named directories.                                 */
! 	if (ic == Tilde)
  	    maketildelist();
! 	else if (ic == Equals) {
  	    /* Completion after `=', get the command names from *
  	     * the cmdnamtab and aliases from aliastab.         */
  	    if (isset(HASHLISTALL))
  		cmdnamtab->filltable(cmdnamtab);
  	    dumphashtable(cmdnamtab, -7);
  	    dumphashtable(aliastab, -2);
  	} else {
  	    /* Normal file completion... */
  	    if (ispattern & 1) {
--- 3801,3823 ----
  
  	/* Completion after `~', maketildelist adds the usernames *
  	 * and named directories.                                 */
! 	if (ic == Tilde) {
! 	    char *oi = ipre;
! 
! 	    ipre = (ipre ? dyncat("~", ipre) : "~");
  	    maketildelist();
! 	    ipre = oi;
! 	} else if (ic == Equals) {
  	    /* Completion after `=', get the command names from *
  	     * the cmdnamtab and aliases from aliastab.         */
+ 	    char *oi = ipre;
+ 
+ 	    ipre = (ipre ? dyncat("=", ipre) : "=");
  	    if (isset(HASHLISTALL))
  		cmdnamtab->filltable(cmdnamtab);
  	    dumphashtable(cmdnamtab, -7);
  	    dumphashtable(aliastab, -2);
+ 	    ipre = oi;
  	} else {
  	    /* Normal file completion... */
  	    if (ispattern & 1) {

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author