Fix ruby namespacing issue with Command-T

Closes #6.
This commit is contained in:
Tim Pope 2012-12-07 09:40:33 -05:00
parent 1a036ebed1
commit 9161a36da0

View File

@ -183,7 +183,7 @@ class << ::VIM
'"' + str.gsub(/[\000-\037"\\]/) { |x| "\\%03o" % (x.respond_to?(:ord) ? x.ord : x[0]) } + '"' '"' + str.gsub(/[\000-\037"\\]/) { |x| "\\%03o" % (x.respond_to?(:ord) ? x.ord : x[0]) } + '"'
end end
def let(var, value) def let(var, value)
VIM.command("let #{var} = #{string_encode(value)}") command("let #{var} = #{string_encode(value)}")
end end
end end
. .
@ -194,18 +194,18 @@ function! s:nrepl_call(payload) dict abort
begin begin
buffer = '' buffer = ''
Timeout.timeout(16) do Timeout.timeout(16) do
TCPSocket.open(VIM.evaluate('self.host'), VIM.evaluate('self.port').to_i) do |s| TCPSocket.open(::VIM.evaluate('self.host'), ::VIM.evaluate('self.port').to_i) do |s|
s.write(VIM.evaluate('payload')) s.write(::VIM.evaluate('payload'))
loop do loop do
body = s.readpartial(8192) body = s.readpartial(8192)
buffer << body buffer << body
break if body.include?("6:statusl4:done") break if body.include?("6:statusl4:done")
end end
VIM.let('out', buffer) ::VIM.let('out', buffer)
end end
end end
rescue rescue
VIM.let('err', $!.to_s) ::VIM.let('err', $!.to_s)
end end
. .
if !exists('err') if !exists('err')