read default compact state from configuration

This commit is contained in:
Jorge Morante 2016-10-17 22:28:24 +02:00
parent 7faf361f68
commit 3abca2a0ff
4 changed files with 12 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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 = ""

View File

@ -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
}