[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

readline vi-mode ~ should special case rl_end position

From: llattanzi+bash
Subject: readline vi-mode ~ should special case rl_end position
Date: Tue, 22 Jun 2004 15:45:18 -0700 (PDT)

Configuration Information [Automatically generated, do not change]:
Machine: powerpc
OS: darwin8.0
Compiler: gcc
Compilation CFLAGS: -arch i386 -arch ppc -g -Os -pipe -no-cpp-precomp -arch i386 -arch ppc -pipe -DPROGRAM='bash' -DCONF_HOSTTYPE='powerpc' -DCONF_OSTYPE='darwin8.0' -DCONF_MACHTYPE='powerpc-apple-darwin8.0' -DCONF_VENDOR='apple' -DSHELL -DHAVE_CONFIG_H -DMACOSX -I. -I/SourceCache/bash/bash-30/bash -I/SourceCache/bash/bash-30/bash/include -I/SourceCache/bash/bash-30/bash/lib -arch i386 -arch ppc -g -Os -pipe -no-cpp-precomp -arch i386 -arch ppc -pipe uname output: Darwin stderr.apple.com 8.0.0b1 Darwin Kernel Version 8.0.0b1: Mon May 10 23:45:14 PDT 2004; root:xnu/xnu-600.3.obj~4/RELEASE_PPC Power Macintosh powerpc
Machine Type: powerpc-apple-darwin8.0

Bash Version: 2.05b
Patch Level: 0
Release Status: release

        Changing case up to the last position generates rl_ding error

        set -o vi
        echo 12345<ESC>5h5~

Index: bash/lib/readline/vi_mode.c
RCS file: /cvs/root/bash/bash/lib/readline/vi_mode.c,v
retrieving revision
diff -u -d -b -w -r1.1.1.5 vi_mode.c
--- vi_mode.c   2003/04/05 08:00:34
+++ vi_mode.c   2004/06/22 22:43:42
@@ -749,8 +749,11 @@
       /* Vi is kind of strange here. */
       if (c)
+         int point = rl_point;
          rl_begin_undo_group ();
-         rl_delete (1, c);
+         rl_vi_delete (1, c);
+         if (rl_point < point)      /* Did we retreat? */
+           rl_point++;
          _rl_insert_char (1, c);
          rl_end_undo_group ();
          rl_vi_check ();

reply via email to

[Prev in Thread] Current Thread [Next in Thread]