mirror of
https://github.com/preservim/vimux
synced 2024-11-04 18:00:10 +00:00
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:
parent
efa6a9aa4b
commit
8ff22883bd
@ -120,7 +120,7 @@ function! VimuxPromptCommand()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! _VimuxTmuxSession()
|
function! _VimuxTmuxSession()
|
||||||
return _VimuxTmuxProperty("S")
|
return _VimuxTmuxProperty("#S")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! _VimuxTmuxIndex()
|
function! _VimuxTmuxIndex()
|
||||||
@ -132,11 +132,11 @@ function! _VimuxTmuxIndex()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! _VimuxTmuxPaneIndex()
|
function! _VimuxTmuxPaneIndex()
|
||||||
return _VimuxTmuxProperty("P")
|
return _VimuxTmuxProperty("#I.#P")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! _VimuxTmuxWindowIndex()
|
function! _VimuxTmuxWindowIndex()
|
||||||
return _VimuxTmuxProperty("I")
|
return _VimuxTmuxProperty("#I")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! _VimuxNearestIndex()
|
function! _VimuxNearestIndex()
|
||||||
@ -164,9 +164,9 @@ function! _VimuxOption(option, default)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! _VimuxTmuxProperty(property)
|
function! _VimuxTmuxProperty(property)
|
||||||
return substitute(system("tmux display -p '#".a:property."'"), '\n$', '', '')
|
return substitute(system("tmux display -p '".a:property."'"), '\n$', '', '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! _VimuxHasRunner(index)
|
function! _VimuxHasRunner(index)
|
||||||
return match(system("tmux list-"._VimuxRunnerType()."s"), a:index.":")
|
return match(system("tmux list-"._VimuxRunnerType()."s -a"), a:index.":")
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
Reference in New Issue
Block a user