Class: Neovim::Buffer
Overview
Class representing an nvim
buffer.
Instance Attribute Summary
Attributes inherited from RemoteObject
#index
Instance Method Summary
collapse
-
#add_highlight(src_id, hl_group, line, col_start, col_end) ⇒ Fixnum
-
#clear_highlight(src_id, line_start, line_end) ⇒ void
-
#del_line(index) ⇒ void
-
#get_line(index) ⇒ String
-
#get_line_slice(start, end) ⇒ Array<String>
-
#get_mark(name) ⇒ Array<Fixnum>
-
#get_name ⇒ String
-
#get_number ⇒ Fixnum
-
#get_option(name) ⇒ Object
-
#get_var(name) ⇒ Object
-
#insert(lnum, lines) ⇒ void
-
#is_valid ⇒ Boolean
-
#line_count ⇒ Fixnum
-
#lines ⇒ LineRange
A LineRange
object representing the buffer’s lines.
-
#lines=(strs) ⇒ Array<String>
Replace all the lines of the buffer.
-
#range ⇒ LineRange
A LineRange
object representing the buffer’s selection range.
-
#range=(_range) ⇒ LineRange
Set the buffer’s current selection range.
-
#set_line(index, line) ⇒ void
-
#set_line_slice(start, end) ⇒ void
-
#set_name(name) ⇒ void
-
#set_option(name, value) ⇒ void
-
#set_var(name, value) ⇒ Object
#==, #initialize, #method_missing, #methods, #respond_to?, #to_msgpack
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Neovim::RemoteObject
Instance Method Details
#add_highlight(src_id, hl_group, line, col_start, col_end) ⇒ Fixnum
|
# File 'lib/neovim/buffer.rb', line 43
|
#clear_highlight(src_id, line_start, line_end) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/buffer.rb', line 43
|
#del_line(index) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/buffer.rb', line 43
|
#get_line(index) ⇒ String
|
# File 'lib/neovim/buffer.rb', line 43
|
#get_line_slice(start, end) ⇒ Array<String>
|
# File 'lib/neovim/buffer.rb', line 43
|
#get_mark(name) ⇒ Array<Fixnum>
|
# File 'lib/neovim/buffer.rb', line 43
|
#get_name ⇒ String
|
# File 'lib/neovim/buffer.rb', line 43
|
#get_number ⇒ Fixnum
|
# File 'lib/neovim/buffer.rb', line 43
|
#get_option(name) ⇒ Object
|
# File 'lib/neovim/buffer.rb', line 43
|
#get_var(name) ⇒ Object
|
# File 'lib/neovim/buffer.rb', line 43
|
#insert(lnum, lines) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/buffer.rb', line 43
|
#is_valid ⇒ Boolean
|
# File 'lib/neovim/buffer.rb', line 43
|
#line_count ⇒ Fixnum
|
# File 'lib/neovim/buffer.rb', line 43
|
A LineRange
object representing the buffer’s lines.
11
12
13
|
# File 'lib/neovim/buffer.rb', line 11
def lines
@lines ||= LineRange.new(self, 0, -1)
end
|
#lines=(strs) ⇒ Array<String>
Replace all the lines of the buffer.
19
20
21
|
# File 'lib/neovim/buffer.rb', line 19
def lines=(strs)
lines[0..-1] = strs
end
|
A LineRange
object representing the buffer’s selection range.
27
28
29
|
# File 'lib/neovim/buffer.rb', line 27
def range
@range ||= LineRange.new(self, 0, -1)
end
|
Set the buffer’s current selection range.
36
37
38
39
|
# File 'lib/neovim/buffer.rb', line 36
def range=(_range)
_end = _range.exclude_end? ? _range.end - 1 : _range.end
@range = LineRange.new(self, _range.begin, _end)
end
|
#set_line(index, line) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/buffer.rb', line 43
|
#set_line_slice(start, end) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/buffer.rb', line 43
|
#set_name(name) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/buffer.rb', line 43
|
#set_option(name, value) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/buffer.rb', line 43
|
#set_var(name, value) ⇒ Object
|
# File 'lib/neovim/buffer.rb', line 43
|