Skip to content

Commit 3ff4ec8

Browse files
authored
Merge pull request #1 from slange-dev/Add-support-for-all-known-pane-modes
Add support for all known pane modes
2 parents 489a961 + 37855ee commit 3ff4ec8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

prefix_highlight.tmux

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,18 @@ main() {
6767
local -r prefix_highlight="$(format_style "fg=$fg_color,bg=$bg_color")"
6868
local -r prefix_mode="$prefix_highlight$output_prefix$prefix_prompt$output_suffix"
6969

70+
# add support for all (known) pane modes
71+
local -r pane_mode="#{s/-mode//:#{pane_mode}}"
72+
local -r clock_mode_sub="#{#{?#{==:$pane_mode,clock},Clock,#{pane_mode} is not yet supported; please report}}"
73+
local -r options_mode_sub="#{#{?#{==:$pane_mode,Options},Options,$clock_mode_sub}}"
74+
local -r client_mode_sub="#{#{?#{==:$pane_mode,Client},Client,$options_mode_sub}}"
75+
local -r buffer_mode_sub="#{#{?#{==:$pane_mode,Buffer},Buffer,$client_mode_sub}}"
76+
local -r tree_mode_sub="#{#{?#{==:$pane_mode,Tree},Tree,$buffer_mode_sub}}"
77+
local -r view_mode_sub="#{#{?#{==:$pane_mode,View},View,$tree_mode_sub}}"
78+
local -r copy_mode_sub="#{#{?#{==:$pane_mode,Copy},$copy_prompt,$view_mode_sub}}"
79+
7080
local -r copy_highlight="$(format_style "${copy_attr:+default,$copy_attr}")"
71-
local -r copy_mode="$copy_highlight$output_prefix$copy_prompt$output_suffix"
81+
local -r copy_mode="$copy_highlight$output_prefix$copy_mode_sub$output_suffix"
7282

7383
local -r sync_highlight="$(format_style "${sync_attr:+default,$sync_attr}")"
7484
local -r sync_mode="$sync_highlight$output_prefix$sync_prompt$output_suffix"

0 commit comments

Comments
 (0)