Class: Neovim::Buffer

Inherits:
RemoteObject show all
Defined in:
lib/neovim/buffer.rb

Overview

Class representing an nvim buffer.

Instance Attribute Summary

Attributes inherited from RemoteObject

#index

Instance Method Summary collapse

Methods inherited from RemoteObject

#==, #initialize, #method_missing, #methods, #respond_to?, #to_msgpack

Constructor Details

This class inherits a constructor from Neovim::RemoteObject

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

Parameters:

  • src_id (Fixnum)
  • hl_group (String)
  • line (Fixnum)
  • col_start (Fixnum)
  • col_end (Fixnum)

Returns:

  • (Fixnum)


# File 'lib/neovim/buffer.rb', line 43

#clear_highlight(src_id, line_start, line_end) ⇒ void

This method returns an undefined value.

Parameters:

  • src_id (Fixnum)
  • line_start (Fixnum)
  • line_end (Fixnum)


# File 'lib/neovim/buffer.rb', line 43

#del_line(index) ⇒ void

This method returns an undefined value.

Parameters:

  • index (Fixnum)


# File 'lib/neovim/buffer.rb', line 43

#get_line(index) ⇒ String

Parameters:

  • index (Fixnum)

Returns:

  • (String)


# File 'lib/neovim/buffer.rb', line 43

#get_line_slice(start, end) ⇒ Array<String>

Parameters:

  • start (Fixnum)
  • end (Fixnum)
  • include_start (Boolean)
  • include_end (Boolean)

Returns:

  • (Array<String>)


# File 'lib/neovim/buffer.rb', line 43

#get_mark(name) ⇒ Array<Fixnum>

Parameters:

  • name (String)

Returns:

  • (Array<Fixnum>)


# File 'lib/neovim/buffer.rb', line 43

#get_nameString

Returns:

  • (String)


# File 'lib/neovim/buffer.rb', line 43

#get_numberFixnum

Returns:

  • (Fixnum)


# File 'lib/neovim/buffer.rb', line 43

#get_option(name) ⇒ Object

Parameters:

  • name (String)

Returns:

  • (Object)


# File 'lib/neovim/buffer.rb', line 43

#get_var(name) ⇒ Object

Parameters:

  • name (String)

Returns:

  • (Object)


# File 'lib/neovim/buffer.rb', line 43

#insert(lnum, lines) ⇒ void

This method returns an undefined value.

Parameters:

  • lnum (Fixnum)
  • lines (Array<String>)


# File 'lib/neovim/buffer.rb', line 43

#is_validBoolean

Returns:

  • (Boolean)


# File 'lib/neovim/buffer.rb', line 43

#line_countFixnum

Returns:

  • (Fixnum)


# File 'lib/neovim/buffer.rb', line 43

#linesLineRange

A LineRange object representing the buffer’s lines.

Returns:

See Also:



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.

Parameters:

  • strs (Array<String>)

    The replacement lines

Returns:

  • (Array<String>)


19
20
21
# File 'lib/neovim/buffer.rb', line 19

def lines=(strs)
  lines[0..-1] = strs
end

#rangeLineRange

A LineRange object representing the buffer’s selection range.

Returns:

See Also:



27
28
29
# File 'lib/neovim/buffer.rb', line 27

def range
  @range ||= LineRange.new(self, 0, -1)
end

#range=(_range) ⇒ LineRange

Set the buffer’s current selection range.

Parameters:

  • _range (Range)

    The replacement range

Returns:

See Also:



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.

Parameters:

  • index (Fixnum)
  • line (String)


# File 'lib/neovim/buffer.rb', line 43

#set_line_slice(start, end) ⇒ void

This method returns an undefined value.

Parameters:

  • start (Fixnum)
  • end (Fixnum)
  • include_start (Boolean)
  • include_end (Boolean)
  • replacement (Array<String>)


# File 'lib/neovim/buffer.rb', line 43

#set_name(name) ⇒ void

This method returns an undefined value.

Parameters:

  • name (String)


# File 'lib/neovim/buffer.rb', line 43

#set_option(name, value) ⇒ void

This method returns an undefined value.

Parameters:

  • name (String)
  • value (Object)


# File 'lib/neovim/buffer.rb', line 43

#set_var(name, value) ⇒ Object

Parameters:

  • name (String)
  • value (Object)

Returns:

  • (Object)


# File 'lib/neovim/buffer.rb', line 43