changeset 1863:2b013c0f949a

readline: Make backward_kill_iline() consistent with backward_kill_word() That is, stop on first character if it is the command character.
author Mikael Berthe <mikael@lilotux.net>
date Sat, 03 Apr 2010 20:21:37 +0200
parents cca19ce862ef
children 27c42ee4b6f0
files mcabber/mcabber/screen.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabber/screen.c	Sat Apr 03 20:10:22 2010 +0200
+++ b/mcabber/mcabber/screen.c	Sat Apr 03 20:21:37 2010 +0200
@@ -3479,8 +3479,15 @@
 
 void readline_backward_kill_iline(void)
 {
-  strcpy(inputLine, ptr_inputline);
-  ptr_inputline = inputLine;
+  char *dest = inputLine;
+
+  if (ptr_inputline == inputLine) return;
+
+  if (*dest == COMMAND_CHAR && ptr_inputline != dest+1)
+    dest = next_char(dest);
+
+  strcpy(dest, ptr_inputline);
+  ptr_inputline = dest;
   inputline_offset = 0;
 }