bug-readline
[Top][All Lists]
Advanced

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

Re: feature request: mark-modified-lines alternative that marks only whe


From: Chet Ramey
Subject: Re: feature request: mark-modified-lines alternative that marks only when going to an already modified line
Date: Fri, 8 Oct 2021 12:32:19 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.1.2

On 10/3/21 1:58 PM, Christoph Anton Mitterer wrote:
Hey.

mark-modified-lines is a pretty nice feature, but it prints the mark
also when one e.g. goes up in the history and then freshly starts
editing the line.

Because that starts a new set of undoable line changes. The scenario is
something like this:

1. You edit a line, creating a set of undoable changes.
2. You run accept-line, which clears the undo list and saves the line to
   the history list.
3. You use the history editing commands to return to the line and begin
   editing it. This creates the new set of changes.
4. Redisplay lets you know that this line is from the history and you have
   changed it since it was stored in the history list.

In that situation, one knows obviously that one is editing the history
line and thus working on a modified version.
The purpose of mark-modified-lines is to tell you something. Is it a
problem if you already know it?


A nice alternative could be the following:
One goes up to some history element, modifies it (the first time, so no
mark is printed), one goes e.g. further up and then again down to the
already modified line.... and *now* (because on reaches a line that has
been modified, but not just now), the mark is printed.

There's no state to capture that information. Either there is a set of
undoable changes associated with the line, or there isn't. Is a different,
more complicated, meaning valuable enough to implement?

If you think it is, I invite you to take a shot at implementing it. I'd
be glad to look at what you come up with.

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]