From fe2cb6b9f5d3364c64079fbb833e0a7f6f5d545b Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Sun, 16 Sep 2018 12:01:52 -0500 Subject: [PATCH] [history-substring-search] Fix incompatibility with zle-line-init widget See https://github.com/zsh-users/zsh-history-substring-search/issues/70 and comment by @molovo: I was already binding keys _after_ `zle-line-init`, but I'm pulling keycodes out of the `terminfo` module, which reports up (`$terminfo[kcuu1]`) as `^[0A` instead of `^[[A`. Binding `^[[A` manually mean up/down works with history-substring-search both before and after `zle-line-init`, but if I bind `$terminfo[kcuu1]` (`^[0a`), up/down only works *before* `zle-line-init`. Closes #286 --- modules/history-substring-search/init.zsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/history-substring-search/init.zsh b/modules/history-substring-search/init.zsh index 619bda0..933b07c 100644 --- a/modules/history-substring-search/init.zsh +++ b/modules/history-substring-search/init.zsh @@ -5,7 +5,6 @@ # Source script source ${0:h}/external/zsh-history-substring-search.zsh || return 1 -# Bind up and down keys -zmodload -F zsh/terminfo +p:terminfo -bindkey "${terminfo[kcuu1]}" history-substring-search-up -bindkey "${terminfo[kcud1]}" history-substring-search-down +# Binding ^[[A/^[[B manually mean up/down works with history-substring-search both before and after zle-line-init +bindkey '^[[A' history-substring-search-up +bindkey '^[[B' history-substring-search-down