[Top][All Lists]

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

Re: [Nano-devel] undoing replacings in a marked region goes wrong

From: Mark Majeres
Subject: Re: [Nano-devel] undoing replacings in a marked region goes wrong
Date: Sat, 28 Mar 2015 13:24:23 -0700

On 3/28/15, Benno Schulenberg <address@hidden> wrote:
> On Sat, Mar 28, 2015, at 06:28, Mark Majeres wrote:
>> I attached a patch that resolves the undo issue, but only if the
>> selection does not span more than one line.
> Okay, thanks.  For single-line selections, it is successful for the
> undo part.  But when redoing the change, it leaves the cursor where
> it is at that moment, instead of compensating for a change in length.
> For multiline selections, the undo has stopped working altogether
> -- on an M-U it says it has undone a replacement, but actually it
> hasn't undone anything.

I looked into this a little.  It's like there are two completely
different scenarios, which do not co-exist.  The case when the entire
file is being looked at, and the case when only a selection is.  A
selection is first partitioned out, so the operation is working only
on a portion of the file.  The undo's being captured are relative to
this partitioned file.  I think the approach would work best if the
selection is not partioned, but just recognized as the start and
ending locations of the do_replace_loop().  In summary,
do_replace_loop() needs to be reworked so that it will function the
same for selections and non-selections.


reply via email to

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