bug-bash
[Top][All Lists]
Advanced

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

Re: Feature Request: Allow each completion to have their own wordbreaks


From: Chet Ramey
Subject: Re: Feature Request: Allow each completion to have their own wordbreaks
Date: Mon, 20 Dec 2021 09:18:46 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.0

On 12/18/21 4:43 AM, konsolebox wrote:
Right now I'm trying to perfect this completion script for rake
(https://git.io/JDaSA), but the problem is it has to rely on modifying
the COMP_WORDBREAKS variable so it doesn't contain '=' and ':'.  This
conflicts with git's completion script at least which prefers `:` to
be assigned, and I'm not sure how it affects other scripts that may
want `=` not removed.

Either way the best solution in my opinion is to  have Bash add a new
feature that allows each completion have their own COMP_WORDBREAKS,
probably through a new complete option, or a global associative array
variable that can contain the name of the completion as the key and
the value as the word break characters.

This doesn't really work given the way readline works. Readline uses the
characters in rl_completer_word_break_chars to determine the boundaries
of the word to be completed. This is independent of any application that
uses readline, to the extent that the application can change the value to
get different words completed, and certainly happens well before it calls
any application-specific completion function.


--
``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]