read default compact state from configuration
This commit is contained in:
parent
7faf361f68
commit
3abca2a0ff
|
@ -60,3 +60,8 @@ done
|
|||
|
||||
PATTERNS=$(array_join "|" "${PATTERNS_LIST[@]}")
|
||||
export PATTERNS
|
||||
|
||||
DEFAULT_FINGER_COMPACT_HINTS=1
|
||||
FINGERS_COMPACT_HINTS=$(tmux show-option -gqv @fingers-compact-hints)
|
||||
FINGERS_COMPACT_HINTS=${FINGERS_COMPACT_HINTS:-$DEFAULT_FINGER_COMPACT_HINTS}
|
||||
export FINGERS_COMPACT_HINTS
|
||||
|
|
|
@ -77,13 +77,14 @@ function hide_cursor() {
|
|||
|
||||
trap "handle_exit" EXIT
|
||||
|
||||
compact_state=$FINGERS_COMPACT_HINTS
|
||||
|
||||
pane_was_zoomed=$(is_pane_zoomed "$current_pane_id")
|
||||
show_hints_and_swap $current_pane_id $fingers_pane_id
|
||||
show_hints_and_swap $current_pane_id $fingers_pane_id $compact_state
|
||||
[[ $pane_was_zoomed == "1" ]] && zoom_pane "$fingers_pane_id"
|
||||
|
||||
hide_cursor
|
||||
input=''
|
||||
compact_state=1
|
||||
|
||||
function toggle_compact_state() {
|
||||
if [[ $compact_state == "0" ]]; then
|
||||
|
|
|
@ -113,8 +113,8 @@ BEGIN {
|
|||
compound_format = hint_format highlight_format
|
||||
} else {
|
||||
hint_format = "\033[1;33m[%s]\033[0m"
|
||||
highlight_format = "\033[1;33m%s\033[0m"
|
||||
compound_format = highlight_format " " hint_format
|
||||
highlight_format = "\033[1;33m%s\033[0m "
|
||||
compound_format = highlight_format hint_format
|
||||
}
|
||||
|
||||
hint_lookup = ""
|
||||
|
|
|
@ -39,6 +39,7 @@ function show_hints() {
|
|||
function show_hints_and_swap() {
|
||||
current_pane_id=$1
|
||||
fingers_pane_id=$2
|
||||
compact_state=$3
|
||||
tmux swap-pane -s "$current_pane_id" -t "$fingers_pane_id"
|
||||
show_hints "$fingers_pane_id" 1
|
||||
show_hints "$fingers_pane_id" $compact_state
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue