]> git.wh0rd.org Git - nano.git/commitdiff
Making the iteration through replacement matches behave the same again as the
authorBenno Schulenberg <bensberg@justemail.net>
Sun, 14 Feb 2016 10:19:27 +0000 (10:19 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Sun, 14 Feb 2016 10:19:27 +0000 (10:19 +0000)
iteration through search matches: showing them centered when found offscreen.
This fixes Savannah bug #47127.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5641 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/search.c

index 04e8ce78b71ad2751bade672477d57b662912be1..e532f29d1c09eb91a0095e50572f7cc28e691144 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-02-14  Benno Schulenberg  <bensberg@justemail.net>
+       * src/search.c (do_replace_loop): Make iterating through replacement
+       matches behave again like iterating through search matches: showing
+       them centered when found offscreen.  This fixes Savannah bug #47127.
+
 2016-02-13  Benno Schulenberg  <bensberg@justemail.net>
        * src/browser.c (do_browser, browser_refresh): Rebuild the file list
        only when necessary, not for each and every cursor movement.  This
index 9d63f7b481ec921d461af376cd6efe7b51d8115c..010540332ff91425534ec48e6d8c4378154832ee 100644 (file)
@@ -708,6 +708,10 @@ ssize_t do_replace_loop(
                xpt, strnlenpt(openfile->current->data,
                openfile->current_x + match_len) - xpt, FALSE);
 
+           /* If the match is offscreen, center it; otherwise, let it be. */
+           edit_redraw(openfile->current, openfile->placewewant);
+
+           /* Now refresh the entire edit window, in case it scrolled. */
            edit_refresh();
 
            /* Don't show cursor, to not distract from highlighted match. */