lib/ruco/editor_area.rb in ruco-0.0.51 vs lib/ruco/editor_area.rb in ruco-0.0.52
- old
+ new
@@ -1,27 +1,10 @@
module Ruco
# everything that does not belong to a text-area
# but is needed for Ruco::Editor
class EditorArea < TextArea
- def initialize(*args)
- super(*args)
- @history = History.new((args.last[:history]||{}).reverse_merge(:state => state, :track => [:content], :entries => 100, :timeout => 2))
- end
-
- def undo
- @history.undo
- self.state = @history.state
- end
-
- def redo
- @history.redo
- self.state = @history.state
- end
-
- def view
- @history.add(state)
- super
- end
+ include Ruco::Editor::LineNumbers
+ include Ruco::Editor::History
def delete_line
lines.slice!(line, 1)
sanitize_position
end