mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-26 14:56:30 +00:00
Not relying on exit status for CTRL-R
In the case that fzf-tmux returns a user-selected result but with a non-zero exit status (which can happen if a function inside $PS1 returns non-zero) this allows CTRL-R to continue working as expected. Addresses #203 (Tranquility's comment)
This commit is contained in:
parent
2c4f71d85b
commit
c3cf3427b1
@ -37,7 +37,8 @@ bindkey '\ec' fzf-cd-widget
|
|||||||
# CTRL-R - Paste the selected command from history into the command line
|
# CTRL-R - Paste the selected command from history into the command line
|
||||||
fzf-history-widget() {
|
fzf-history-widget() {
|
||||||
local selected num
|
local selected num
|
||||||
if selected=( $(fc -l 1 | $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r -q "$LBUFFER") ); then
|
selected=( $(fc -l 1 | $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r -q "$LBUFFER") )
|
||||||
|
if [ -n "$selected" ]; then
|
||||||
num=$selected[1]
|
num=$selected[1]
|
||||||
if [ -n "$num" ]; then
|
if [ -n "$num" ]; then
|
||||||
zle vi-fetch-history -n $num
|
zle vi-fetch-history -n $num
|
||||||
|
Loading…
Reference in New Issue
Block a user