From 8ff22883bd1f82ccf762105eb0916842c81ac56c Mon Sep 17 00:00:00 2001 From: Ton van den Heuvel Date: Tue, 21 Jan 2014 13:55:25 +0100 Subject: [PATCH] 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. --- plugin/vimux.vim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin/vimux.vim b/plugin/vimux.vim index a5e2c7f..48c2cd6 100644 --- a/plugin/vimux.vim +++ b/plugin/vimux.vim @@ -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