tweaks: rename two functions, for shortness
parent
c2f007afc5
commit
dd6f129c3c
|
@ -183,9 +183,9 @@ char *do_browser(char *path)
|
|||
} else if (func == do_right) {
|
||||
if (selected < filelist_len - 1)
|
||||
selected++;
|
||||
} else if (func == do_prev_word_void) {
|
||||
} else if (func == to_prev_word) {
|
||||
selected -= (selected % width);
|
||||
} else if (func == do_next_word_void) {
|
||||
} else if (func == to_next_word) {
|
||||
selected += width - 1 - (selected % width);
|
||||
if (selected >= filelist_len)
|
||||
selected = filelist_len - 1;
|
||||
|
|
28
src/global.c
28
src/global.c
|
@ -903,10 +903,10 @@ void shortcut_init(void)
|
|||
N_("Forward"), WITHORSANS(forwardfile_gist), TOGETHER, VIEW);
|
||||
#endif
|
||||
|
||||
add_to_funcs(do_prev_word_void, MMAIN,
|
||||
add_to_funcs(to_prev_word, MMAIN,
|
||||
/* TRANSLATORS: Try to keep the next eighteen strings at most 12 characters. */
|
||||
N_("Prev Word"), WITHORSANS(prevword_gist), TOGETHER, VIEW);
|
||||
add_to_funcs(do_next_word_void, MMAIN,
|
||||
add_to_funcs(to_next_word, MMAIN,
|
||||
N_("Next Word"), WITHORSANS(nextword_gist), TOGETHER, VIEW);
|
||||
|
||||
add_to_funcs(do_home, MMAIN,
|
||||
|
@ -1105,9 +1105,9 @@ void shortcut_init(void)
|
|||
add_to_funcs(to_last_file, MBROWSER|MWHEREISFILE,
|
||||
N_("Last File"), WITHORSANS(lastfile_gist), BLANKAFTER, VIEW);
|
||||
#ifndef NANO_TINY
|
||||
add_to_funcs(do_prev_word_void, MBROWSER,
|
||||
add_to_funcs(to_prev_word, MBROWSER,
|
||||
N_("Left Column"), WITHORSANS(browserlefthand_gist), TOGETHER, VIEW);
|
||||
add_to_funcs(do_next_word_void, MBROWSER,
|
||||
add_to_funcs(to_next_word, MBROWSER,
|
||||
N_("Right Column"), WITHORSANS(browserrighthand_gist), TOGETHER, VIEW);
|
||||
add_to_funcs(do_prev_block, MBROWSER,
|
||||
N_("Top Row"), WITHORSANS(browsertoprow_gist), TOGETHER, VIEW);
|
||||
|
@ -1210,8 +1210,8 @@ void shortcut_init(void)
|
|||
if (using_utf8()) {
|
||||
add_to_sclist(MMOST|MBROWSER|MHELP, "\xE2\x97\x80", KEY_LEFT, do_left, 0);
|
||||
add_to_sclist(MMOST|MBROWSER|MHELP, "\xE2\x96\xb6", KEY_RIGHT, do_right, 0);
|
||||
add_to_sclist(MSOME, "^\xE2\x97\x80", CONTROL_LEFT, do_prev_word_void, 0);
|
||||
add_to_sclist(MSOME, "^\xE2\x96\xb6", CONTROL_RIGHT, do_next_word_void, 0);
|
||||
add_to_sclist(MSOME, "^\xE2\x97\x80", CONTROL_LEFT, to_prev_word, 0);
|
||||
add_to_sclist(MSOME, "^\xE2\x96\xb6", CONTROL_RIGHT, to_next_word, 0);
|
||||
#if !defined(NANO_TINY) && defined(ENABLE_MULTIBUFFER)
|
||||
if (!on_a_vt) {
|
||||
add_to_sclist(MMAIN, "M-\xE2\x97\x80", ALT_LEFT, switch_to_prev_buffer, 0);
|
||||
|
@ -1223,8 +1223,8 @@ void shortcut_init(void)
|
|||
{
|
||||
add_to_sclist(MMOST|MBROWSER|MHELP, "Left", KEY_LEFT, do_left, 0);
|
||||
add_to_sclist(MMOST|MBROWSER|MHELP, "Right", KEY_RIGHT, do_right, 0);
|
||||
add_to_sclist(MSOME, "^Left", CONTROL_LEFT, do_prev_word_void, 0);
|
||||
add_to_sclist(MSOME, "^Right", CONTROL_RIGHT, do_next_word_void, 0);
|
||||
add_to_sclist(MSOME, "^Left", CONTROL_LEFT, to_prev_word, 0);
|
||||
add_to_sclist(MSOME, "^Right", CONTROL_RIGHT, to_next_word, 0);
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
if (!on_a_vt) {
|
||||
add_to_sclist(MMAIN, "M-Left", ALT_LEFT, switch_to_prev_buffer, 0);
|
||||
|
@ -1233,13 +1233,13 @@ void shortcut_init(void)
|
|||
#endif
|
||||
}
|
||||
#ifdef NANO_TINY
|
||||
add_to_sclist(MMAIN, "M-B", 0, do_prev_word_void, 0);
|
||||
add_to_sclist(MMAIN, "M-D", 0, do_prev_word_void, 0);
|
||||
add_to_sclist(MMAIN, "M-F", 0, do_next_word_void, 0);
|
||||
add_to_sclist(MMAIN, "M-N", 0, do_next_word_void, 0);
|
||||
add_to_sclist(MMAIN, "M-B", 0, to_prev_word, 0);
|
||||
add_to_sclist(MMAIN, "M-D", 0, to_prev_word, 0);
|
||||
add_to_sclist(MMAIN, "M-F", 0, to_next_word, 0);
|
||||
add_to_sclist(MMAIN, "M-N", 0, to_next_word, 0);
|
||||
#endif
|
||||
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, "M-Space", 0, to_prev_word, 0);
|
||||
add_to_sclist(MMOST, "^Space", 0, to_next_word, 0);
|
||||
add_to_sclist(MMOST, "^A", 0, do_home, 0);
|
||||
add_to_sclist(MMOST, "Home", KEY_HOME, do_home, 0);
|
||||
add_to_sclist(MMOST, "^E", 0, do_end, 0);
|
||||
|
|
|
@ -355,7 +355,7 @@ bool do_next_word(bool after_ends, bool allow_punct)
|
|||
|
||||
/* Move to the previous word in the file, treating punctuation as part of a
|
||||
* word if the WORD_BOUNDS flag is set, and update the screen afterwards. */
|
||||
void do_prev_word_void(void)
|
||||
void to_prev_word(void)
|
||||
{
|
||||
linestruct *was_current = openfile->current;
|
||||
|
||||
|
@ -367,7 +367,7 @@ void do_prev_word_void(void)
|
|||
/* Move to the next word in the file. If the AFTER_ENDS flag is set, stop
|
||||
* at word ends instead of beginnings. If the WORD_BOUNDS flag is set, treat
|
||||
* punctuation as part of a word. Update the screen afterwards. */
|
||||
void do_next_word_void(void)
|
||||
void to_next_word(void)
|
||||
{
|
||||
linestruct *was_current = openfile->current;
|
||||
|
||||
|
|
|
@ -1434,7 +1434,7 @@ bool wanted_to_move(void (*func)(void))
|
|||
return func == do_left || func == do_right ||
|
||||
func == do_up || func == do_down ||
|
||||
func == do_home || func == do_end ||
|
||||
func == do_prev_word_void || func == do_next_word_void ||
|
||||
func == to_prev_word || func == to_next_word ||
|
||||
#ifdef ENABLE_JUSTIFY
|
||||
func == do_para_begin_void || func == do_para_end_void ||
|
||||
#endif
|
||||
|
|
|
@ -281,9 +281,9 @@ int do_statusbar_input(bool *finished)
|
|||
else if (shortcut->func == do_right)
|
||||
do_statusbar_right();
|
||||
#ifndef NANO_TINY
|
||||
else if (shortcut->func == do_prev_word_void)
|
||||
else if (shortcut->func == to_prev_word)
|
||||
do_statusbar_prev_word();
|
||||
else if (shortcut->func == do_next_word_void)
|
||||
else if (shortcut->func == to_next_word)
|
||||
do_statusbar_next_word();
|
||||
#endif
|
||||
else if (shortcut->func == do_home)
|
||||
|
|
|
@ -374,8 +374,8 @@ void do_prev_block(void);
|
|||
void do_next_block(void);
|
||||
void do_prev_word(bool allow_punct);
|
||||
bool do_next_word(bool after_ends, bool allow_punct);
|
||||
void do_prev_word_void(void);
|
||||
void do_next_word_void(void);
|
||||
void to_prev_word(void);
|
||||
void to_next_word(void);
|
||||
void do_home(void);
|
||||
void do_end(void);
|
||||
void do_up(void);
|
||||
|
|
|
@ -340,9 +340,9 @@ keystruct *strtosc(const char *input)
|
|||
s->func = do_scroll_down;
|
||||
#endif
|
||||
else if (!strcmp(input, "prevword"))
|
||||
s->func = do_prev_word_void;
|
||||
s->func = to_prev_word;
|
||||
else if (!strcmp(input, "nextword"))
|
||||
s->func = do_next_word_void;
|
||||
s->func = to_next_word;
|
||||
else if (!strcmp(input, "home"))
|
||||
s->func = do_home;
|
||||
else if (!strcmp(input, "end"))
|
||||
|
@ -706,7 +706,7 @@ bool is_universal(void (*func)(void))
|
|||
return (func == do_left || func == do_right ||
|
||||
func == do_home || func == do_end ||
|
||||
#ifndef NANO_TINY
|
||||
func == do_prev_word_void || func == do_next_word_void ||
|
||||
func == to_prev_word || func == to_next_word ||
|
||||
#endif
|
||||
func == do_delete || func == do_backspace ||
|
||||
func == cut_text || func == paste_text ||
|
||||
|
|
Loading…
Reference in New Issue