Class: Neovim::Window

Inherits:
RemoteObject show all
Defined in:
lib/neovim/window.rb,
lib/neovim/ruby_provider/window_ext.rb

Overview

Class representing an nvim window.

The methods documented here were generated using NVIM v0.2.2

Instance Attribute Summary

Attributes inherited from RemoteObject

#index

Class Method Summary collapse

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

Class Method Details

.[](index) ⇒ Object



13
14
15
# File 'lib/neovim/ruby_provider/window_ext.rb', line 13

def self.[](index)
  ::Vim.get_current_tabpage.list_wins[index]
end

.countObject



9
10
11
# File 'lib/neovim/ruby_provider/window_ext.rb', line 9

def self.count
  ::Vim.get_current_tabpage.list_wins.size
end

.currentObject



5
6
7
# File 'lib/neovim/ruby_provider/window_ext.rb', line 5

def self.current
  ::Vim.get_current_win
end

Instance Method Details

#bufferBuffer

Get the buffer displayed in the window

Returns:



11
12
13
# File 'lib/neovim/window.rb', line 11

def buffer
  get_buf
end

#cursorArray(Integer, Integer)

Get the cursor coordinates

Returns:

  • (Array(Integer, Integer))


50
51
52
# File 'lib/neovim/window.rb', line 50

def cursor
  get_cursor
end

#cursor=(coords) ⇒ Array(Integer, Integer)

Set the cursor coodinates

Parameters:

  • coords (Array(Integer, Integer))

Returns:

  • (Array(Integer, Integer))


58
59
60
61
62
63
# 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

#del_var(window, name) ⇒ void

This method returns an undefined value.

See :h nvim_win_del_var()

Parameters:

  • window (Window)
  • name (String)


# File 'lib/neovim/window.rb', line 67


#get_buf(window) ⇒ Buffer

See :h nvim_win_get_buf()

Parameters:

Returns:



# File 'lib/neovim/window.rb', line 67


#get_cursor(window) ⇒ Array<Integer>

See :h nvim_win_get_cursor()

Parameters:

Returns:

  • (Array<Integer>)


# File 'lib/neovim/window.rb', line 67


#get_height(window) ⇒ Integer

See :h nvim_win_get_height()

Parameters:

Returns:

  • (Integer)


# File 'lib/neovim/window.rb', line 67


#get_number(window) ⇒ Integer

See :h nvim_win_get_number()

Parameters:

Returns:

  • (Integer)


# File 'lib/neovim/window.rb', line 67


#get_option(window, name) ⇒ Object

See :h nvim_win_get_option()

Parameters:

  • window (Window)
  • name (String)

Returns:

  • (Object)


# File 'lib/neovim/window.rb', line 67


#get_position(window) ⇒ Array<Integer>

See :h nvim_win_get_position()

Parameters:

Returns:

  • (Array<Integer>)


# File 'lib/neovim/window.rb', line 67


#get_tabpage(window) ⇒ Tabpage

See :h nvim_win_get_tabpage()

Parameters:

Returns:



# File 'lib/neovim/window.rb', line 67


#get_var(window, name) ⇒ Object

See :h nvim_win_get_var()

Parameters:

  • window (Window)
  • name (String)

Returns:

  • (Object)


# File 'lib/neovim/window.rb', line 67


#get_width(window) ⇒ Integer

See :h nvim_win_get_width()

Parameters:

Returns:

  • (Integer)


# File 'lib/neovim/window.rb', line 67


#heightInteger

Get the height of the window

Returns:

  • (Integer)


18
19
20
# File 'lib/neovim/window.rb', line 18

def height
  get_height
end

#height=(height) ⇒ Integer

Set the height of the window

Parameters:

  • height (Integer)

Returns:

  • (Integer)


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

def height=(height)
  set_height(height)
  height
end

#is_valid(window) ⇒ Boolean

See :h nvim_win_is_valid()

Parameters:

Returns:

  • (Boolean)


# File 'lib/neovim/window.rb', line 67


#set_cursor(window, pos) ⇒ void

This method returns an undefined value.

See :h nvim_win_set_cursor()

Parameters:

  • window (Window)
  • pos (Array<Integer>)


# File 'lib/neovim/window.rb', line 67


#set_height(window, height) ⇒ void

This method returns an undefined value.

See :h nvim_win_set_height()

Parameters:

  • window (Window)
  • height (Integer)


# File 'lib/neovim/window.rb', line 67


#set_option(window, name, value) ⇒ void

This method returns an undefined value.

See :h nvim_win_set_option()

Parameters:

  • window (Window)
  • name (String)
  • value (Object)


# File 'lib/neovim/window.rb', line 67


#set_var(window, name, value) ⇒ void

This method returns an undefined value.

See :h nvim_win_set_var()

Parameters:

  • window (Window)
  • name (String)
  • value (Object)


# File 'lib/neovim/window.rb', line 67


#set_width(window, width) ⇒ void

This method returns an undefined value.

See :h nvim_win_set_width()

Parameters:

  • window (Window)
  • width (Integer)


# File 'lib/neovim/window.rb', line 67


#widthInteger

Get the width of the window

Returns:

  • (Integer)


34
35
36
# File 'lib/neovim/window.rb', line 34

def width
  get_width
end

#width=(width) ⇒ Integer

Set the width of the window

Parameters:

  • width (Integer)

Returns:

  • (Integer)


42
43
44
45
# File 'lib/neovim/window.rb', line 42

def width=(width)
  set_width(width)
  width
end