1
0
Fork 0
mirror of synced 2024-05-26 03:51:13 -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 ${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