tweaks: get rid of some spurious textual references to edit_refresh()

master
Benno Schulenberg 2016-12-02 17:37:11 +01:00
parent c9680b8b64
commit 0f3e303d1a
4 changed files with 9 additions and 11 deletions

View File

@ -1911,9 +1911,8 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
#endif #endif
#ifndef DISABLE_WRAPPING #ifndef DISABLE_WRAPPING
/* If we're wrapping text, we need to call edit_refresh(). */ /* If text gets wrapped, the edit window needs a refresh. */
if (!ISSET(NO_WRAP)) if (!ISSET(NO_WRAP) && do_wrap(openfile->current))
if (do_wrap(openfile->current))
refresh_needed = TRUE; refresh_needed = TRUE;
#endif #endif
} }

View File

@ -734,8 +734,8 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only,
if (!replaceall) { if (!replaceall) {
#ifndef DISABLE_COLOR #ifndef DISABLE_COLOR
/* If color syntaxes are available and turned on, we /* When doing syntax coloring, the replacement might require
* need to call edit_refresh(). */ * a change of colors, so refresh the whole edit window. */
if (openfile->colorstrings != NULL && !ISSET(NO_COLOR_SYNTAX)) if (openfile->colorstrings != NULL && !ISSET(NO_COLOR_SYNTAX))
edit_refresh(); edit_refresh();
else else

View File

@ -2461,9 +2461,8 @@ void do_justify(bool full_justify)
} else } else
openfile->current_x = strlen(openfile->current->data); openfile->current_x = strlen(openfile->current->data);
/* Renumber the lines of the now-justified current paragraph, /* Renumber the now-justified paragraph, since both refreshing the
* since both find_paragraph() and edit_refresh() need the line * edit window and finding a paragraph need correct line numbers. */
* numbers to be right. */
renumber(curr_first_par_line); renumber(curr_first_par_line);
/* We've just finished justifying the paragraph. If we're not /* We've just finished justifying the paragraph. If we're not

View File

@ -2996,7 +2996,7 @@ void edit_refresh(void)
if (openfile->current->lineno < openfile->edittop->lineno || if (openfile->current->lineno < openfile->edittop->lineno ||
openfile->current->lineno >= openfile->edittop->lineno + maxrows) { openfile->current->lineno >= openfile->edittop->lineno + maxrows) {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "edit_refresh(): line = %ld, edittop %ld + maxrows %d\n", fprintf(stderr, "edit-refresh: line = %ld, edittop = %ld and maxrows = %d\n",
(long)openfile->current->lineno, (long)openfile->edittop->lineno, maxrows); (long)openfile->current->lineno, (long)openfile->edittop->lineno, maxrows);
#endif #endif
adjust_viewport((focusing || !ISSET(SMOOTH_SCROLL)) ? CENTERING : STATIONARY); adjust_viewport((focusing || !ISSET(SMOOTH_SCROLL)) ? CENTERING : STATIONARY);
@ -3005,7 +3005,7 @@ void edit_refresh(void)
foo = openfile->edittop; foo = openfile->edittop;
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "edit_refresh(): edittop->lineno = %ld\n", (long)openfile->edittop->lineno); fprintf(stderr, "edit-refresh: now edittop = %ld\n", (long)openfile->edittop->lineno);
#endif #endif
for (nlines = 0; nlines < editwinrows && foo != NULL; nlines++) { for (nlines = 0; nlines < editwinrows && foo != NULL; nlines++) {