bug-bash
[Top][All Lists]
Advanced

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

Re: [PATCH] Switch vi-insert TAB binding only for the default binding


From: Chet Ramey
Subject: Re: [PATCH] Switch vi-insert TAB binding only for the default binding
Date: Fri, 15 Feb 2019 11:31:13 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.5.0

On 2/10/19 7:53 PM, Koichi Murase wrote:

> 
>   There may be several choices to fix this.
> 
>   a. One is to introduce a new variable that memorizes whether the
> binding has been defined by users or not. Or, maybe there are other
> ways to manage the information. Then, only when the binding is not
> defined by users, switch the binding. However the code to update the
> variable would become dirty (i.e., maybe one needs to add codes to
> readline).
> 
>   b. Another way is to switch the binding only when the current
> binding is the same with the default one. The implementation is
> simple, but not complete: when the user-defined binding is the same
> with the default one, the binding will be switched unexpectedly.
> Nevertheless this is far better than the current behavior.

There is a third option: turning posix mode on saves the old binding
for TAB; turning it off restores it. That, combined with a check of
whether or not the binding was still TAB:self-insert, should handle
both cases.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

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