From bb8da349b3e4e46d2fe3ddd80007d85dac98cc9b Mon Sep 17 00:00:00 2001 From: chopps Date: Sat, 11 Jan 2014 18:07:06 +0000 Subject: Patch in fix from readline git repo for upcoming readline 6.3. This fixes the vi-mode cc, dd, yy commands so that they actually cut/yank the text from the input text. --- shells/bash/distinfo | 3 +- shells/bash/patches/patch-lib_readline_vi_mode.c | 79 ++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 shells/bash/patches/patch-lib_readline_vi_mode.c (limited to 'shells') diff --git a/shells/bash/distinfo b/shells/bash/distinfo index c4df7975ace..df924add5c7 100644 --- a/shells/bash/distinfo +++ b/shells/bash/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.27 2013/06/09 18:12:14 bsiegert Exp $ +$NetBSD: distinfo,v 1.28 2014/01/11 18:07:06 chopps Exp $ SHA1 (bash-4.2.tar.gz) = 487840ab7134eb7901fbb2e49b0ee3d22de15cb8 RMD160 (bash-4.2.tar.gz) = df7ae51783f039a1234d3b720ffcf4bfa5d09673 @@ -10,4 +10,5 @@ SHA1 (patch-aj) = 8b3c52c2aee9cf53ee5a9ce64ead243d0970305e SHA1 (patch-ak) = 6dfb7195f45f81064f687a4c9febb9dcae721aa7 SHA1 (patch-builtins_ulimit.def) = d4cb59bedc6a6199f9a99a3530c99374e428baeb SHA1 (patch-execute_cmd.c) = ce9fe5820188aa218bac74316d45cbdabadb1785 +SHA1 (patch-lib_readline_vi_mode.c) = 104be6ec5f30e39a5ee442de078ff5dcb9380874 SHA1 (patch-lib_sh_eaccess.c) = 484577f09efe67f604c3fb85afdb5a58b64f5b6c diff --git a/shells/bash/patches/patch-lib_readline_vi_mode.c b/shells/bash/patches/patch-lib_readline_vi_mode.c new file mode 100644 index 00000000000..043ad3703b4 --- /dev/null +++ b/shells/bash/patches/patch-lib_readline_vi_mode.c @@ -0,0 +1,79 @@ +$NetBSD: patch-lib_readline_vi_mode.c,v 1.1 2014/01/11 18:07:06 chopps Exp $ + +Pull in fix for 'cc', 'dd', commands 'yy' from readline git repository (pre-6.3 +release). Prior to this 'dd', et al. simply moved to position 0 but did not cut +the text from the line. + +--- lib/readline/vi_mode.c.orig 2010-11-21 00:51:39.000000000 +0000 ++++ lib/readline/vi_mode.c +@@ -1114,7 +1114,7 @@ rl_domove_read_callback (m) + rl_beg_of_line (1, c); + _rl_vi_last_motion = c; + RL_UNSETSTATE (RL_STATE_VIMOTION); +- return (0); ++ return (vidomove_dispatch (m)); + } + #if defined (READLINE_CALLBACKS) + /* XXX - these need to handle rl_universal_argument bindings */ +@@ -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)) + { -- cgit v1.2.3