bug-readline
[Top][All Lists]
Advanced

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

[Bug-readline] beta2 bugs in dump-variables and *-mode-string


From: Steve Jones
Subject: [Bug-readline] beta2 bugs in dump-variables and *-mode-string
Date: Wed, 27 Jul 2016 09:30:01 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

I've just started testing the new readline/bash and found two issues.

dump-variables() always shows the default variables for
vim-*-mode-string or the emacs-mode-string.  here is a fix for that one.


diff -uar readline-7.0-beta2/bind.c ../readline-7.0-beta2/bind.c
--- readline-7.0-beta2/bind.c   2016-01-25 09:33:57.000000000 -0600
+++ ../readline-7.0-beta2/bind.c        2016-07-26 20:11:55.129286301 -0500
@@ -2591,9 +2591,9 @@
   else if (_rl_stricmp (name, "emacs-mode-string") == 0)
     return (_rl_emacs_mode_str ? _rl_emacs_mode_str : 
RL_EMACS_MODESTR_DEFAULT);
   else if (_rl_stricmp (name, "vi-cmd-mode-string") == 0)
-    return (_rl_emacs_mode_str ? _rl_emacs_mode_str : 
RL_VI_CMD_MODESTR_DEFAULT);
+    return (_rl_vi_cmd_mode_str ? _rl_vi_cmd_mode_str : 
RL_VI_CMD_MODESTR_DEFAULT);
   else if (_rl_stricmp (name, "vi-ins-mode-string") == 0)
-    return (_rl_emacs_mode_str ? _rl_emacs_mode_str : 
RL_VI_INS_MODESTR_DEFAULT);
+    return (_rl_vi_ins_mode_str ? _rl_vi_ins_mode_str : 
RL_VI_INS_MODESTR_DEFAULT);
   else
     return (0);
 }

The other is that if non-printing characters are used in the
*-mode-strings then the strings starts leaking into the line.  This
happens with both vi and emacs mode.  Also the show-mode string is not
updated correctly when switching between modes.  my strings are:

set emacs-mode-string "\1\e[1;address@hidden "
set vi-ins-mode-string "\1\e[1;32m\2+\1\e[0m\2 "
set vi-cmd-mode-string "\1\e[1;31m\2-\1\e[0m\2 "

Using simple strings works just fine:

set vi-ins-mode-string "+ "
set vi-cmd-mode-string "- "

-- 
Steve Jones
<address@hidden>



reply via email to

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