mirror of git://git.sv.gnu.org/nano.git
tweaks: rename three functions, to be shorter or clearer
This commit is contained in:
parent
a4a32b910a
commit
98ec41b4fa
12
src/files.c
12
src/files.c
|
@ -597,7 +597,7 @@ void prepare_for_display(void)
|
|||
#ifdef ENABLE_MULTIBUFFER
|
||||
/* Switch to a neighbouring file buffer; to the next if to_next is TRUE;
|
||||
* otherwise, to the previous one. */
|
||||
void switch_to_prevnext_buffer(bool to_next)
|
||||
void switch_to_adjacent_buffer(bool to_next)
|
||||
{
|
||||
/* If only one file buffer is open, say so and get out. */
|
||||
if (openfile == openfile->next && !inhelp) {
|
||||
|
@ -640,15 +640,15 @@ void switch_to_prevnext_buffer(bool to_next)
|
|||
}
|
||||
|
||||
/* Switch to the previous entry in the openfile filebuffer. */
|
||||
void switch_to_prev_buffer_void(void)
|
||||
void switch_to_prev_buffer(void)
|
||||
{
|
||||
switch_to_prevnext_buffer(FALSE);
|
||||
switch_to_adjacent_buffer(FALSE);
|
||||
}
|
||||
|
||||
/* Switch to the next entry in the openfile filebuffer. */
|
||||
void switch_to_next_buffer_void(void)
|
||||
void switch_to_next_buffer(void)
|
||||
{
|
||||
switch_to_prevnext_buffer(TRUE);
|
||||
switch_to_adjacent_buffer(TRUE);
|
||||
}
|
||||
|
||||
/* Delete an entry from the circular list of open files, and switch to the
|
||||
|
@ -667,7 +667,7 @@ bool close_buffer(void)
|
|||
#endif
|
||||
|
||||
/* Switch to the next file buffer. */
|
||||
switch_to_prevnext_buffer(TRUE);
|
||||
switch_to_adjacent_buffer(TRUE);
|
||||
|
||||
/* Close the file buffer we had open before. */
|
||||
unlink_opennode(openfile->prev);
|
||||
|
|
20
src/global.c
20
src/global.c
|
@ -886,9 +886,9 @@ void shortcut_init(void)
|
|||
N_("Last Line"), IFSCHELP(nano_lastline_msg), BLANKAFTER, VIEW);
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
add_to_funcs(switch_to_prev_buffer_void, MMAIN,
|
||||
add_to_funcs(switch_to_prev_buffer, MMAIN,
|
||||
N_("Prev File"), IFSCHELP(nano_prevfile_msg), TOGETHER, VIEW);
|
||||
add_to_funcs(switch_to_next_buffer_void, MMAIN,
|
||||
add_to_funcs(switch_to_next_buffer, MMAIN,
|
||||
N_("Next File"), IFSCHELP(nano_nextfile_msg), BLANKAFTER, VIEW);
|
||||
#endif
|
||||
|
||||
|
@ -1139,8 +1139,8 @@ void shortcut_init(void)
|
|||
add_to_sclist(MSOME, "^\xE2\x86\x90", CONTROL_LEFT, do_prev_word_void, 0);
|
||||
add_to_sclist(MSOME, "^\xE2\x86\x92", CONTROL_RIGHT, do_next_word_void, 0);
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
add_to_sclist(MMAIN, "M-\xE2\x86\x90", ALT_LEFT, switch_to_prev_buffer_void, 0);
|
||||
add_to_sclist(MMAIN, "M-\xE2\x86\x92", ALT_RIGHT, switch_to_next_buffer_void, 0);
|
||||
add_to_sclist(MMAIN, "M-\xE2\x86\x90", ALT_LEFT, switch_to_prev_buffer, 0);
|
||||
add_to_sclist(MMAIN, "M-\xE2\x86\x92", ALT_RIGHT, switch_to_next_buffer, 0);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
add_to_sclist(MMAIN|MHELP|MBROWSER, "M-\xE2\x86\x91", ALT_UP, do_findprevious, 0);
|
||||
|
@ -1191,10 +1191,10 @@ void shortcut_init(void)
|
|||
add_to_sclist(MMAIN, "M-=", 0, do_scroll_down, 0);
|
||||
#endif
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
add_to_sclist(MMAIN, "M-<", 0, switch_to_prev_buffer_void, 0);
|
||||
add_to_sclist(MMAIN, "M-,", 0, switch_to_prev_buffer_void, 0);
|
||||
add_to_sclist(MMAIN, "M->", 0, switch_to_next_buffer_void, 0);
|
||||
add_to_sclist(MMAIN, "M-.", 0, switch_to_next_buffer_void, 0);
|
||||
add_to_sclist(MMAIN, "M-<", 0, switch_to_prev_buffer, 0);
|
||||
add_to_sclist(MMAIN, "M-,", 0, switch_to_prev_buffer, 0);
|
||||
add_to_sclist(MMAIN, "M->", 0, switch_to_next_buffer, 0);
|
||||
add_to_sclist(MMAIN, "M-.", 0, switch_to_next_buffer, 0);
|
||||
#endif
|
||||
add_to_sclist(MMOST, "M-V", 0, do_verbatim_input, 0);
|
||||
#ifndef NANO_TINY
|
||||
|
@ -1566,9 +1566,9 @@ sc *strtosc(const char *input)
|
|||
s->scfunc = do_last_line;
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
else if (!strcasecmp(input, "prevbuf"))
|
||||
s->scfunc = switch_to_prev_buffer_void;
|
||||
s->scfunc = switch_to_prev_buffer;
|
||||
else if (!strcasecmp(input, "nextbuf"))
|
||||
s->scfunc = switch_to_next_buffer_void;
|
||||
s->scfunc = switch_to_next_buffer;
|
||||
#endif
|
||||
else if (!strcasecmp(input, "verbatim"))
|
||||
s->scfunc = do_verbatim_input;
|
||||
|
|
|
@ -256,7 +256,7 @@ void do_help(void)
|
|||
#endif
|
||||
|
||||
/* Switch back to the buffer we were invoked from. */
|
||||
switch_to_prev_buffer_void();
|
||||
switch_to_prev_buffer();
|
||||
|
||||
if (ISSET(NO_HELP)) {
|
||||
currmenu = oldmenu;
|
||||
|
|
|
@ -274,8 +274,8 @@ void replace_marked_buffer(const char *filename, filestruct *top, size_t top_x,
|
|||
#endif
|
||||
void prepare_for_display(void);
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
void switch_to_prev_buffer_void(void);
|
||||
void switch_to_next_buffer_void(void);
|
||||
void switch_to_prev_buffer(void);
|
||||
void switch_to_next_buffer(void);
|
||||
bool close_buffer(void);
|
||||
#endif
|
||||
void read_file(FILE *f, int fd, const char *filename, bool undoable,
|
||||
|
|
Loading…
Reference in New Issue