Class: Rvim::Tab

Inherits:
Object
  • Object
show all
Defined in:
lib/rvim/tab.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(window) ⇒ Tab

Returns a new instance of Tab.



8
9
10
11
12
13
# File 'lib/rvim/tab.rb', line 8

def initialize(window)
  @windows = [window]
  @current_window = window
  @split_orientation = nil
  @vars = {}
end

Instance Attribute Details

#current_windowObject

Returns the value of attribute current_window.



5
6
7
# File 'lib/rvim/tab.rb', line 5

def current_window
  @current_window
end

#split_orientationObject

Returns the value of attribute split_orientation.



5
6
7
# File 'lib/rvim/tab.rb', line 5

def split_orientation
  @split_orientation
end

#varsObject

Returns the value of attribute vars.



6
7
8
# File 'lib/rvim/tab.rb', line 6

def vars
  @vars
end

#windowsObject

Returns the value of attribute windows.



5
6
7
# File 'lib/rvim/tab.rb', line 5

def windows
  @windows
end

Instance Method Details

#display_nameObject



15
16
17
18
19
20
# File 'lib/rvim/tab.rb', line 15

def display_name
  buf = @current_window&.buffer
  return '[New]' unless buf

  File.basename(buf.display_name)
end