Module: Ruco::Editor::History
- Included in:
- Ruco::EditorArea
- Defined in:
- lib/ruco/editor/history.rb
Instance Attribute Summary collapse
-
#history ⇒ Object
readonly
Returns the value of attribute history.
Instance Method Summary collapse
Instance Attribute Details
#history ⇒ Object (readonly)
Returns the value of attribute history.
4 5 6 |
# File 'lib/ruco/editor/history.rb', line 4 def history @history end |
Instance Method Details
#initialize(content, options) ⇒ Object
6 7 8 9 |
# File 'lib/ruco/editor/history.rb', line 6 def initialize(content, ) super(content, ) @history = Ruco::History.new(([:history]||{}).reverse_merge(:state => state, :track => [:content], :entries => [:undo_stack_size], :timeout => 2)) end |
#redo ⇒ Object
16 17 18 19 |
# File 'lib/ruco/editor/history.rb', line 16 def redo @history.redo self.state = @history.state end |
#undo ⇒ Object
11 12 13 14 |
# File 'lib/ruco/editor/history.rb', line 11 def undo @history.undo self.state = @history.state end |
#view ⇒ Object
21 22 23 24 |
# File 'lib/ruco/editor/history.rb', line 21 def view @history.add(state) super end |