Sha256: d9692940fab2c59756f1eeb3c96615f770edf1767e140e2dfe837cce5729beb0

Contents?: true

Size: 528 Bytes

Versions: 5

Compression:

Stored size: 528 Bytes

Contents

module Ruco
  class Editor
    module History
      def initialize(content, options)
        super(content, options)
        @history = Ruco::History.new((options[: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
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruco-0.0.56 lib/ruco/editor/history.rb
ruco-0.0.55 lib/ruco/editor/history.rb
ruco-0.0.54 lib/ruco/editor/history.rb
ruco-0.0.53 lib/ruco/editor/history.rb
ruco-0.0.52 lib/ruco/editor/history.rb