Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
98ec41b4
Commit
98ec41b4
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename three functions, to be shorter or clearer
parent
a4a32b91
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/files.c
+6
-6
src/files.c
src/global.c
+10
-10
src/global.c
src/help.c
+1
-1
src/help.c
src/proto.h
+2
-2
src/proto.h
with
19 additions
and
19 deletions
+19
-19
src/files.c
View file @
98ec41b4
...
...
@@ -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_
prevnex
t_buffer
(
bool
to_next
)
void
switch_to_
adjacen
t_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_
prevnex
t_buffer
(
FALSE
);
switch_to_
adjacen
t_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_
prevnex
t_buffer
(
TRUE
);
switch_to_
adjacen
t_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_
prevnex
t_buffer
(
TRUE
);
switch_to_
adjacen
t_buffer
(
TRUE
);
/* Close the file buffer we had open before. */
unlink_opennode
(
openfile
->
prev
);
...
...
This diff is collapsed.
Click to expand it.
src/global.c
View file @
98ec41b4
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/help.c
View file @
98ec41b4
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
98ec41b4
...
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help