tweaks: rename a function, to better suit what it does

Things have morphed over time and display_buffer() no longer actually
displays the buffer -- it just displays the title bar, precalculates
the multiline color info, and schedules a refresh of the edit window.
master
Benno Schulenberg 2017-05-01 16:48:13 +02:00
parent c095ece497
commit 1423e57199
4 changed files with 11 additions and 12 deletions

View File

@ -581,23 +581,22 @@ void replace_marked_buffer(const char *filename, filestruct *top, size_t top_x,
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */
#endif /* !DISABLE_SPELLER */ #endif /* !DISABLE_SPELLER */
/* Update the screen to account for the current buffer. */ /* Update the titlebar and the multiline cache to match the current buffer. */
void display_buffer(void) void prepare_for_display(void)
{ {
/* Update the titlebar, since the filename may have changed. */ /* Update the titlebar, since the filename may have changed. */
if (!inhelp) if (!inhelp)
titlebar(NULL); titlebar(NULL);
#ifndef DISABLE_COLOR #ifndef DISABLE_COLOR
have_palette = FALSE;
/* If there are multiline coloring regexes, and there is no /* If there are multiline coloring regexes, and there is no
* multiline cache data yet, precalculate it now. */ * multiline cache data yet, precalculate it now. */
if (openfile->syntax && openfile->syntax->nmultis > 0 && if (openfile->syntax && openfile->syntax->nmultis > 0 &&
openfile->fileage->multidata == NULL) openfile->fileage->multidata == NULL)
precalc_multicolorinfo(); precalc_multicolorinfo();
#endif
have_palette = FALSE;
#endif
refresh_needed = TRUE; refresh_needed = TRUE;
} }
@ -629,8 +628,8 @@ void switch_to_prevnext_buffer(bool to_next)
openfile->firstcolumn = 0; openfile->firstcolumn = 0;
#endif #endif
/* Update the screen to account for the current buffer. */ /* Update titlebar and multiline info to match the current buffer. */
display_buffer(); prepare_for_display();
/* Indicate the switch on the statusbar. */ /* Indicate the switch on the statusbar. */
if (!inhelp) if (!inhelp)
@ -1190,7 +1189,7 @@ void do_insertfile(void)
} }
#endif /* !DISABLE_HISTORIES */ #endif /* !DISABLE_HISTORIES */
/* Update stuff to account for the current buffer. */ /* Update stuff to account for the current buffer. */
display_buffer(); prepare_for_display();
} else } else
#endif /* !DISABLE_MULTIBUFFER */ #endif /* !DISABLE_MULTIBUFFER */
{ {

View File

@ -80,7 +80,7 @@ void display_the_help_text(bool redisplaying)
open_buffer(tempfilename, FALSE); open_buffer(tempfilename, FALSE);
remove_magicline(); remove_magicline();
display_buffer(); prepare_for_display();
/* Move to the position in the file where we were before. */ /* Move to the position in the file where we were before. */
while (TRUE) { while (TRUE) {

View File

@ -2624,10 +2624,10 @@ int main(int argc, char **argv)
#endif #endif
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "Main: show buffer contents, and enter main loop\n"); fprintf(stderr, "Main: show title bar, and enter main loop\n");
#endif #endif
display_buffer(); prepare_for_display();
while (TRUE) { while (TRUE) {
#ifdef ENABLE_LINENUMBERS #ifdef ENABLE_LINENUMBERS

View File

@ -267,7 +267,7 @@ void replace_marked_buffer(const char *filename, filestruct *top, size_t top_x,
filestruct *bot, size_t bot_x); filestruct *bot, size_t bot_x);
#endif #endif
#endif #endif
void display_buffer(void); void prepare_for_display(void);
#ifndef DISABLE_MULTIBUFFER #ifndef DISABLE_MULTIBUFFER
void switch_to_prev_buffer_void(void); void switch_to_prev_buffer_void(void);
void switch_to_next_buffer_void(void); void switch_to_next_buffer_void(void);