diff --git a/ChangeLog b/ChangeLog index 6958182c..1f04ffc0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2015-04-20 Benno Schulenberg * src/winio.c (need_horizontal_update, need_vertical_update): Fuse two identical functions into one: need_screen_update(). + * src/prompt.c (need_statusbar_horizontal_update): Rename function + to need_statusbar_update() as there is no vertical counterpart. 2015-04-18 Benno Schulenberg * src/global.c, src/nano.c, doc/man/nanorc.5, doc/texinfo/nano.texi: diff --git a/src/prompt.c b/src/prompt.c index 89d0a86c..38178df7 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -245,7 +245,7 @@ int do_statusbar_mouse(void) statusbar_xplustabs()) + mouse_x - start_col); statusbar_pww = statusbar_xplustabs(); - if (need_statusbar_horizontal_update(pww_save)) + if (need_statusbar_update(pww_save)) update_statusbar_line(answer, statusbar_x); } } @@ -347,7 +347,7 @@ void do_statusbar_home(void) statusbar_pww = statusbar_xplustabs(); } - if (need_statusbar_horizontal_update(pww_save)) + if (need_statusbar_update(pww_save)) update_statusbar_line(answer, statusbar_x); } @@ -359,7 +359,7 @@ void do_statusbar_end(void) statusbar_x = strlen(answer); statusbar_pww = statusbar_xplustabs(); - if (need_statusbar_horizontal_update(pww_save)) + if (need_statusbar_update(pww_save)) update_statusbar_line(answer, statusbar_x); } @@ -372,7 +372,7 @@ void do_statusbar_left(void) statusbar_x = move_mbleft(answer, statusbar_x); statusbar_pww = statusbar_xplustabs(); - if (need_statusbar_horizontal_update(pww_save)) + if (need_statusbar_update(pww_save)) update_statusbar_line(answer, statusbar_x); } } @@ -386,7 +386,7 @@ void do_statusbar_right(void) statusbar_x = move_mbright(answer, statusbar_x); statusbar_pww = statusbar_xplustabs(); - if (need_statusbar_horizontal_update(pww_save)) + if (need_statusbar_update(pww_save)) update_statusbar_line(answer, statusbar_x); } } @@ -500,7 +500,7 @@ bool do_statusbar_next_word(bool allow_punct) statusbar_pww = statusbar_xplustabs(); - if (need_statusbar_horizontal_update(pww_save)) + if (need_statusbar_update(pww_save)) update_statusbar_line(answer, statusbar_x); /* Return whether we started on a word. */ @@ -595,7 +595,7 @@ bool do_statusbar_prev_word(bool allow_punct) statusbar_pww = statusbar_xplustabs(); - if (need_statusbar_horizontal_update(pww_save)) + if (need_statusbar_update(pww_save)) update_statusbar_line(answer, statusbar_x); /* Return whether we started on a word. */ @@ -698,10 +698,10 @@ void update_statusbar_line(const char *curranswer, size_t index) wnoutrefresh(bottomwin); } -/* Return TRUE if we need an update after moving horizontally, and FALSE - * otherwise. We need one if pww_save and statusbar_pww are on +/* Return TRUE if we need an update after moving the cursor, and FALSE + * otherwise. We need an update if pww_save and statusbar_pww are on * different pages. */ -bool need_statusbar_horizontal_update(size_t pww_save) +bool need_statusbar_update(size_t pww_save) { size_t start_col = strlenpt(prompt) + 2; diff --git a/src/proto.h b/src/proto.h index 3a6e593f..823386a7 100644 --- a/src/proto.h +++ b/src/proto.h @@ -522,7 +522,7 @@ size_t statusbar_xplustabs(void); size_t get_statusbar_page_start(size_t start_col, size_t column); void reset_statusbar_cursor(void); void update_statusbar_line(const char *curranswer, size_t index); -bool need_statusbar_horizontal_update(size_t pww_save); +bool need_statusbar_update(size_t pww_save); void total_statusbar_refresh(void (*refresh_func)(void)); functionptrtype get_prompt_string(int *value, bool allow_tabs, #ifndef DISABLE_TABCOMP