tweaks: rename two more functions, to be simpler too
parent
954c4d03ac
commit
8720cfcce9
|
@ -184,7 +184,7 @@ void chop_word(bool forward)
|
||||||
openfile->current_x = is_current_x;
|
openfile->current_x = is_current_x;
|
||||||
|
|
||||||
/* Now kill the marked region and a word is gone. */
|
/* Now kill the marked region and a word is gone. */
|
||||||
do_cut_text_void();
|
cut_text();
|
||||||
|
|
||||||
/* Discard the cut word and restore the cutbuffer. */
|
/* Discard the cut word and restore the cutbuffer. */
|
||||||
free_lines(cutbuffer);
|
free_lines(cutbuffer);
|
||||||
|
@ -372,7 +372,7 @@ bool is_cuttable(bool test_cliff)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move text from the current buffer into the cutbuffer. */
|
/* Move text from the current buffer into the cutbuffer. */
|
||||||
void do_cut_text_void(void)
|
void cut_text(void)
|
||||||
{
|
{
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (!is_cuttable(ISSET(CUT_FROM_CURSOR) && openfile->mark == NULL))
|
if (!is_cuttable(ISSET(CUT_FROM_CURSOR) && openfile->mark == NULL))
|
||||||
|
@ -427,7 +427,7 @@ void copy_text(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cut from the current cursor position to the end of the file. */
|
/* Cut from the current cursor position to the end of the file. */
|
||||||
void do_cut_till_eof(void)
|
void cut_till_eof(void)
|
||||||
{
|
{
|
||||||
if ((openfile->current == openfile->filebot && openfile->current->data[0] == '\0') ||
|
if ((openfile->current == openfile->filebot && openfile->current->data[0] == '\0') ||
|
||||||
(!ISSET(NO_NEWLINES) && openfile->current->next == openfile->filebot &&
|
(!ISSET(NO_NEWLINES) && openfile->current->next == openfile->filebot &&
|
||||||
|
|
14
src/global.c
14
src/global.c
|
@ -761,7 +761,7 @@ void shortcut_init(void)
|
||||||
N_("Refresh"), WITHORSANS(browserrefresh_gist), BLANKAFTER, VIEW);
|
N_("Refresh"), WITHORSANS(browserrefresh_gist), BLANKAFTER, VIEW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
add_to_funcs(do_cut_text_void, MMAIN,
|
add_to_funcs(cut_text, MMAIN,
|
||||||
N_("Cut Text"), WITHORSANS(cut_gist), TOGETHER, NOVIEW);
|
N_("Cut Text"), WITHORSANS(cut_gist), TOGETHER, NOVIEW);
|
||||||
|
|
||||||
add_to_funcs(paste_text, MMAIN,
|
add_to_funcs(paste_text, MMAIN,
|
||||||
|
@ -952,7 +952,7 @@ void shortcut_init(void)
|
||||||
N_("Chop Left"), WITHORSANS(chopwordleft_gist), TOGETHER, NOVIEW);
|
N_("Chop Left"), WITHORSANS(chopwordleft_gist), TOGETHER, NOVIEW);
|
||||||
add_to_funcs(chop_next_word, MMAIN,
|
add_to_funcs(chop_next_word, MMAIN,
|
||||||
N_("Chop Right"), WITHORSANS(chopwordright_gist), TOGETHER, NOVIEW);
|
N_("Chop Right"), WITHORSANS(chopwordright_gist), TOGETHER, NOVIEW);
|
||||||
add_to_funcs(do_cut_till_eof, MMAIN,
|
add_to_funcs(cut_till_eof, MMAIN,
|
||||||
N_("CutTillEnd"), WITHORSANS(cuttilleof_gist), BLANKAFTER, NOVIEW);
|
N_("CutTillEnd"), WITHORSANS(cuttilleof_gist), BLANKAFTER, NOVIEW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1114,7 +1114,7 @@ void shortcut_init(void)
|
||||||
add_to_sclist(MMAIN|MHELP|MBROWSER, "^W", 0, do_search_forward, 0);
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "^W", 0, do_search_forward, 0);
|
||||||
add_to_sclist(MMAIN, "^\\", 0, do_replace, 0);
|
add_to_sclist(MMAIN, "^\\", 0, do_replace, 0);
|
||||||
add_to_sclist(MMAIN, "M-R", 0, do_replace, 0);
|
add_to_sclist(MMAIN, "M-R", 0, do_replace, 0);
|
||||||
add_to_sclist(MMOST, "^K", 0, do_cut_text_void, 0);
|
add_to_sclist(MMOST, "^K", 0, cut_text, 0);
|
||||||
add_to_sclist(MMOST, "^U", 0, paste_text, 0);
|
add_to_sclist(MMOST, "^U", 0, paste_text, 0);
|
||||||
#ifdef ENABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
add_to_sclist(MMAIN, "^J", 0, do_justify_void, 0);
|
add_to_sclist(MMAIN, "^J", 0, do_justify_void, 0);
|
||||||
|
@ -1244,7 +1244,7 @@ void shortcut_init(void)
|
||||||
#endif
|
#endif
|
||||||
add_to_sclist(MMOST, "M-V", 0, do_verbatim_input, 0);
|
add_to_sclist(MMOST, "M-V", 0, do_verbatim_input, 0);
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
add_to_sclist(MMAIN, "M-T", 0, do_cut_till_eof, 0);
|
add_to_sclist(MMAIN, "M-T", 0, cut_till_eof, 0);
|
||||||
add_to_sclist(MMAIN, "M-D", 0, do_wordlinechar_count, 0);
|
add_to_sclist(MMAIN, "M-D", 0, do_wordlinechar_count, 0);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
|
@ -1383,7 +1383,7 @@ void shortcut_init(void)
|
||||||
add_to_sclist(MMAIN|MHELP|MBROWSER, "F6", 0, do_search_forward, 0);
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "F6", 0, do_search_forward, 0);
|
||||||
add_to_sclist(MMAIN|MHELP|MBROWSER|MLINTER, "F7", 0, do_page_up, 0);
|
add_to_sclist(MMAIN|MHELP|MBROWSER|MLINTER, "F7", 0, do_page_up, 0);
|
||||||
add_to_sclist(MMAIN|MHELP|MBROWSER|MLINTER, "F8", 0, do_page_down, 0);
|
add_to_sclist(MMAIN|MHELP|MBROWSER|MLINTER, "F8", 0, do_page_down, 0);
|
||||||
add_to_sclist(MMOST, "F9", 0, do_cut_text_void, 0);
|
add_to_sclist(MMOST, "F9", 0, cut_text, 0);
|
||||||
add_to_sclist(MMOST, "F10", 0, paste_text, 0);
|
add_to_sclist(MMOST, "F10", 0, paste_text, 0);
|
||||||
add_to_sclist(MMAIN, "F11", 0, do_cursorpos_void, 0);
|
add_to_sclist(MMAIN, "F11", 0, do_cursorpos_void, 0);
|
||||||
#ifdef ENABLE_SPELLER
|
#ifdef ENABLE_SPELLER
|
||||||
|
@ -1483,12 +1483,12 @@ keystruct *strtosc(const char *input)
|
||||||
else if (!strcasecmp(input, "replace"))
|
else if (!strcasecmp(input, "replace"))
|
||||||
s->func = do_replace;
|
s->func = do_replace;
|
||||||
else if (!strcasecmp(input, "cut"))
|
else if (!strcasecmp(input, "cut"))
|
||||||
s->func = do_cut_text_void;
|
s->func = cut_text;
|
||||||
else if (!strcasecmp(input, "paste"))
|
else if (!strcasecmp(input, "paste"))
|
||||||
s->func = paste_text;
|
s->func = paste_text;
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
else if (!strcasecmp(input, "cutrestoffile"))
|
else if (!strcasecmp(input, "cutrestoffile"))
|
||||||
s->func = do_cut_till_eof;
|
s->func = cut_till_eof;
|
||||||
else if (!strcasecmp(input, "copy"))
|
else if (!strcasecmp(input, "copy"))
|
||||||
s->func = copy_text;
|
s->func = copy_text;
|
||||||
else if (!strcasecmp(input, "zap"))
|
else if (!strcasecmp(input, "zap"))
|
||||||
|
|
|
@ -1721,7 +1721,7 @@ void do_input(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* When not cutting or copying text, drop the cutbuffer the next time. */
|
/* When not cutting or copying text, drop the cutbuffer the next time. */
|
||||||
if (shortcut->func != do_cut_text_void) {
|
if (shortcut->func != cut_text) {
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (shortcut->func != copy_text && shortcut->func != zap_text)
|
if (shortcut->func != copy_text && shortcut->func != zap_text)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -150,7 +150,7 @@ int do_statusbar_input(bool *finished)
|
||||||
else if (ISSET(RESTRICTED) && currmenu == MWRITEFILE &&
|
else if (ISSET(RESTRICTED) && currmenu == MWRITEFILE &&
|
||||||
openfile->filename[0] != '\0' &&
|
openfile->filename[0] != '\0' &&
|
||||||
(shortcut->func == do_verbatim_input ||
|
(shortcut->func == do_verbatim_input ||
|
||||||
shortcut->func == do_cut_text_void ||
|
shortcut->func == cut_text ||
|
||||||
shortcut->func == paste_text ||
|
shortcut->func == paste_text ||
|
||||||
shortcut->func == do_delete ||
|
shortcut->func == do_delete ||
|
||||||
shortcut->func == do_backspace))
|
shortcut->func == do_backspace))
|
||||||
|
@ -161,7 +161,7 @@ int do_statusbar_input(bool *finished)
|
||||||
#endif
|
#endif
|
||||||
else if (shortcut->func == do_verbatim_input)
|
else if (shortcut->func == do_verbatim_input)
|
||||||
do_statusbar_verbatim_input();
|
do_statusbar_verbatim_input();
|
||||||
else if (shortcut->func == do_cut_text_void)
|
else if (shortcut->func == cut_text)
|
||||||
do_statusbar_cut_text();
|
do_statusbar_cut_text();
|
||||||
else if (shortcut->func == do_delete)
|
else if (shortcut->func == do_delete)
|
||||||
do_statusbar_delete();
|
do_statusbar_delete();
|
||||||
|
|
|
@ -256,10 +256,10 @@ void cut_marked(bool *right_side_up);
|
||||||
#endif
|
#endif
|
||||||
void do_cut_text(bool copying, bool marked, bool until_eof, bool append);
|
void do_cut_text(bool copying, bool marked, bool until_eof, bool append);
|
||||||
bool is_cuttable(bool test_cliff);
|
bool is_cuttable(bool test_cliff);
|
||||||
void do_cut_text_void(void);
|
void cut_text(void);
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
void copy_text(void);
|
void copy_text(void);
|
||||||
void do_cut_till_eof(void);
|
void cut_till_eof(void);
|
||||||
void zap_text(void);
|
void zap_text(void);
|
||||||
#endif
|
#endif
|
||||||
void paste_text(void);
|
void paste_text(void);
|
||||||
|
|
|
@ -338,7 +338,7 @@ bool is_universal(void (*func)(void))
|
||||||
func == do_prev_word_void || func == do_next_word_void ||
|
func == do_prev_word_void || func == do_next_word_void ||
|
||||||
#endif
|
#endif
|
||||||
func == do_delete || func == do_backspace ||
|
func == do_delete || func == do_backspace ||
|
||||||
func == do_cut_text_void || func == paste_text ||
|
func == cut_text || func == paste_text ||
|
||||||
func == do_tab || func == do_enter || func == do_verbatim_input);
|
func == do_tab || func == do_enter || func == do_verbatim_input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue