Class: Neovim::ConnectionChild
Constant Summary
Constants included
from Logging
Logging::DEFAULT_LEVEL, Logging::LEVELS
Instance Attribute Summary
Attributes inherited from Connection
#client
Class Method Summary
collapse
Methods inherited from Connection
#additional_data, #error, #initialize, #start
Methods included from Logging
put
Class Method Details
.open_files(*argv) ⇒ Object
96
97
98
99
100
101
102
103
104
|
# File 'lib/neovim/connection.rb', line 96
def open_files *argv
eb = "--embed"
argv.unshift eb unless argv.include? eb
argv.unshift path
IO.popen argv, "r+" do |io|
Process.detach io.pid
yield (new io, io)
end
end
|
106
107
108
|
# File 'lib/neovim/connection.rb', line 106
def path
ENV[ "NVIM_EXECUTABLE"].notempty? || "nvim"
end
|
.stdpath(what) ⇒ Object
116
117
118
119
120
121
|
# File 'lib/neovim/connection.rb', line 116
def stdpath what
cmd = [ path, "--headless", ]
cmd.push "-c", "echo stdpath(#{what.to_s.inspect})"
cmd.push "-c", "q"
(pipe_stderr cmd)&.tap { |x| x.chomp! }
end
|
110
111
112
113
114
|
# File 'lib/neovim/connection.rb', line 110
def version
IO.popen [ path, "--version"] do |io|
io.gets[ /\ANVIM +v?(.+)/, 1]
end
end
|