Class: Neovim::Current
Overview
Support for Client#current chaining.
Instance Method Summary collapse
-
#buffer ⇒ Buffer
Get the active buffer.
-
#buffer=(buffer) ⇒ Buffer, Integer
Set the active buffer.
-
#initialize(session) ⇒ Current
constructor
A new instance of Current.
-
#line ⇒ String
Get the line under the cursor.
-
#line=(line) ⇒ String
Set the line under the cursor.
-
#tabpage ⇒ Tabpage
Get the active tabpage.
-
#tabpage=(tabpage) ⇒ Tabpage, Integer
Set the active tabpage.
-
#window ⇒ Window
Get the active window.
-
#window=(window) ⇒ Window, Integer
Set the active window.
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
#buffer ⇒ Buffer
Get the active buffer.
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.
40 41 42 |
# File 'lib/neovim/current.rb', line 40 def buffer=(buffer) @session.request(:nvim_set_current_buf, buffer) end |
#line ⇒ String
Get the line under the cursor.
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.
25 26 27 |
# File 'lib/neovim/current.rb', line 25 def line=(line) @session.request(:nvim_set_current_line, line) end |
#tabpage ⇒ Tabpage
Get the active tabpage.
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.
70 71 72 |
# File 'lib/neovim/current.rb', line 70 def tabpage=(tabpage) @session.request(:nvim_set_current_tabpage, tabpage) end |
#window ⇒ Window
Get the active window.
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.
55 56 57 |
# File 'lib/neovim/current.rb', line 55 def window=(window) @session.request(:nvim_set_current_win, window) end |