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

Re: [PATCH] Stop {up,down}-line-or-beginning-search from triggeing warn_create_global



[...]
>  Functions/Zle/down-line-or-beginning-search | 40 +++++++++++++++++------------
>  Functions/Zle/up-line-or-beginning-search   | 38 +++++++++++++++------------
[...]

The diff looks more invasive then it really is. Here is a diff that
ignores all whitespace-related changes via:

  % git diff --ignore-all-space

diff --git a/Functions/Zle/down-line-or-beginning-search b/Functions/Zle/down-line-or-beginning-search
index fbd2c33..ff3d1d2 100644
--- a/Functions/Zle/down-line-or-beginning-search
+++ b/Functions/Zle/down-line-or-beginning-search
@@ -1,6 +1,9 @@
 # Like down-line-or-search, but uses the whole line prefix up to the
 # cursor position for searching forwards.
 
+typeset -g __searching __savecursor
+
+down-line-or-beginning-search () {
     emulate -L zsh
 
     if [[ ${+NUMERIC} -eq 0 &&
@@ -19,3 +22,6 @@ then
     fi
     __searching=''
     zle .down-line-or-history
+}
+
+up-line-or-beginning-search "$@"
diff --git a/Functions/Zle/up-line-or-beginning-search b/Functions/Zle/up-line-or-beginning-search
index 5348e7a..5bd5d57 100644
--- a/Functions/Zle/up-line-or-beginning-search
+++ b/Functions/Zle/up-line-or-beginning-search
@@ -1,6 +1,9 @@
 # Like up-line-or-search, but uses the whole line prefix up to the
 # cursor position for searching backwards.
 
+typeset -g __searching __savecursor
+
+up-line-or-beginning-search () {
     emulate -L zsh
 
     if [[ $LBUFFER == *$'\n'* ]]; then
@@ -18,3 +21,6 @@ else
         zstyle -T ':zle:up-line-or-beginning-search' leave-cursor &&
         zle .end-of-line
     fi
+}
+
+up-line-or-beginning-search "$@"



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