Class: Neovim::WriteBuf

Inherits:
WriteStd show all
Defined in:
lib/neovim/output.rb

Instance Method Summary collapse

Methods inherited from WriteStd

redirect, #write

Methods inherited from Write

#<<, #flush, open, #print, #puts

Constructor Details

#initialize(*args, whole: nil, top: nil) ⇒ WriteBuf

Returns a new instance of WriteBuf.



140
141
142
143
144
# File 'lib/neovim/output.rb', line 140

def initialize *args, whole: nil, top: nil
  super
  @lines = []
  @whole, @top = whole, top
end

Instance Method Details

#finishObject



145
146
147
148
149
150
151
152
# File 'lib/neovim/output.rb', line 145

def finish
  super
  if @whole then
    @client.buf_set_lines 0, 0, -1, true, @lines
  else
    @client.put @lines, "l", true, !@top
  end
end