Class: Neovim::Current

Inherits:
Object
  • Object
show all
Defined in:
lib/neovim/current.rb

Overview

Support for Client#current chaining.

Instance Method Summary collapse

Constructor Details

#initialize(session) ⇒ Current

Returns a new instance of Current


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

def initialize(session)
  @session = session
end

Instance Method Details

#bufferBuffer

Get the active buffer.

Returns:


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

def buffer
  @session.request(:nvim_get_current_buf)
end

#buffer=(buffer) ⇒ Buffer, Integer

Set the active buffer.

Parameters:

  • buffer (Buffer, Integer)

    The target buffer or index.

Returns:


40
41
42
# File 'lib/neovim/current.rb', line 40

def buffer=(buffer)
  @session.request(:nvim_set_current_buf, buffer)
end

#lineString

Get the line under the cursor.

Returns:

  • (String)

17
18
19
# File 'lib/neovim/current.rb', line 17

def line
  @session.request(:nvim_get_current_line)
end

#line=(line) ⇒ String

Set the line under the cursor.

Parameters:

  • line (String)

    The target line contents.

Returns:

  • (String)

25
26
27
# File 'lib/neovim/current.rb', line 25

def line=(line)
  @session.request(:nvim_set_current_line, line)
end

#tabpageTabpage

Get the active tabpage.

Returns:


62
63
64
# File 'lib/neovim/current.rb', line 62

def tabpage
  @session.request(:nvim_get_current_tabpage)
end

#tabpage=(tabpage) ⇒ Tabpage, Integer

Set the active tabpage.

Parameters:

  • tabpage (Tabpage, Integer)

    The target tabpage or index.

Returns:


70
71
72
# File 'lib/neovim/current.rb', line 70

def tabpage=(tabpage)
  @session.request(:nvim_set_current_tabpage, tabpage)
end

#windowWindow

Get the active window.

Returns:


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

def window
  @session.request(:nvim_get_current_win)
end

#window=(window) ⇒ Window, Integer

Set the active window.

Parameters:

  • window (Window, Integer)

    The target window or index.

Returns:


55
56
57
# File 'lib/neovim/current.rb', line 55

def window=(window)
  @session.request(:nvim_set_current_win, window)
end