Class: Textbringer::CompositeAction
- Inherits:
-
UndoableAction
- Object
- UndoableAction
- Textbringer::CompositeAction
- Defined in:
- lib/textbringer/buffer.rb,
sig/lib/textbringer/buffer.rbs
Instance Attribute Summary
Attributes inherited from UndoableAction
Instance Method Summary collapse
- #add_action(action) ⇒ Object
-
#initialize(buffer, location) ⇒ CompositeAction
constructor
A new instance of CompositeAction.
- #redo ⇒ Array[untyped]
- #undo ⇒ Integer
Constructor Details
#initialize(buffer, location) ⇒ CompositeAction
Returns a new instance of CompositeAction.
1886 1887 1888 1889 |
# File 'lib/textbringer/buffer.rb', line 1886 def initialize(buffer, location) super(buffer, location) @actions = [] end |
Instance Method Details
#add_action(arg0) ⇒ Array[untyped] #add_action(arg0) ⇒ Array[untyped]
1891 1892 1893 |
# File 'lib/textbringer/buffer.rb', line 1891 def add_action(action) @actions.push(action) end |
#redo ⇒ Array[untyped]
1902 1903 1904 1905 1906 |
# File 'lib/textbringer/buffer.rb', line 1902 def redo @actions.each do |action| action.redo end end |
#undo ⇒ Integer
1895 1896 1897 1898 1899 1900 |
# File 'lib/textbringer/buffer.rb', line 1895 def undo @actions.reverse_each do |action| action.undo end @buffer.goto_char(@location) end |