From 15be0ec466ca25d1c87d7e6ddd576ced34705fc0 Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Tue, 17 Jul 2012 09:48:15 -0400 Subject: [PATCH] Bash-4.2 patch 37 --- lib/readline/vi_mode.c | 33 +++++++++++++++++++++++++++++++-- patchlevel.h | 2 +- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/lib/readline/vi_mode.c b/lib/readline/vi_mode.c index a3c3578..4408053 100644 --- a/lib/readline/vi_mode.c +++ b/lib/readline/vi_mode.c @@ -1234,11 +1234,19 @@ rl_vi_delete_to (count, key) _rl_vimvcxt->motion = '$'; r = rl_domove_motion_callback (_rl_vimvcxt); } - else if (vi_redoing) + else if (vi_redoing && _rl_vi_last_motion != 'd') /* `dd' is special */ { _rl_vimvcxt->motion = _rl_vi_last_motion; r = rl_domove_motion_callback (_rl_vimvcxt); } + else if (vi_redoing) /* handle redoing `dd' here */ + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + rl_mark = rl_end; + rl_beg_of_line (1, key); + RL_UNSETSTATE (RL_STATE_VIMOTION); + r = vidomove_dispatch (_rl_vimvcxt); + } #if defined (READLINE_CALLBACKS) else if (RL_ISSTATE (RL_STATE_CALLBACK)) { @@ -1316,11 +1324,19 @@ rl_vi_change_to (count, key) _rl_vimvcxt->motion = '$'; r = rl_domove_motion_callback (_rl_vimvcxt); } - else if (vi_redoing) + else if (vi_redoing && _rl_vi_last_motion != 'c') /* `cc' is special */ { _rl_vimvcxt->motion = _rl_vi_last_motion; r = rl_domove_motion_callback (_rl_vimvcxt); } + else if (vi_redoing) /* handle redoing `cc' here */ + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + rl_mark = rl_end; + rl_beg_of_line (1, key); + RL_UNSETSTATE (RL_STATE_VIMOTION); + r = vidomove_dispatch (_rl_vimvcxt); + } #if defined (READLINE_CALLBACKS) else if (RL_ISSTATE (RL_STATE_CALLBACK)) { @@ -1377,6 +1393,19 @@ rl_vi_yank_to (count, key) _rl_vimvcxt->motion = '$'; r = rl_domove_motion_callback (_rl_vimvcxt); } + else if (vi_redoing && _rl_vi_last_motion != 'y') /* `yy' is special */ + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + r = rl_domove_motion_callback (_rl_vimvcxt); + } + else if (vi_redoing) /* handle redoing `yy' here */ + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + rl_mark = rl_end; + rl_beg_of_line (1, key); + RL_UNSETSTATE (RL_STATE_VIMOTION); + r = vidomove_dispatch (_rl_vimvcxt); + } #if defined (READLINE_CALLBACKS) else if (RL_ISSTATE (RL_STATE_CALLBACK)) { diff --git a/patchlevel.h b/patchlevel.h index 9868481..4e51dbc 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -25,6 +25,6 @@ regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh looks for to find the patch level (for the sccs version string). */ -#define PATCHLEVEL 36 +#define PATCHLEVEL 37 #endif /* _PATCHLEVEL_H_ */ -- 2.7.4