diff options
author | Tom Feist <shabble@metavore.org> | 2010-09-26 21:15:31 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2010-09-26 21:15:31 +0000 |
commit | c243d1a02838fd12e9fab9bfa243bb075efa1196 (patch) | |
tree | dabe4cdcaf25d04a79c78192a3ac41274fe62dad | |
parent | Merge remote branch 'origin/dev' (diff) | |
download | irssi-scripts-c243d1a02838fd12e9fab9bfa243bb075efa1196.tar.gz irssi-scripts-c243d1a02838fd12e9fab9bfa243bb075efa1196.zip |
first steps towards undo
-rw-r--r-- | vim-mode/vim_mode.pl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index ac067d8..90391da 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -119,6 +119,10 @@ my $history_input = undef; # position in input line my $history_pos = 0; +# Undo/redo buffer. +my @undo_buffer; +my $undo_index = undef; + sub script_is_loaded { my $name = shift; print "Checking if $name is loaded" if DEBUG; @@ -184,6 +188,10 @@ my $movements # misc '~' => { func => \&cmd_movement_tilde }, '.' => {}, + # undo + 'u' => { func => \&cmd_undo }, + "\x12" => { func => \&cmd_redo }, + }; # special movements which take an additional key @@ -195,6 +203,15 @@ my $movements_multiple = 'T' => undef, }; + +sub cmd_undo { + print "Undo!" if DEBUG; +} + +sub cmd_redo { + print "Redo!" if DEBUG; +} + sub cmd_operator_c { my ($old_pos, $new_pos, $move) = @_; |