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.4.0 lib/ruco/editor/history.rb
ruco-0.3.0 lib/ruco/editor/history.rb
ruco-0.2.23 lib/ruco/editor/history.rb
ruco-0.2.22 lib/ruco/editor/history.rb
ruco-0.2.21 lib/ruco/editor/history.rb
ruco-0.2.20 lib/ruco/editor/history.rb
ruco-0.2.19 lib/ruco/editor/history.rb
ruco-0.2.18 lib/ruco/editor/history.rb
ruco-0.2.17 lib/ruco/editor/history.rb
ruco-0.2.16 lib/ruco/editor/history.rb
ruco-0.2.15 lib/ruco/editor/history.rb
ruco-0.2.14 lib/ruco/editor/history.rb
ruco-0.2.13 lib/ruco/editor/history.rb
ruco-0.2.12 lib/ruco/editor/history.rb
ruco-0.2.11 lib/ruco/editor/history.rb
ruco-0.2.10 lib/ruco/editor/history.rb
ruco-0.2.9 lib/ruco/editor/history.rb
ruco-0.2.8 lib/ruco/editor/history.rb
ruco-0.2.7 lib/ruco/editor/history.rb
ruco-0.2.6 lib/ruco/editor/history.rb