Skip to content

Commit 8ff2288

Browse files
author
Ton van den Heuvel
committed
Identify a pane by its window and its pane index
By identifying a pane by both its window and pane index, VimuxCloseRunner() will always close the correct pane, even in case VimuxCloseRunner() is called from a Vim instance in a different window than the current window.
1 parent efa6a9a commit 8ff2288

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

plugin/vimux.vim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function! VimuxPromptCommand()
120120
endfunction
121121

122122
function! _VimuxTmuxSession()
123-
return _VimuxTmuxProperty("S")
123+
return _VimuxTmuxProperty("#S")
124124
endfunction
125125

126126
function! _VimuxTmuxIndex()
@@ -132,11 +132,11 @@ function! _VimuxTmuxIndex()
132132
endfunction
133133

134134
function! _VimuxTmuxPaneIndex()
135-
return _VimuxTmuxProperty("P")
135+
return _VimuxTmuxProperty("#I.#P")
136136
endfunction
137137

138138
function! _VimuxTmuxWindowIndex()
139-
return _VimuxTmuxProperty("I")
139+
return _VimuxTmuxProperty("#I")
140140
endfunction
141141

142142
function! _VimuxNearestIndex()
@@ -164,9 +164,9 @@ function! _VimuxOption(option, default)
164164
endfunction
165165

166166
function! _VimuxTmuxProperty(property)
167-
return substitute(system("tmux display -p '#".a:property."'"), '\n$', '', '')
167+
return substitute(system("tmux display -p '".a:property."'"), '\n$', '', '')
168168
endfunction
169169

170170
function! _VimuxHasRunner(index)
171-
return match(system("tmux list-"._VimuxRunnerType()."s"), a:index.":")
171+
return match(system("tmux list-"._VimuxRunnerType()."s -a"), a:index.":")
172172
endfunction

0 commit comments

Comments
 (0)