Skip to content

Commit afef84a

Browse files
committed
Remove s:async_f, use sync in s:remove_indicator (required for Vim apparently)
1 parent 2754270 commit afef84a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

plugin/tmux_navigator.vim

+10-8
Original file line numberDiff line numberDiff line change
@@ -132,27 +132,29 @@ endfunction
132132

133133
" Indicate to tmux keybindings that we handle $TMUX_PANE.
134134
if exists('*jobstart')
135-
let s:async_f = 'jobstart'
135+
function! s:setup_indicator() abort
136+
call call('jobstart', [s:GetTmuxCommand(['set', '-a', '@tmux_navigator', '-'.$TMUX_PANE.'-'])])
137+
endfunction
136138
elseif exists('*job_start')
137-
let s:async_f = 'job_start'
139+
function! s:setup_indicator() abort
140+
call call('job_start', [s:GetTmuxCommand(['set', '-a', '@tmux_navigator', '-'.$TMUX_PANE.'-'])])
141+
endfunction
138142
else
139-
let s:async_f = 'system'
143+
function! s:setup_indicator() abort
144+
call s:TmuxCommand(['set', '-a', '@tmux_navigator', '-'.$TMUX_PANE.'-'])
145+
endfunction
140146
endif
141147

142148
function! s:get_indicator() abort
143149
return s:TmuxCommand(['show', '-v', '@tmux_navigator'])
144150
endfunction
145151
command! TmuxNavigatorPaneIndicator echo s:get_indicator()
146152

147-
function! s:setup_indicator() abort
148-
call call(s:async_f, [s:GetTmuxCommand(['set', '-a', '@tmux_navigator', '-'.$TMUX_PANE.'-'])])
149-
endfunction
150-
151153
function! s:remove_indicator() abort
152154
let cur = s:get_indicator()
153155
" Remove indicators globally (especially important with nested Vim in :term).
154156
let new = substitute(cur, '-'.$TMUX_PANE.'-', '', 'g')
155-
call call(s:async_f, [s:GetTmuxCommand(['set', '@tmux_navigator', new])])
157+
call s:TmuxCommand(['set', '@tmux_navigator', new])
156158
endfunction
157159

158160
augroup tmux_navigator

0 commit comments

Comments
 (0)