@@ -38,13 +38,13 @@ function VimuxRunCommand(command, ...)
38
38
let l: autoreturn = a: 1
39
39
endif
40
40
41
- let g : _VimTmuxCmd = a: command
42
- let g : _VimTmuxCmdAutoreturn = l: autoreturn
41
+ let s : _VimTmuxCmd = substitute ( a: command, ' ` ' , ' \\` ' , ' g ' )
42
+ let s : _VimTmuxCmdAutoreturn = l: autoreturn
43
43
44
44
if l: autoreturn == 1
45
- ruby CurrentTmuxSession.new .run_shell_command (Vim.evaluate (" g :_VimTmuxCmd" ))
45
+ ruby CurrentTmuxSession.new .run_shell_command (Vim.evaluate (" s :_VimTmuxCmd" ))
46
46
else
47
- ruby CurrentTmuxSession.new .run_shell_command (Vim.evaluate (" g :_VimTmuxCmd" ), false)
47
+ ruby CurrentTmuxSession.new .run_shell_command (Vim.evaluate (" s :_VimTmuxCmd" ), false)
48
48
endif
49
49
endfunction
50
50
@@ -57,23 +57,23 @@ function RunVimTmuxCommand(command, ...)
57
57
let l: autoreturn = a: 1
58
58
endif
59
59
60
- let g : _VimTmuxCmd = a: command
61
- let g : _VimTmuxCmdAutoreturn = l: autoreturn
60
+ let s : _VimTmuxCmd = substitute ( a: command, ' ` ' , ' \\` ' , ' g ' )
61
+ let s : _VimTmuxCmdAutoreturn = l: autoreturn
62
62
63
63
if l: autoreturn == 1
64
- ruby CurrentTmuxSession.new .run_shell_command (Vim.evaluate (" g :_VimTmuxCmd" ))
64
+ ruby CurrentTmuxSession.new .run_shell_command (Vim.evaluate (" s :_VimTmuxCmd" ))
65
65
else
66
- ruby CurrentTmuxSession.new .run_shell_command (Vim.evaluate (" g :_VimTmuxCmd" ), false)
66
+ ruby CurrentTmuxSession.new .run_shell_command (Vim.evaluate (" s :_VimTmuxCmd" ), false)
67
67
endif
68
68
endfunction
69
69
70
70
71
71
function VimuxRunLastCommand ()
72
- if exists (" g :_VimTmuxCmd" )
73
- if g : _VimTmuxCmdAutoreturn == 1
74
- ruby CurrentTmuxSession.new .run_shell_command (Vim.evaluate (" g :_VimTmuxCmd" ))
72
+ if exists (" s :_VimTmuxCmd" )
73
+ if s : _VimTmuxCmdAutoreturn == 1
74
+ ruby CurrentTmuxSession.new .run_shell_command (Vim.evaluate (" s :_VimTmuxCmd" ))
75
75
else
76
- ruby CurrentTmuxSession.new .run_shell_command (Vim.evaluate (" g :_VimTmuxCmd" ), false)
76
+ ruby CurrentTmuxSession.new .run_shell_command (Vim.evaluate (" s :_VimTmuxCmd" ), false)
77
77
endif
78
78
else
79
79
echo " No last command"
@@ -87,8 +87,8 @@ endfunction
87
87
88
88
89
89
function VimuxClearWindow ()
90
- if exists (" g :_VimTmuxRunnerPane" )
91
- unlet g : _VimTmuxRunnerPane
90
+ if exists (" s :_VimTmuxRunnerPane" )
91
+ unlet s : _VimTmuxRunnerPane
92
92
end
93
93
endfunction
94
94
@@ -181,19 +181,19 @@ class TmuxSession
181
181
end
182
182
183
183
def vim_cached_runner_pane
184
- if Vim.evaluate (' exists("g :_VimTmuxRunnerPane")' ) != 0
185
- Vim.evaluate (' g :_VimTmuxRunnerPane' )
184
+ if Vim.evaluate (' exists("s :_VimTmuxRunnerPane")' ) != 0
185
+ Vim.evaluate (' s :_VimTmuxRunnerPane' )
186
186
else
187
187
nil
188
188
end
189
189
end
190
190
191
191
def vim_cached_runner_pane= (runner_pane)
192
- Vim.command (" let g :_VimTmuxRunnerPane = '#{runner_pane}'" )
192
+ Vim.command (" let s :_VimTmuxRunnerPane = '#{runner_pane}'" )
193
193
end
194
194
195
195
def clear_vim_cached_runner_pane
196
- Vim.command (" unlet g :_VimTmuxRunnerPane" )
196
+ Vim.command (" unlet s :_VimTmuxRunnerPane" )
197
197
end
198
198
199
199
def clear_runner_history
@@ -271,7 +271,7 @@ class TmuxSession
271
271
end
272
272
@r unner_pane = active_pane_id
273
273
_send_command (" cd #{`pwd`}" , target (:pane = > runner_pane))
274
- Vim.command (" let g :_VimTmuxRunnerPane = '#{@runner_pane}'" )
274
+ Vim.command (" let s :_VimTmuxRunnerPane = '#{@runner_pane}'" )
275
275
end
276
276
277
277
_run (' list-panes' ).split (" \n " ).map do |line|
0 commit comments