Sha256: 34214ec5d2deb5b468f0eca96cc14191149dc988dcbbd13fa8c3df207e190d39

Contents?: true

Size: 590 Bytes

Versions: 53

Compression:

Stored size: 590 Bytes

Contents

module Ruco
  class Editor
    module History
      attr_reader :history
      
      def initialize(content, options)
        super(content, options)
        @history = Ruco::History.new((options[:history]||{}).reverse_merge(:state => state, :track => [:content], :entries => options[:undo_stack_size], :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

53 entries across 53 versions & 1 rubygems

Version Path
ruco-0.1.12 lib/ruco/editor/history.rb
ruco-0.1.11 lib/ruco/editor/history.rb
ruco-0.1.10 lib/ruco/editor/history.rb
ruco-0.1.9 lib/ruco/editor/history.rb
ruco-0.1.8 lib/ruco/editor/history.rb
ruco-0.1.7 lib/ruco/editor/history.rb
ruco-0.1.6 lib/ruco/editor/history.rb
ruco-0.1.5 lib/ruco/editor/history.rb
ruco-0.1.4 lib/ruco/editor/history.rb
ruco-0.1.3 lib/ruco/editor/history.rb
ruco-0.1.2 lib/ruco/editor/history.rb
ruco-0.1.1 lib/ruco/editor/history.rb
ruco-0.1.0 lib/ruco/editor/history.rb