class Neovim::Window

@api private

Class representing an nvim window.

The methods documented here were generated using NVIM v0.5.0

Public Class Methods

[](index) click to toggle source
# File lib/neovim/ruby_provider/window_ext.rb, line 14
def self.[](index)
  ::Vim.get_current_tabpage.list_wins[index]
end
count() click to toggle source
# File lib/neovim/ruby_provider/window_ext.rb, line 10
def self.count
  ::Vim.get_current_tabpage.list_wins.size
end
current() click to toggle source
# File lib/neovim/ruby_provider/window_ext.rb, line 6
def self.current
  ::Vim.get_current_win
end

Public Instance Methods

buffer() click to toggle source

Get the buffer displayed in the window

@return [Buffer]

# File lib/neovim/window.rb, line 11
def buffer
  get_buf
end
cursor() click to toggle source

Get the cursor coordinates

@return [Array(Integer, Integer)]

# File lib/neovim/window.rb, line 50
def cursor
  get_cursor
end
cursor=(coords) click to toggle source

Set the cursor coodinates

@param coords [Array(Integer, Integer)] @return [Array(Integer, Integer)]

# File lib/neovim/window.rb, line 58
def cursor=(coords)
  x, y = coords
  x = [x, 1].max
  y = [y, 0].max + 1
  @session.request(:nvim_eval, "cursor(#{x}, #{y})")
end
height() click to toggle source

Get the height of the window

@return [Integer]

# File lib/neovim/window.rb, line 18
def height
  get_height
end
height=(height) click to toggle source

Set the height of the window

@param height [Integer] @return [Integer]

# File lib/neovim/window.rb, line 26
def height=(height)
  set_height(height)
  height
end
width() click to toggle source

Get the width of the window

@return [Integer]

# File lib/neovim/window.rb, line 34
def width
  get_width
end
width=(width) click to toggle source

Set the width of the window

@param width [Integer] @return [Integer]

# File lib/neovim/window.rb, line 42
def width=(width)
  set_width(width)
  width
end