bug-bash
[Top][All Lists]
Advanced

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

Re: Word-skipping with alias-expand-line


From: Chet Ramey
Subject: Re: Word-skipping with alias-expand-line
Date: Wed, 8 Feb 2023 10:33:32 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1

On 2/2/23 5:26 PM, Addison Brendtro wrote:

Bash Version: 5.1
Patch Level: 16
Release Status: release

Description/Repeat-by:
        Setting aliases like so:
                # arbitrary key
                bind '"\C-xa": alias-expand-line'
                
                # expand aliases with space
                bind '" ": "\C-v \C-xa"'

        Creates a FISH-like abbreviation system using aliases. For some
reason, though, typing a space before another word skips to the end of
that word. This does not happen when typing "\C-v \C-xa" manually.

It's a heuristic about where rl_point should go. If the line is expanded,
you lose where point was in relation to the expanded alias, so the
function assumes you expanded a word to a word and skips to the end of it.
It doesn't check to see whether or not any aliases were expanded, or
whether the expanded line differs from the original one.

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