bug-bash
[Top][All Lists]
Advanced

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

Setting READLINE_POINT isn't always applied (4.0.24)


From: Henning Bekel
Subject: Setting READLINE_POINT isn't always applied (4.0.24)
Date: Wed, 15 Jul 2009 18:26:52 +0200
User-agent: KNode/0.99.01

Hello,
If I try to change READLINE_LINE and READLINE_POINT from a 
function bound via bind -x, then setting READLINE_POINT is not 
applied every second time I invoke the function. Instead, the 
cursor is placed at the end of the line.

Simple test case:

test_rl () {
    READLINE_LINE="$READLINE_LINE#edited"
    READLINE_POINT=3
}

bind -x '"\ew": test_rl'

And keep hitting \ew... every first time the cursor is placed at 
position 3, every second time it ends up at the end of the line.

Is this the intended behavior or is it a bug?

Also, is it intended that the modified line is drawn on a new 
line? For example, if I wrote a function that increments the word 
at READLINE_POINT if it contains only digits, and i wanted to 
increase a value by hitting a keyseq five times, I'd end up with 
five lines being printed in my terminal. I'd love to see this work 
like readline's own editing functions (e.g. upcase-word) or macros 
that edit the line without printing it again on a new line. But 
maybe I just misinterpreted the purpose of this new feature. If 
so, could you explain it's intended purpose?

Regards,
Henning






reply via email to

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