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.
This commit is contained in:
Ton van den Heuvel 2014-01-21 13:55:25 +01:00
parent efa6a9aa4b
commit 8ff22883bd

View File

@ -120,7 +120,7 @@ function! VimuxPromptCommand()
endfunction
function! _VimuxTmuxSession()
return _VimuxTmuxProperty("S")
return _VimuxTmuxProperty("#S")
endfunction
function! _VimuxTmuxIndex()
@ -132,11 +132,11 @@ function! _VimuxTmuxIndex()
endfunction
function! _VimuxTmuxPaneIndex()
return _VimuxTmuxProperty("P")
return _VimuxTmuxProperty("#I.#P")
endfunction
function! _VimuxTmuxWindowIndex()
return _VimuxTmuxProperty("I")
return _VimuxTmuxProperty("#I")
endfunction
function! _VimuxNearestIndex()
@ -164,9 +164,9 @@ function! _VimuxOption(option, default)
endfunction
function! _VimuxTmuxProperty(property)
return substitute(system("tmux display -p '#".a:property."'"), '\n$', '', '')
return substitute(system("tmux display -p '".a:property."'"), '\n$', '', '')
endfunction
function! _VimuxHasRunner(index)
return match(system("tmux list-"._VimuxRunnerType()."s"), a:index.":")
return match(system("tmux list-"._VimuxRunnerType()."s -a"), a:index.":")
endfunction