mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-25 17:41:19 +02:00
unposted: reset search line on anchored pattern isearch
This commit is contained in:
parent
7462e3f978
commit
f8220437f2
2 changed files with 18 additions and 11 deletions
|
@ -1,5 +1,10 @@
|
|||
2008-04-28 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* unposted: Src/Zle/zle_hist.c: when anchoring a pattern
|
||||
isearch to the start of the line the search line wasn't
|
||||
reset on new input so when the first match of the new pattern
|
||||
was earlier than that of the old pattern we skipped it.
|
||||
|
||||
* unposted: Src/Zle/zle_hist.c: more tweaks for failures with
|
||||
isearch pattern matching.
|
||||
|
||||
|
|
|
@ -1214,6 +1214,19 @@ doisearch(char **args, int dir, int pattern)
|
|||
*/
|
||||
while ((!pattern || patprog) && !nosearch) {
|
||||
if (patprog) {
|
||||
if (revert_patpos) {
|
||||
/*
|
||||
* Search from where the previous
|
||||
* search started; see note above.
|
||||
* This is down here within the loop because of
|
||||
* the "nosearch" optimisation.
|
||||
*/
|
||||
revert_patpos = 0;
|
||||
dup_ok = 1;
|
||||
he = quietgethist(hl = pat_hl);
|
||||
zt = GETZLETEXT(he);
|
||||
pos = pat_pos;
|
||||
}
|
||||
/*
|
||||
* We are pattern matching against the current
|
||||
* line. If anchored at the start, this is
|
||||
|
@ -1245,17 +1258,6 @@ doisearch(char **args, int dir, int pattern)
|
|||
t = zt;
|
||||
} else {
|
||||
if (!matchlist && !skip_pos) {
|
||||
if (revert_patpos) {
|
||||
/*
|
||||
* Search from where the previous
|
||||
* search started; see note above.
|
||||
*/
|
||||
revert_patpos = 0;
|
||||
dup_ok = 1;
|
||||
he = quietgethist(hl = pat_hl);
|
||||
zt = GETZLETEXT(he);
|
||||
pos = pat_pos;
|
||||
}
|
||||
if (!getmatchlist(zt, patprog, &matchlist) ||
|
||||
!firstnode(matchlist)) {
|
||||
if (matchlist) {
|
||||
|
|
Loading…
Reference in a new issue