nano-devel
[Top][All Lists]
Advanced

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

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


From: Benno Schulenberg
Subject: Re: [Nano-devel] undoing replacings in a marked region goes wrong
Date: Thu, 02 Apr 2015 14:14:05 +0200

Hi Mark,

> On Wed, Apr 1, 2015, at 19:41, Mark Majeres wrote:
> > I assume it doesn’t stop and wraps to the top of the file when
> > replacing one a time?

I've made the exit condition into this, which works for me:

        if (old_mark_set && (openfile->current->lineno > bot->lineno ||
                                openfile->current->lineno < top->lineno))  
                break;  
        if (old_mark_set && openfile->current == bot && openfile->current_x > 
bot_x)  
                break;  
        if (old_mark_set && openfile->current == top && openfile->current_x < 
top_x)  
                break;  

It can be glued together, of course, but this is just to show
the logic.

Full patch attached.  Anything amiss?

Benno

-- 
http://www.fastmail.com - A fast, anti-spam email service.

Attachment: exit-when-outside-region.patch
Description: Text Data


reply via email to

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