Method: GtkApp::TextBuffer#redo
- Defined in:
- lib/gtk_app/text_buffer.rb
#redo ⇒ Object
Pop the last action off the redo stack and apply the changes. If and action was performed, the cursor is placed at the actions starting Gtk::TextIter.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/gtk_app/text_buffer.rb', line 70 def redo if @redo_stack.empty? Gdk.beep else action = @redo_stack.pop s_iter = get_iter_at_offset(action[1]) e_iter = get_iter_at_offset(action[2]) case action[0] when :insert then insert(s_iter, action[3]) when :delete then delete(s_iter, e_iter) end @undo_stack.push(action) place_cursor(s_iter) end end |