| Class | Neovim::LineRange |
| In: |
lib/neovim/line_range.rb
|
| Parent: | Object |
Provide an enumerable interface for dealing with ranges of lines.
Access the line at the given index within the range.
@overload [](index)
@param index [Integer]
@overload [](range)
@param range [Range]
@overload [](index, length)
@param index [Integer] @param length [Integer]
@example Get the first line using an index
line_range[0] # => "first"
@example Get the first two lines using a Range
line_range[0..1] # => ["first", "second"]
@example Get the first two lines using an index and length
line_range[0, 2] # => ["first", "second"]
Set the line at the given index within the range.
@overload []=(index, string)
@param index [Integer] @param string [String]
@overload []=(index, length, strings)
@param index [Integer] @param length [Integer] @param strings [Array<String>]
@overload []=(range, strings)
@param range [Range] @param strings [Array<String>]
@example Replace the first line using an index
line_range[0] = "first"
@example Replace the first two lines using a Range
line_range[0..1] = ["first", "second"]
@example Replace the first two lines using an index and length
line_range[0, 2] = ["first", "second"]