1
0
Fork 0
mirror of synced 2024-11-03 00:18:57 -04:00

[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
This commit is contained in:
Eric Nielsen 2018-09-16 12:01:52 -05:00
parent c9d1be395d
commit fe2cb6b9f5

View file

@ -5,7 +5,6 @@
# Source script # Source script
source ${0:h}/external/zsh-history-substring-search.zsh || return 1 source ${0:h}/external/zsh-history-substring-search.zsh || return 1
# Bind up and down keys # Binding ^[[A/^[[B manually mean up/down works with history-substring-search both before and after zle-line-init
zmodload -F zsh/terminfo +p:terminfo bindkey '^[[A' history-substring-search-up
bindkey "${terminfo[kcuu1]}" history-substring-search-up bindkey '^[[B' history-substring-search-down
bindkey "${terminfo[kcud1]}" history-substring-search-down