Closed christoomey closed 9 years ago
Investigated using the following for fancy tab complete input, but decided index based selection was most straighforward:
diff --git a/plugin/vim-tmux-runner.vim b/plugin/vim-tmux-runner.vim
index 5a801ad..faaca88 100644
--- a/plugin/vim-tmux-runner.vim
+++ b/plugin/vim-tmux-runner.vim
@@ -134,7 +134,21 @@ function! s:ZoomRunnerPane()
endfunction
function! s:Strip(string)
- return substitute(a:string, '^\s*\(.\{-}\)\s*$', '\1', '')
+ return substitute(a:string, '^\s*\(.\{-}\)\s*\n\?$', '\1', '')
+endfunction
+
+function! PaneList(A, P, L)
+ let panes = []
+ for i in [1, 2, 3]
+ call add(panes, s:PaneSummary(i))
+ endfor
+ return panes
+endfunction
+
+function! s:PaneSummary(index)
+ let command = s:Strip(system('tmux display-message -t '. a:index . ' -p "#{pane_current_command}"'))
+ let last_line = s:Strip(s:Strip(system("tmux capture-pane -t ". a:index . " -p | grep -v '^$' | tail -1"))[0:30])
+ return "[" . a:index . " " . command . "]: " . last_line
endfunction
function! s:SendTmuxCommand(command)
Always discount the current pane. With the remaining panes: