Chopping an always-FALSE parameter and deleting an unused return value.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5584 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2016-01-24 15:42:45 +00:00
parent b8d32d8b7b
commit eed1aab3f0
3 changed files with 17 additions and 33 deletions

View File

@ -3,6 +3,8 @@
of the list, so that it won't be dropped any time soon. The problem of the list, so that it won't be dropped any time soon. The problem
was pointed out by David Niklas. was pointed out by David Niklas.
* src/winio.c (edit_redraw): Condense by removing a triplication. * src/winio.c (edit_redraw): Condense by removing a triplication.
* src/prompt.c (do_statusbar_prev_word, do_statusbar_next_word):
Chop an always-FALSE parameter and delete an unused return value.
2016-01-22 Benno Schulenberg <bensberg@justemail.net> 2016-01-22 Benno Schulenberg <bensberg@justemail.net>
* src/utils.c (get_homedir): Don't use $HOME when we're root, because * src/utils.c (get_homedir): Don't use $HOME when we're root, because

View File

@ -159,9 +159,9 @@ int do_statusbar_input(bool *ran_func, bool *finished,
do_statusbar_right(); do_statusbar_right();
#ifndef NANO_TINY #ifndef NANO_TINY
else if (s->scfunc == do_prev_word_void) else if (s->scfunc == do_prev_word_void)
do_statusbar_prev_word(FALSE); do_statusbar_prev_word();
else if (s->scfunc == do_next_word_void) else if (s->scfunc == do_next_word_void)
do_statusbar_next_word(FALSE); do_statusbar_next_word();
#endif #endif
else if (s->scfunc == do_home) else if (s->scfunc == do_home)
do_statusbar_home(); do_statusbar_home();
@ -444,15 +444,13 @@ void do_statusbar_cut_text(void)
} }
#ifndef NANO_TINY #ifndef NANO_TINY
/* Move to the next word in the prompt text. If allow_punct is TRUE, /* Move to the next word in the prompt text. */
* treat punctuation as part of a word. Return TRUE if we started on a void do_statusbar_next_word(void)
* word, and FALSE otherwise. */
bool do_statusbar_next_word(bool allow_punct)
{ {
size_t pww_save = statusbar_pww; size_t pww_save = statusbar_pww;
char *char_mb; char *char_mb;
int char_mb_len; int char_mb_len;
bool end_line = FALSE, started_on_word = FALSE; bool end_line = FALSE;
assert(answer != NULL); assert(answer != NULL);
@ -465,13 +463,9 @@ bool do_statusbar_next_word(bool allow_punct)
/* If we've found it, stop moving forward through the current /* If we've found it, stop moving forward through the current
* line. */ * line. */
if (!is_word_mbchar(char_mb, allow_punct)) if (!is_word_mbchar(char_mb, FALSE))
break; break;
/* If we haven't found it, then we've started on a word, so set
* started_on_word to TRUE. */
started_on_word = TRUE;
if (answer[statusbar_x] == '\0') if (answer[statusbar_x] == '\0')
end_line = TRUE; end_line = TRUE;
else else
@ -489,7 +483,7 @@ bool do_statusbar_next_word(bool allow_punct)
/* If we've found it, stop moving forward through the current /* If we've found it, stop moving forward through the current
* line. */ * line. */
if (is_word_mbchar(char_mb, allow_punct)) if (is_word_mbchar(char_mb, FALSE))
break; break;
if (answer[statusbar_x] == '\0') if (answer[statusbar_x] == '\0')
@ -504,20 +498,15 @@ bool do_statusbar_next_word(bool allow_punct)
if (need_statusbar_update(pww_save)) if (need_statusbar_update(pww_save))
update_statusbar_line(answer, statusbar_x); update_statusbar_line(answer, statusbar_x);
/* Return whether we started on a word. */
return started_on_word;
} }
/* Move to the previous word in the prompt text. If allow_punct is /* Move to the previous word in the prompt text. */
* TRUE, treat punctuation as part of a word. Return TRUE if we started void do_statusbar_prev_word(void)
* on a word, and FALSE otherwise. */
bool do_statusbar_prev_word(bool allow_punct)
{ {
size_t pww_save = statusbar_pww; size_t pww_save = statusbar_pww;
char *char_mb; char *char_mb;
int char_mb_len; int char_mb_len;
bool begin_line = FALSE, started_on_word = FALSE; bool begin_line = FALSE;
assert(answer != NULL); assert(answer != NULL);
@ -530,13 +519,9 @@ bool do_statusbar_prev_word(bool allow_punct)
/* If we've found it, stop moving backward through the current /* If we've found it, stop moving backward through the current
* line. */ * line. */
if (!is_word_mbchar(char_mb, allow_punct)) if (!is_word_mbchar(char_mb, FALSE))
break; break;
/* If we haven't found it, then we've started on a word, so set
* started_on_word to TRUE. */
started_on_word = TRUE;
if (statusbar_x == 0) if (statusbar_x == 0)
begin_line = TRUE; begin_line = TRUE;
else else
@ -555,7 +540,7 @@ bool do_statusbar_prev_word(bool allow_punct)
/* If we've found it, stop moving backward through the current /* If we've found it, stop moving backward through the current
* line. */ * line. */
if (is_word_mbchar(char_mb, allow_punct)) if (is_word_mbchar(char_mb, FALSE))
break; break;
if (statusbar_x == 0) if (statusbar_x == 0)
@ -578,7 +563,7 @@ bool do_statusbar_prev_word(bool allow_punct)
/* If we've found it, stop moving backward through the /* If we've found it, stop moving backward through the
* current line. */ * current line. */
if (!is_word_mbchar(char_mb, allow_punct)) if (!is_word_mbchar(char_mb, FALSE))
break; break;
if (statusbar_x == 0) if (statusbar_x == 0)
@ -599,9 +584,6 @@ bool do_statusbar_prev_word(bool allow_punct)
if (need_statusbar_update(pww_save)) if (need_statusbar_update(pww_save))
update_statusbar_line(answer, statusbar_x); update_statusbar_line(answer, statusbar_x);
/* Return whether we started on a word. */
return started_on_word;
} }
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */

View File

@ -528,8 +528,8 @@ void do_statusbar_backspace(void);
void do_statusbar_delete(void); void do_statusbar_delete(void);
void do_statusbar_cut_text(void); void do_statusbar_cut_text(void);
#ifndef NANO_TINY #ifndef NANO_TINY
bool do_statusbar_next_word(bool allow_punct); void do_statusbar_next_word(void);
bool do_statusbar_prev_word(bool allow_punct); void do_statusbar_prev_word(void);
#endif #endif
void do_statusbar_verbatim_input(bool *got_enter); void do_statusbar_verbatim_input(bool *got_enter);
size_t statusbar_xplustabs(void); size_t statusbar_xplustabs(void);