Commit 0a79c78e authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Removing two unneeded calls to edit_refresh(), to greatly speed up nano

when doing a Replace All with *lots* of occurrences.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5165 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent ad827a6a
No related merge requests found
Showing with 5 additions and 5 deletions
+5 -5
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
Fixes https://bugs.launchpad.net/ubuntu/+source/nano/+bug/1300565 Fixes https://bugs.launchpad.net/ubuntu/+source/nano/+bug/1300565
requested by Rolf Leggewie. requested by Rolf Leggewie.
* src/search.c (do_replace_loop): Adjust some whitespace and wrapping. * src/search.c (do_replace_loop): Adjust some whitespace and wrapping.
* src/search.c (do_replace_loop): Place a call to edit_refresh better,
and remove two unneeded ones. This greatly speeds up nano when doing
a Replace All with *lots* of occurrences.
2015-03-25 Benno Schulenberg <bensberg@justemail.net> 2015-03-25 Benno Schulenberg <bensberg@justemail.net>
* doc/syntax/debian.nanorc: Slightly widen and relax the header regex. * doc/syntax/debian.nanorc: Slightly widen and relax the header regex.
......
...@@ -748,9 +748,6 @@ ssize_t do_replace_loop( ...@@ -748,9 +748,6 @@ ssize_t do_replace_loop(
} }
#endif #endif
if (!replaceall)
edit_refresh();
/* Indicate that we found the search string. */ /* Indicate that we found the search string. */
if (numreplaced == -1) if (numreplaced == -1)
numreplaced = 0; numreplaced = 0;
...@@ -761,6 +758,8 @@ ssize_t do_replace_loop( ...@@ -761,6 +758,8 @@ ssize_t do_replace_loop(
xpt, strnlenpt(openfile->current->data, xpt, strnlenpt(openfile->current->data,
openfile->current_x + match_len) - xpt, FALSE); openfile->current_x + match_len) - xpt, FALSE);
edit_refresh();
curs_set(0); curs_set(0);
do_replace_highlight(TRUE, exp_word); do_replace_highlight(TRUE, exp_word);
...@@ -850,7 +849,6 @@ ssize_t do_replace_loop( ...@@ -850,7 +849,6 @@ ssize_t do_replace_loop(
#ifndef DISABLE_COLOR #ifndef DISABLE_COLOR
reset_multis(openfile->current, TRUE); reset_multis(openfile->current, TRUE);
#endif #endif
edit_refresh();
if (!replaceall) { if (!replaceall) {
#ifndef DISABLE_COLOR #ifndef DISABLE_COLOR
...@@ -877,7 +875,6 @@ ssize_t do_replace_loop( ...@@ -877,7 +875,6 @@ ssize_t do_replace_loop(
unpartition_filestruct(&filepart); unpartition_filestruct(&filepart);
openfile->edittop = edittop_save; openfile->edittop = edittop_save;
openfile->mark_set = TRUE; openfile->mark_set = TRUE;
edit_refresh();
} }
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment