[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug: 'vi-fword' binding command does the same as 'vi-fWord'
From: |
Andrey Butirsky |
Subject: |
bug: 'vi-fword' binding command does the same as 'vi-fWord' |
Date: |
Sun, 29 Dec 2019 23:45:22 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Thunderbird/72.0 |
Hi,
the bug is: if any Readline binding command names differs only in
character's case, these commands is indistinguishable and do the same
function.
For example, 'vi-fword' binding command erroneously does the same as
'vi-fWord' one, that is - jumps on "big" (space separated) words; while
it is alias of||"vi-forward-word" command and as such should jump on a
"small" vi words. For 'vi-fWord', "vi-forward-bigword" alias exists:
|http://git.savannah.gnu.org/cgit/readline.git/tree/funmap.c?h=readline-6.3&id=3fede80c7ae9d396a98137ec8e7188a27c327e96#n174
funmap.c: { "vi-fWord", rl_vi_fWord }, .... { "vi-forward-bigword",
rl_vi_fWord }, { "vi-forward-word", rl_vi_fword }, { "vi-fword",
rl_vi_fword },|
This occurs due _rl_stricmp() function used to compare names is
caseless, and "vi-fWord" name happened to encounter first in the array
above:
http://git.savannah.gnu.org/cgit/readline.git/tree/util.c?h=readline-6.3&id=3fede80c7ae9d396a98137ec8e7188a27c327e96#n397
|/* strcmp (), but caseless (strcasecmp). */ int _rl_stricmp (string1,
string2) char *string1, *string2; { |
To reproduce:
$ bind '"\eF": vi-fWord'
try it, then
$ bind '"\eF": vi-fword'
See there is no difference in the Meta + F key shortcut - it still jumps
over "big" space-delimited words.
Then
$ bind '"\eF": vi-forward-word'
It starts jump on "small" vi words, however - it is alias for "vi-fword".
||
||
- bug: 'vi-fword' binding command does the same as 'vi-fWord',
Andrey Butirsky <=