Commit 5237a42d authored by David Lawrence Ramsey's avatar David Lawrence Ramsey Committed by Benno Schulenberg
Browse files

weeding: remove the unused be_clever parameter from do_home()/do_end()

No related merge requests found
Showing with 22 additions and 37 deletions
+22 -37
...@@ -842,9 +842,9 @@ void shortcut_init(void) ...@@ -842,9 +842,9 @@ void shortcut_init(void)
add_to_funcs(do_next_word_void, MMAIN, add_to_funcs(do_next_word_void, MMAIN,
N_("Next Word"), IFSCHELP(nano_nextword_msg), TOGETHER, VIEW); N_("Next Word"), IFSCHELP(nano_nextword_msg), TOGETHER, VIEW);
add_to_funcs(do_home_void, MMAIN, add_to_funcs(do_home, MMAIN,
N_("Home"), IFSCHELP(nano_home_msg), TOGETHER, VIEW); N_("Home"), IFSCHELP(nano_home_msg), TOGETHER, VIEW);
add_to_funcs(do_end_void, MMAIN, add_to_funcs(do_end, MMAIN,
N_("End"), IFSCHELP(nano_end_msg), BLANKAFTER, VIEW); N_("End"), IFSCHELP(nano_end_msg), BLANKAFTER, VIEW);
add_to_funcs(do_up_void, MMAIN|MHELP|MBROWSER, add_to_funcs(do_up_void, MMAIN|MHELP|MBROWSER,
...@@ -1157,10 +1157,10 @@ void shortcut_init(void) ...@@ -1157,10 +1157,10 @@ void shortcut_init(void)
} }
add_to_sclist(MMOST, "M-Space", 0, do_prev_word_void, 0); add_to_sclist(MMOST, "M-Space", 0, do_prev_word_void, 0);
add_to_sclist(MMOST, "^Space", 0, do_next_word_void, 0); add_to_sclist(MMOST, "^Space", 0, do_next_word_void, 0);
add_to_sclist((MMOST & ~MBROWSER), "^A", 0, do_home_void, 0); add_to_sclist((MMOST & ~MBROWSER), "^A", 0, do_home, 0);
add_to_sclist((MMOST & ~MBROWSER), "Home", KEY_HOME, do_home_void, 0); add_to_sclist((MMOST & ~MBROWSER), "Home", KEY_HOME, do_home, 0);
add_to_sclist((MMOST & ~MBROWSER), "^E", 0, do_end_void, 0); add_to_sclist((MMOST & ~MBROWSER), "^E", 0, do_end, 0);
add_to_sclist((MMOST & ~MBROWSER), "End", KEY_END, do_end_void, 0); add_to_sclist((MMOST & ~MBROWSER), "End", KEY_END, do_end, 0);
add_to_sclist(MMAIN|MHELP|MBROWSER, "^P", 0, do_up_void, 0); add_to_sclist(MMAIN|MHELP|MBROWSER, "^P", 0, do_up_void, 0);
add_to_sclist(MMAIN|MHELP|MBROWSER, "^N", 0, do_down_void, 0); add_to_sclist(MMAIN|MHELP|MBROWSER, "^N", 0, do_down_void, 0);
#ifdef ENABLE_UTF8 #ifdef ENABLE_UTF8
...@@ -1548,9 +1548,9 @@ sc *strtosc(const char *input) ...@@ -1548,9 +1548,9 @@ sc *strtosc(const char *input)
else if (!strcasecmp(input, "nextword")) else if (!strcasecmp(input, "nextword"))
s->scfunc = do_next_word_void; s->scfunc = do_next_word_void;
else if (!strcasecmp(input, "home")) else if (!strcasecmp(input, "home"))
s->scfunc = do_home_void; s->scfunc = do_home;
else if (!strcasecmp(input, "end")) else if (!strcasecmp(input, "end"))
s->scfunc = do_end_void; s->scfunc = do_end;
else if (!strcasecmp(input, "prevblock")) else if (!strcasecmp(input, "prevblock"))
s->scfunc = do_prev_block; s->scfunc = do_prev_block;
else if (!strcasecmp(input, "nextblock")) else if (!strcasecmp(input, "nextblock"))
......
...@@ -338,10 +338,9 @@ void do_next_word_void(void) ...@@ -338,10 +338,9 @@ void do_next_word_void(void)
} }
/* Move to the beginning of the current line (or softwrapped chunk). /* Move to the beginning of the current line (or softwrapped chunk).
* If be_clever is TRUE, do a smart home when wanted and possible, * When enabled, do a smart home. When softwrapping, go the beginning
* and do a dynamic home when in softwrap mode and it's possible. * of the full line when already at the start of a chunk. */
* If be_clever is FALSE, just do a simple home. */ void do_home(void)
void do_home(bool be_clever)
{ {
filestruct *was_current = openfile->current; filestruct *was_current = openfile->current;
size_t was_column = xplustabs(); size_t was_column = xplustabs();
...@@ -355,7 +354,7 @@ void do_home(bool be_clever) ...@@ -355,7 +354,7 @@ void do_home(bool be_clever)
leftedge_x = actual_x(openfile->current->data, leftedge); leftedge_x = actual_x(openfile->current->data, leftedge);
} }
if (ISSET(SMART_HOME) && be_clever) { if (ISSET(SMART_HOME)) {
size_t indent_x = indent_length(openfile->current->data); size_t indent_x = indent_length(openfile->current->data);
if (openfile->current->data[indent_x] != '\0') { if (openfile->current->data[indent_x] != '\0') {
...@@ -375,7 +374,7 @@ void do_home(bool be_clever) ...@@ -375,7 +374,7 @@ void do_home(bool be_clever)
if (!moved && ISSET(SOFTWRAP)) { if (!moved && ISSET(SOFTWRAP)) {
/* If already at the left edge of the screen, move fully home. /* If already at the left edge of the screen, move fully home.
* Otherwise, move to the left edge. */ * Otherwise, move to the left edge. */
if (openfile->current_x == leftedge_x && be_clever) if (openfile->current_x == leftedge_x)
openfile->current_x = 0; openfile->current_x = 0;
else { else {
openfile->current_x = leftedge_x; openfile->current_x = leftedge_x;
...@@ -398,16 +397,10 @@ void do_home(bool be_clever) ...@@ -398,16 +397,10 @@ void do_home(bool be_clever)
update_line(openfile->current, openfile->current_x); update_line(openfile->current, openfile->current_x);
} }
/* Do a (smart or dynamic) home. */
void do_home_void(void)
{
do_home(TRUE);
}
/* Move to the end of the current line (or softwrapped chunk). /* Move to the end of the current line (or softwrapped chunk).
* If be_clever is TRUE, do a dynamic end when in softwrap mode and * When softwrapping and alredy at the end of a chunk, go to the
* it's possible. If be_clever is FALSE, just do a simple end. */ * end of the full line. */
void do_end(bool be_clever) void do_end(void)
{ {
filestruct *was_current = openfile->current; filestruct *was_current = openfile->current;
size_t was_column = xplustabs(); size_t was_column = xplustabs();
...@@ -433,7 +426,7 @@ void do_end(bool be_clever) ...@@ -433,7 +426,7 @@ void do_end(bool be_clever)
/* If already at the right edge of the screen, move fully to /* If already at the right edge of the screen, move fully to
* the end of the line. Otherwise, move to the right edge. */ * the end of the line. Otherwise, move to the right edge. */
if (openfile->current_x == rightedge_x && be_clever) if (openfile->current_x == rightedge_x)
openfile->current_x = line_len; openfile->current_x = line_len;
else { else {
openfile->current_x = rightedge_x; openfile->current_x = rightedge_x;
...@@ -456,12 +449,6 @@ void do_end(bool be_clever) ...@@ -456,12 +449,6 @@ void do_end(bool be_clever)
update_line(openfile->current, openfile->current_x); update_line(openfile->current, openfile->current_x);
} }
/* Do a (dynamic) end. */
void do_end_void(void)
{
do_end(TRUE);
}
/* Move the cursor to the preceding line or chunk. If scroll_only is TRUE, /* Move the cursor to the preceding line or chunk. If scroll_only is TRUE,
* also scroll the screen one row, so the cursor stays in the same spot. */ * also scroll the screen one row, so the cursor stays in the same spot. */
void do_up(bool scroll_only) void do_up(bool scroll_only)
......
...@@ -122,9 +122,9 @@ int do_statusbar_input(bool *ran_func, bool *finished) ...@@ -122,9 +122,9 @@ int do_statusbar_input(bool *ran_func, bool *finished)
else if (s->scfunc == do_next_word_void) else if (s->scfunc == do_next_word_void)
do_statusbar_next_word(); do_statusbar_next_word();
#endif #endif
else if (s->scfunc == do_home_void) else if (s->scfunc == do_home)
do_statusbar_home(); do_statusbar_home();
else if (s->scfunc == do_end_void) else if (s->scfunc == do_end)
do_statusbar_end(); do_statusbar_end();
/* When in restricted mode at the "Write File" prompt and the /* When in restricted mode at the "Write File" prompt and the
* filename isn't blank, disallow any input and deletion. */ * filename isn't blank, disallow any input and deletion. */
......
...@@ -374,10 +374,8 @@ void do_prev_word(bool allow_punct, bool update_screen); ...@@ -374,10 +374,8 @@ void do_prev_word(bool allow_punct, bool update_screen);
void do_prev_word_void(void); void do_prev_word_void(void);
bool do_next_word(bool allow_punct, bool update_screen); bool do_next_word(bool allow_punct, bool update_screen);
void do_next_word_void(void); void do_next_word_void(void);
void do_home(bool be_clever); void do_home(void);
void do_home_void(void); void do_end(void);
void do_end(bool be_clever);
void do_end_void(void);
void do_up(bool scroll_only); void do_up(bool scroll_only);
void do_up_void(void); void do_up_void(void);
void do_down(bool scroll_only); void do_down(bool scroll_only);
......
...@@ -352,7 +352,7 @@ void parse_syntax(char *ptr) ...@@ -352,7 +352,7 @@ void parse_syntax(char *ptr)
bool is_universal(void (*func)(void)) bool is_universal(void (*func)(void))
{ {
if (func == do_left || func == do_right || if (func == do_left || func == do_right ||
func == do_home_void || func == do_end_void || func == do_home || func == do_end ||
#ifndef NANO_TINY #ifndef NANO_TINY
func == do_prev_word_void || func == do_next_word_void || func == do_prev_word_void || func == do_next_word_void ||
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment