[Top][All Lists]

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

Re: [Nano-devel] [PATCH V10] Implement bookmarks

From: David Ramsey
Subject: Re: [Nano-devel] [PATCH V10] Implement bookmarks
Date: Thu, 13 Dec 2018 12:17:12 -0600

I've been testing this, and it seems to be working well so far.

However, since moving between bookmarks doesn't change any text, a full
refresh when doing so is overkill.  In patch 0001, in go_to_bookmark():

> +static void go_to_bookmark(bool forward)
> +{
> +    filestruct *line = openfile->current;
> +    const filestruct *first = line;

Drop the const in the last line here, and...

> +    openfile->current = line;
> +    openfile->current_x = 0;
> +    openfile->placewewant = 0;
> +    refresh_needed = TRUE;

...replace the last two lines here with the line:

       edit_redraw(first, CENTERING);

edit_redraw() will only redraw the lines that need redrawing, as opposed
to "refresh_needed = TRUE"'s (indirectly) redrawing everything.  Also,
since edit_redraw() will set placewewant based on current_x,
go_to_bookmark() won't need to set placewewant anymore.

Also, the search for a bookmark wraps around, just as an ordinary search
does.  However, unlike an ordinary search, there's no indicator when a
bookmark search wraps around.  Maybe add a statusbar message for that

reply via email to

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