GNU bug report logs - #32501
Bouncing parentheses broken in REPL with vi-mode enabled

Previous Next

Package: guile;

Reported by: Daniel Tam <danooo.tam <at> gmail.com>

Date: Wed, 22 Aug 2018 17:07:02 UTC

Severity: normal

Full log


Message #17 received at 32501 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Daniel Tam <danooo.tam <at> gmail.com>
Cc: 32501 <at> debbugs.gnu.org
Subject: Re: bug#32501: Bouncing parentheses broken in REPL with vi-mode
 enabled
Date: Fri, 24 Aug 2018 01:36:00 -0400
Hello again,

I wrote:

> The relevant function is 'init_bouncing_parens' in
> guile-readline/readline.c:
>
>   static void
>   init_bouncing_parens ()
>   {
>     if (strncmp (rl_get_keymap_name (rl_get_keymap ()), "vi", 2))
>       {
>         rl_bind_key (')', match_paren);
>         rl_bind_key (']', match_paren);
>         rl_bind_key ('}', match_paren);
>       }
>   }

[...]

> The right fix might be to simply remove the 'if' check above.

Actually, it probably won't be that simple.  Whereas in emacs mode, we
can probably rely on these bindings being added to the correct keymap,
namely 'emacs_standard_keymap', when in vi mode it's likely that these
bindings would end up in the wrong keymap, namely 'vi_movement_keymap'.

When in vi mode, these mappings should be added to
'vi_insertion_keymap', and that probably involves using
'rl_bind_key_in_map' instead of 'rl_bind_key'.

       Mark




This bug report was last modified 3 years and 71 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.