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
parent
c095ece497
commit
1423e57199
15
src/files.c
15
src/files.c
|
@ -581,23 +581,22 @@ void replace_marked_buffer(const char *filename, filestruct *top, size_t top_x,
|
|||
#endif /* !NANO_TINY */
|
||||
#endif /* !DISABLE_SPELLER */
|
||||
|
||||
/* Update the screen to account for the current buffer. */
|
||||
void display_buffer(void)
|
||||
/* Update the titlebar and the multiline cache to match the current buffer. */
|
||||
void prepare_for_display(void)
|
||||
{
|
||||
/* Update the titlebar, since the filename may have changed. */
|
||||
if (!inhelp)
|
||||
titlebar(NULL);
|
||||
|
||||
#ifndef DISABLE_COLOR
|
||||
have_palette = FALSE;
|
||||
|
||||
/* If there are multiline coloring regexes, and there is no
|
||||
* multiline cache data yet, precalculate it now. */
|
||||
if (openfile->syntax && openfile->syntax->nmultis > 0 &&
|
||||
openfile->fileage->multidata == NULL)
|
||||
precalc_multicolorinfo();
|
||||
#endif
|
||||
|
||||
have_palette = FALSE;
|
||||
#endif
|
||||
refresh_needed = TRUE;
|
||||
}
|
||||
|
||||
|
@ -629,8 +628,8 @@ void switch_to_prevnext_buffer(bool to_next)
|
|||
openfile->firstcolumn = 0;
|
||||
#endif
|
||||
|
||||
/* Update the screen to account for the current buffer. */
|
||||
display_buffer();
|
||||
/* Update titlebar and multiline info to match the current buffer. */
|
||||
prepare_for_display();
|
||||
|
||||
/* Indicate the switch on the statusbar. */
|
||||
if (!inhelp)
|
||||
|
@ -1190,7 +1189,7 @@ void do_insertfile(void)
|
|||
}
|
||||
#endif /* !DISABLE_HISTORIES */
|
||||
/* Update stuff to account for the current buffer. */
|
||||
display_buffer();
|
||||
prepare_for_display();
|
||||
} else
|
||||
#endif /* !DISABLE_MULTIBUFFER */
|
||||
{
|
||||
|
|
|
@ -80,7 +80,7 @@ void display_the_help_text(bool redisplaying)
|
|||
open_buffer(tempfilename, FALSE);
|
||||
remove_magicline();
|
||||
|
||||
display_buffer();
|
||||
prepare_for_display();
|
||||
|
||||
/* Move to the position in the file where we were before. */
|
||||
while (TRUE) {
|
||||
|
|
|
@ -2624,10 +2624,10 @@ int main(int argc, char **argv)
|
|||
#endif
|
||||
|
||||
#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
|
||||
|
||||
display_buffer();
|
||||
prepare_for_display();
|
||||
|
||||
while (TRUE) {
|
||||
#ifdef ENABLE_LINENUMBERS
|
||||
|
|
|
@ -267,7 +267,7 @@ void replace_marked_buffer(const char *filename, filestruct *top, size_t top_x,
|
|||
filestruct *bot, size_t bot_x);
|
||||
#endif
|
||||
#endif
|
||||
void display_buffer(void);
|
||||
void prepare_for_display(void);
|
||||
#ifndef DISABLE_MULTIBUFFER
|
||||
void switch_to_prev_buffer_void(void);
|
||||
void switch_to_next_buffer_void(void);
|
||||
|
|
Loading…
Reference in New Issue