Class: Neovim::Window Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

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_missing?, #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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

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

.countObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

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

.currentObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

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

#call(fun) ⇒ Object

See :h nvim_win_call()

Parameters:

  • fun (LuaRef)

Returns:



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

#close(force) ⇒ void

This method returns an undefined value.

See :h nvim_win_close()

Parameters:

  • force (Boolean)


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

#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(name) ⇒ void

This method returns an undefined value.

See :h nvim_win_del_var()

Parameters:

  • name (String)


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

#get_bufBuffer

See :h nvim_win_get_buf()

Returns:



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

#get_configHash

See :h nvim_win_get_config()

Returns:

  • (Hash)


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

#get_cursorArray<Integer>

See :h nvim_win_get_cursor()

Returns:

  • (Array<Integer>)


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

#get_heightInteger

See :h nvim_win_get_height()

Returns:

  • (Integer)


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

#get_numberInteger

See :h nvim_win_get_number()

Returns:

  • (Integer)


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

#get_option(name) ⇒ Object

See :h nvim_win_get_option()

Parameters:

  • name (String)

Returns:



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

#get_positionArray<Integer>

See :h nvim_win_get_position()

Returns:

  • (Array<Integer>)


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

#get_tabpageTabpage

See :h nvim_win_get_tabpage()

Returns:



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

#get_var(name) ⇒ Object

See :h nvim_win_get_var()

Parameters:

  • name (String)

Returns:



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

#get_widthInteger

See :h nvim_win_get_width()

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

#hidevoid

This method returns an undefined value.

See :h nvim_win_hide()



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

#is_validBoolean

See :h nvim_win_is_valid()

Returns:

  • (Boolean)


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

#set_buf(buffer) ⇒ void

This method returns an undefined value.

See :h nvim_win_set_buf()

Parameters:



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

#set_config(config) ⇒ void

This method returns an undefined value.

See :h nvim_win_set_config()

Parameters:

  • config (Hash)


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

#set_cursor(pos) ⇒ void

This method returns an undefined value.

See :h nvim_win_set_cursor()

Parameters:

  • pos (Array<Integer>)


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

#set_height(height) ⇒ void

This method returns an undefined value.

See :h nvim_win_set_height()

Parameters:

  • height (Integer)


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

#set_hl_ns(ns_id) ⇒ void

This method returns an undefined value.

See :h nvim_win_set_hl_ns()

Parameters:

  • ns_id (Integer)


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

#set_option(name, value) ⇒ void

This method returns an undefined value.

See :h nvim_win_set_option()

Parameters:

  • name (String)
  • value (Object)


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

#set_var(name, value) ⇒ void

This method returns an undefined value.

See :h nvim_win_set_var()

Parameters:

  • name (String)
  • value (Object)


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

#set_width(width) ⇒ void

This method returns an undefined value.

See :h nvim_win_set_width()

Parameters:

  • width (Integer)


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

#text_height(opts) ⇒ Hash

See :h nvim_win_text_height()

Parameters:

  • opts (Hash)

Returns:

  • (Hash)


# 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