Skip to content

Commit 992d525

Browse files
committed
feat: Make s:tmuxExec (was _VimuxTmux) public VimuxTmux
1 parent 566833e commit 992d525

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

plugin/vimux.vim

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ endfunction
7373

7474
function! VimuxSendKeys(keys)
7575
if exists('g:VimuxRunnerIndex')
76-
call s:tmux('send-keys -t '.g:VimuxRunnerIndex.' '.a:keys)
76+
call VimuxTmux('send-keys -t '.g:VimuxRunnerIndex.' '.a:keys)
7777
else
7878
echo 'No vimux runner pane/window. Create one with VimuxOpenRunner'
7979
endif
@@ -88,30 +88,30 @@ function! VimuxOpenRunner()
8888
if s:runnerType() ==# 'pane'
8989
let height = VimuxOption('g:VimuxHeight', 20)
9090
let orientation = VimuxOption('g:VimuxOrientation', 'v')
91-
call s:tmux('split-window -p '.height.' -'.orientation.' '.extraArguments)
91+
call VimuxTmux('split-window -p '.height.' -'.orientation.' '.extraArguments)
9292
elseif s:runnerType() ==# 'window'
93-
call s:tmux('new-window '.extraArguments)
93+
call VimuxTmux('new-window '.extraArguments)
9494
endif
9595
let g:VimuxRunnerIndex = s:tmuxIndex()
9696
call s:setRunnerName()
97-
call s:tmux('last-'.s:runnerType())
97+
call VimuxTmux('last-'.s:runnerType())
9898
endif
9999
endfunction
100100

101101
function! VimuxCloseRunner()
102102
if exists('g:VimuxRunnerIndex')
103-
call s:tmux('kill-'.s:runnerType().' -t '.g:VimuxRunnerIndex)
103+
call VimuxTmux('kill-'.s:runnerType().' -t '.g:VimuxRunnerIndex)
104104
unlet g:VimuxRunnerIndex
105105
endif
106106
endfunction
107107

108108
function! VimuxTogglePane()
109109
if exists('g:VimuxRunnerIndex')
110110
if s:runnerType() ==# 'window'
111-
call s:tmux('join-pane -d -s '.g:VimuxRunnerIndex.' -p '.VimuxOption('g:VimuxHeight', 20))
111+
call VimuxTmux('join-pane -d -s '.g:VimuxRunnerIndex.' -p '.VimuxOption('g:VimuxHeight', 20))
112112
let g:VimuxRunnerType = 'pane'
113113
elseif s:runnerType() ==# 'pane'
114-
let g:VimuxRunnerIndex=substitute(s:tmux('break-pane -d -t '.g:VimuxRunnerIndex." -P -F '#{window_id}'"), '\n', '', '')
114+
let g:VimuxRunnerIndex=substitute(VimuxTmux('break-pane -d -t '.g:VimuxRunnerIndex." -P -F '#{window_id}'"), '\n', '', '')
115115
let g:VimuxRunnerType = 'window'
116116
endif
117117
endif
@@ -120,27 +120,27 @@ endfunction
120120
function! VimuxZoomRunner()
121121
if exists('g:VimuxRunnerIndex')
122122
if s:runnerType() ==# 'pane'
123-
call s:tmux('resize-pane -Z -t '.g:VimuxRunnerIndex)
123+
call VimuxTmux('resize-pane -Z -t '.g:VimuxRunnerIndex)
124124
elseif s:runnerType() ==# 'window'
125-
call s:tmux('select-window -t '.g:VimuxRunnerIndex)
125+
call VimuxTmux('select-window -t '.g:VimuxRunnerIndex)
126126
endif
127127
endif
128128
endfunction
129129

130130
function! VimuxInspectRunner()
131-
call s:tmux('select-'.s:runnerType().' -t '.g:VimuxRunnerIndex)
132-
call s:tmux('copy-mode')
131+
call VimuxTmux('select-'.s:runnerType().' -t '.g:VimuxRunnerIndex)
132+
call VimuxTmux('copy-mode')
133133
endfunction
134134

135135
function! VimuxScrollUpInspect()
136136
call VimuxInspectRunner()
137-
call s:tmux('last-'.s:runnerType())
137+
call VimuxTmux('last-'.s:runnerType())
138138
call VimuxSendKeys('C-u')
139139
endfunction
140140

141141
function! VimuxScrollDownInspect()
142142
call VimuxInspectRunner()
143-
call s:tmux('last-'.s:runnerType())
143+
call VimuxTmux('last-'.s:runnerType())
144144
call VimuxSendKeys('C-d')
145145
endfunction
146146

@@ -156,7 +156,7 @@ endfunction
156156

157157
function! VimuxClearRunnerHistory()
158158
if exists('g:VimuxRunnerIndex')
159-
call s:tmux('clear-history -t '.g:VimuxRunnerIndex)
159+
call VimuxTmux('clear-history -t '.g:VimuxRunnerIndex)
160160
endif
161161
endfunction
162162

@@ -166,7 +166,7 @@ function! VimuxPromptCommand(...)
166166
call VimuxRunCommand(l:command)
167167
endfunction
168168

169-
function! s:tmux(arguments)
169+
function! VimuxTmux(arguments)
170170
if VimuxOption('g:VimuxDebug', 0) != 0
171171
echom s:tmuxCmd().' '.a:arguments
172172
endif
@@ -196,7 +196,7 @@ endfunction
196196
function! s:nearestIndex()
197197
let t = s:runnerType()
198198
let filter = s:getTargetFilter()
199-
let views = split(s:tmux('list-'.t."s -F '#{".t.'_active}:#{'.t."_id}'".filter), '\n')
199+
let views = split(VimuxTmux('list-'.t."s -F '#{".t.'_active}:#{'.t."_id}'".filter), '\n')
200200
for view in views
201201
if match(view, '1:') ==# -1
202202
return split(view, ':')[1]
@@ -225,9 +225,9 @@ function! s:setRunnerName()
225225
endif
226226
let t = s:runnerType()
227227
if t ==# 'window'
228-
call s:tmux('rename-window '.targetName)
228+
call VimuxTmux('rename-window '.targetName)
229229
elseif t ==# 'pane'
230-
call s:tmux('select-pane -T '.targetName)
230+
call VimuxTmux('select-pane -T '.targetName)
231231
endif
232232
endfunction
233233

@@ -236,10 +236,10 @@ function! s:runnerType()
236236
endfunction
237237

238238
function! s:tmuxProperty(property)
239-
return substitute(s:tmux("display -p '".a:property."'"), '\n$', '', '')
239+
return substitute(VimuxTmux("display -p '".a:property."'"), '\n$', '', '')
240240
endfunction
241241

242242
function! s:hasRunner(index)
243243
let t = s:runnerType()
244-
return match(s:tmux('list-'.t."s -F '#{".t."_id}'"), a:index)
244+
return match(VimuxTmux('list-'.t."s -F '#{".t."_id}'"), a:index)
245245
endfunction

0 commit comments

Comments
 (0)