[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] undoing replaces in a marked region goes wrong
From: |
Benno Schulenberg |
Subject: |
Re: [Nano-devel] undoing replaces in a marked region goes wrong |
Date: |
Fri, 27 Mar 2015 11:52:44 +0100 |
On Fri, Mar 27, 2015, at 11:44, Benno Schulenberg wrote:
> When having done some replaces in a marked region, undoing these
> will eat whatever was on the mark's line before the mark.
Oh, I discovered this while looking at this piece of code and not
succeeding in making sense of it:
#ifndef NANO_TINY
/* If the mark was on and (mark_begin, mark_begin_x) was the
* top of it, don't change mark_begin_x. */
if (!old_mark_set || !right_side_up) {
/* Keep mark_begin_x in sync with the text changes. */
if (openfile->current == openfile->mark_begin &&
openfile->mark_begin_x > openfile->current_x) {
if (openfile->mark_begin_x < openfile->current_x +
match_len)
openfile->mark_begin_x = openfile->current_x;
else
openfile->mark_begin_x += length_change;
}
}
/* If the mark was on and (current, current_x) was the top
* of it, don't change real_current_x. */
if (!old_mark_set || right_side_up) {
#endif
/* Keep real_current_x in sync with the text changes. */
if (openfile->current == real_current &&
openfile->current_x <= *real_current_x) {
if (*real_current_x < openfile->current_x + match_len)
*real_current_x = openfile->current_x + match_len;
*real_current_x += length_change;
}
#ifndef NANO_TINY
}
#endif
It's in src/search.c from line 805. (Do an 'svn up' before.)
Benno
--
http://www.fastmail.com - Email service worth paying for. Try it for free
- [Nano-devel] undoing replaces in a marked region goes wrong, Benno Schulenberg, 2015/03/27
- Re: [Nano-devel] undoing replaces in a marked region goes wrong,
Benno Schulenberg <=
- Re: [Nano-devel] undoing replaces in a marked region goes wrong, Mark Majeres, 2015/03/27
- Re: [Nano-devel] undoing replacements in a marked region goes wrong, Benno Schulenberg, 2015/03/27
- Re: [Nano-devel] undoing replacements in a marked region goes wrong, Mark Majeres, 2015/03/28
- Re: [Nano-devel] undoing replacings in a marked region goes wrong, Benno Schulenberg, 2015/03/28
- Re: [Nano-devel] undoing replacings in a marked region goes wrong, Mark Majeres, 2015/03/28
- Re: [Nano-devel] undoing replacings in a marked region goes wrong, Benno Schulenberg, 2015/03/29
- Re: [Nano-devel] undoing replacings in a marked region goes wrong, Mark Majeres, 2015/03/31