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

Re: PATCH: Re: Undo and narrow-to-region (was ...)



On Aug 17, 11:15pm, Daniel Hahler wrote:
}
} function _history-incremental-preserving-pattern-search-backward
} {
}   local state
}   MARK=CURSOR  # magick, else multiple ^R don't work
}   narrow-to-region -p "$LBUFFER${BUFFER:+>>}" -P "${BUFFER:+<<}$RBUFFER" -S state
}   zle end-of-history
}   zle history-incremental-pattern-search-backward
}   narrow-to-region -R state
} }

Incidentally, the MARK=CURSOR "magick" doesn't seem to be needed any
more with the most recent revision of narrow-to-region.  However, if
you remove that, then the retrieved history will *replace* whatever
text starts out in the region between MARK and CURSOR.   (This is
consistent with what bracketed-paste does, if that matters.)

-- 
Barton E. Schaefer



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