class Neovim::Current

Support for +Client#current+ chaining.

@see Client#current

Public Class Methods

new(session) click to toggle source
# File lib/neovim/current.rb, line 10
def initialize(session)
  @session = session
end

Public Instance Methods

buffer() click to toggle source

Get the active buffer.

@return [Buffer]

# File lib/neovim/current.rb, line 32
def buffer
  @session.request(:nvim_get_current_buf)
end
buffer=(buffer) click to toggle source

Set the active buffer.

@param buffer [Buffer, Integer] The target buffer or index. @return [Buffer, Integer]

# File lib/neovim/current.rb, line 40
def buffer=(buffer)
  @session.request(:nvim_set_current_buf, buffer)
end
line() click to toggle source

Get the line under the cursor.

@return [String]

# File lib/neovim/current.rb, line 17
def line
  @session.request(:nvim_get_current_line)
end
line=(line) click to toggle source

Set the line under the cursor.

@param line [String] The target line contents. @return [String]

# File lib/neovim/current.rb, line 25
def line=(line)
  @session.request(:nvim_set_current_line, line)
end
tabpage() click to toggle source

Get the active tabpage.

@return [Tabpage]

# File lib/neovim/current.rb, line 62
def tabpage
  @session.request(:nvim_get_current_tabpage)
end
tabpage=(tabpage) click to toggle source

Set the active tabpage.

@param tabpage [Tabpage, Integer] The target tabpage or index. @return [Tabpage, Integer]

# File lib/neovim/current.rb, line 70
def tabpage=(tabpage)
  @session.request(:nvim_set_current_tabpage, tabpage)
end
window() click to toggle source

Get the active window.

@return [Window]

# File lib/neovim/current.rb, line 47
def window
  @session.request(:nvim_get_current_win)
end
window=(window) click to toggle source

Set the active window.

@param window [Window, Integer] The target window or index. @return [Window, Integer]

# File lib/neovim/current.rb, line 55
def window=(window)
  @session.request(:nvim_set_current_win, window)
end