Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: User-defined replacement for *-line-or-search in 3.1.4
- X-seq: zsh-users 1587
 
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
 
- To: zsh-users@xxxxxxxxxxxxxxx
 
- Subject: Re: User-defined replacement for *-line-or-search in 3.1.4
 
- Date: Tue, 9 Jun 1998 21:25:57 -0700
 
- In-reply-to: <980609132319.ZM7074@xxxxxxxxxxxxxxxxxxxxxxx>
 
- References: <19980428143325.59341@xxxxxxxxxxxxxxxxxxxxxxxxxx> 	<199804281408.PAA32237@xxxxxxxxxxxxxxxx> 	<19980609141304.41665@xxxxxxxxxxxxxxxxxxxxxxxxxx> 	<980609082238.ZM5717@xxxxxxxxxxxxxxxxxxxxxxx> 	<vbu35utvzk.fsf@xxxxxxxxxxxxxxx> 	<980609114223.ZM6613@xxxxxxxxxxxxxxxxxxxxxxx> 	<980609132319.ZM7074@xxxxxxxxxxxxxxxxxxxxxxx>
 
On Jun 9,  1:23pm, I wrote:
} Subject: User-defined replacement for *-line-or-search in 3.1.4
}
} Shouldn't $#LBUFFER == $CURSOR == $#moveorsearchpattern on first call to this
} function?  If so, why is the +1 necessary?  (If I leave it out, the call to
} history-beginning-search-*ward uses too short a prefix.)
} 
} --- 8< --- snip --- 8< ---
} 
} 	    # Why is +1 needed here, but not needed at $#BUFFER?
} 	    CURSOR=$[$#moveorsearchpattern+1]
} 	    zle history-beginning-search-backward
} 	    CURSOR=$#BUFFER
I've just been fooling with this in the debugger, and I can no longer get
the behavior I was seeing where adding one to the pattern length was
necessary.  I don't know what strangeness I had going on, though I have
done a rebuild in the interim ... anyway, I recommend changing the first
assignment of CURSOR to
	CURSOR=$#moveorsearchpattern
in both of the functions I posted earlier today.
-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author