On 30.12.2019 03:11, Chet Ramey wrote:
On 12/29/19 3:45 PM, Andrey Butirsky wrote:
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:
Yes, you should always use the `long' names. The short versions exist only
because they always have. The long versions were added in
bash-4.2/readline-6.2 to solve exactly this problem.
Of course, after digging into the code, I know now what the problem is
and how to workaround it.
But can we try to fix it? It's literally the bug just from the code.
Considering these vi-* commands are undocumented, it's very confusing
right now, even if you look into the code.
So maybe use case-sensitive string comparison function here? I'm sorry
I'm not familiar with the code.
Or, if we still need that weird binding here, swap
{ "vi-bword", rl_vi_bword },
to
{ "vi-bword", rl_vi_bWord },
to at least partially eliminate the confusion.
What do you think?