Skip to content

Commit 2754270

Browse files
committed
Add :TmuxNavigatorPaneIndicator, remove globally
1 parent 059cd83 commit 2754270

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

plugin/tmux_navigator.vim

+8-2
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,19 @@ else
139139
let s:async_f = 'system'
140140
endif
141141

142+
function! s:get_indicator() abort
143+
return s:TmuxCommand(['show', '-v', '@tmux_navigator'])
144+
endfunction
145+
command! TmuxNavigatorPaneIndicator echo s:get_indicator()
146+
142147
function! s:setup_indicator() abort
143148
call call(s:async_f, [s:GetTmuxCommand(['set', '-a', '@tmux_navigator', '-'.$TMUX_PANE.'-'])])
144149
endfunction
145150

146151
function! s:remove_indicator() abort
147-
let cur = s:TmuxCommand(['show', '-v', '@tmux_navigator'])
148-
let new = substitute(cur, '-'.$TMUX_PANE.'-', '', '')
152+
let cur = s:get_indicator()
153+
" Remove indicators globally (especially important with nested Vim in :term).
154+
let new = substitute(cur, '-'.$TMUX_PANE.'-', '', 'g')
149155
call call(s:async_f, [s:GetTmuxCommand(['set', '@tmux_navigator', new])])
150156
endfunction
151157

0 commit comments

Comments
 (0)