Class: Neovim::Window

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

Overview

Make VIM::Window.current return the current buffer.

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

.currentObject



24
25
26
# File 'lib/neovim/ruby_provider.rb', line 24

def self.current
  ::VIM.current.window
end

Instance Method Details

#bufferBuffer

Get the buffer displayed in the window

Returns:



16
17
18
# File 'lib/neovim/window.rb', line 16

def buffer
  get_buffer
end

#cursorArray(Fixnum, Fixnum)

Get the cursor coordinates

Returns:

  • (Array(Fixnum, Fixnum))


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

def cursor
  @cursor ||= Cursor.new(self)
end

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

Set the cursor coodinates

Parameters:

  • coords (Array(Fixnum, Fixnum))

Returns:

  • (Array(Fixnum, Fixnum))


63
64
65
# File 'lib/neovim/window.rb', line 63

def cursor=(coords)
  set_cursor(coords)
end

#get_bufferBuffer

Returns:



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

#get_cursorArray<Fixnum>

Returns:

  • (Array<Fixnum>)


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

#get_heightFixnum

Returns:

  • (Fixnum)


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

#get_option(name) ⇒ Object

Parameters:

  • name (String)

Returns:

  • (Object)


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

#get_positionArray<Fixnum>

Returns:

  • (Array<Fixnum>)


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

#get_tabpageTabpage

Returns:



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

#get_var(name) ⇒ Object

Parameters:

  • name (String)

Returns:

  • (Object)


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

#get_widthFixnum

Returns:

  • (Fixnum)


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

#heightFixnum

Get the height of the window

Returns:

  • (Fixnum)


23
24
25
# File 'lib/neovim/window.rb', line 23

def height
  get_height
end

#height=(height) ⇒ Fixnum

Set the height of the window

Parameters:

  • height (Fixnum)

Returns:

  • (Fixnum)


31
32
33
34
# File 'lib/neovim/window.rb', line 31

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

#is_validBoolean

Returns:

  • (Boolean)


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

#set_cursor(pos) ⇒ void

This method returns an undefined value.

Parameters:

  • pos (Array<Fixnum>)


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

#set_height(height) ⇒ void

This method returns an undefined value.

Parameters:

  • height (Fixnum)


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

#set_option(name, value) ⇒ void

This method returns an undefined value.

Parameters:

  • name (String)
  • value (Object)


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

#set_var(name, value) ⇒ Object

Parameters:

  • name (String)
  • value (Object)

Returns:

  • (Object)


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

#set_width(width) ⇒ void

This method returns an undefined value.

Parameters:

  • width (Fixnum)


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

#widthFixnum

Get the width of the window

Returns:

  • (Fixnum)


39
40
41
# File 'lib/neovim/window.rb', line 39

def width
  get_width
end

#width=(width) ⇒ Fixnum

Set the width of the window

Parameters:

  • width (Fixnum)

Returns:

  • (Fixnum)


47
48
49
50
# File 'lib/neovim/window.rb', line 47

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