mirror of
https://github.com/Morantron/tmux-fingers.git
synced 2024-06-26 07:29:11 +02:00
prevent jumpy re-renders on user input
This commit is contained in:
parent
0de3d1e814
commit
612c2252a4
|
@ -85,11 +85,11 @@ fingers_defaults=( \
|
||||||
|
|
||||||
[fingers-hint-position]="left" \
|
[fingers-hint-position]="left" \
|
||||||
[fingers-hint-format]="#[fg=yellow,bold]%s" \
|
[fingers-hint-format]="#[fg=yellow,bold]%s" \
|
||||||
[fingers-highlight-format]="#[fg=yellow,bold,dim]%s" \
|
[fingers-highlight-format]="#[fg=yellow,nobold,dim]%s" \
|
||||||
|
|
||||||
[fingers-hint-position-nocompact]="right" \
|
[fingers-hint-position-nocompact]="right" \
|
||||||
[fingers-hint-format-nocompact]="#[fg=yellow,bold][%s]" \
|
[fingers-hint-format-nocompact]="#[fg=yellow,bold][%s]" \
|
||||||
[fingers-highlight-format-nocompact]="#[fg=yellow,bold,dim]%s" \
|
[fingers-highlight-format-nocompact]="#[fg=yellow,nobold,dim]%s" \
|
||||||
)
|
)
|
||||||
|
|
||||||
set_tmux_env 'fingers-patterns'
|
set_tmux_env 'fingers-patterns'
|
||||||
|
|
|
@ -90,7 +90,7 @@ function toggle_compact_state() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggle_help() {
|
function toggle_help_state() {
|
||||||
if [[ $help_state == "0" ]]; then
|
if [[ $help_state == "0" ]]; then
|
||||||
help_state=1
|
help_state=1
|
||||||
else
|
else
|
||||||
|
@ -132,19 +132,22 @@ while read -rsn1 char; do
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
prev_help_state="$help_state"
|
||||||
|
prev_compact_state="$compact_state"
|
||||||
|
|
||||||
if [[ $char == "$BACKSPACE" ]]; then
|
if [[ $char == "$BACKSPACE" ]]; then
|
||||||
input=""
|
input=""
|
||||||
continue
|
continue
|
||||||
elif [[ $char == "<ESC>" ]]; then
|
elif [[ $char == "<ESC>" ]]; then
|
||||||
if [[ $help_state == "1" ]]; then
|
if [[ $help_state == "1" ]]; then
|
||||||
toggle_help
|
toggle_help_state
|
||||||
else
|
else
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
elif [[ $char == "" ]]; then
|
elif [[ $char == "" ]]; then
|
||||||
toggle_compact_state
|
toggle_compact_state
|
||||||
elif [[ $char == "?" ]]; then
|
elif [[ $char == "?" ]]; then
|
||||||
toggle_help
|
toggle_help_state
|
||||||
else
|
else
|
||||||
input="$input$char"
|
input="$input$char"
|
||||||
fi
|
fi
|
||||||
|
@ -152,7 +155,9 @@ while read -rsn1 char; do
|
||||||
if [[ $help_state == "1" ]]; then
|
if [[ $help_state == "1" ]]; then
|
||||||
show_help "$fingers_pane_id"
|
show_help "$fingers_pane_id"
|
||||||
else
|
else
|
||||||
show_hints "$fingers_pane_id" $compact_state
|
if [[ "$prev_compact_state" != "$compact_state" ]]; then
|
||||||
|
show_hints "$fingers_pane_id" "$compact_state"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
result=$(lookup_match "$input")
|
result=$(lookup_match "$input")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user