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
f9ebf038
Commit
f9ebf038
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: slightly rename four functions, for aptness and variety
parent
62ebd935
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/browser.c
+4
-4
src/browser.c
src/global.c
+28
-28
src/global.c
src/help.c
+4
-4
src/help.c
src/move.c
+4
-4
src/move.c
src/proto.h
+4
-4
src/proto.h
with
44 additions
and
44 deletions
+44
-44
src/browser.c
View file @
f9ebf038
...
...
@@ -219,9 +219,9 @@ char *do_browser(char *path)
width
+
filelist_len
-
width
;
else
selected
+=
editwinrows
*
width
;
}
else
if
(
func
==
d
o_first_file
)
{
}
else
if
(
func
==
t
o_first_file
)
{
selected
=
0
;
}
else
if
(
func
==
d
o_last_file
)
{
}
else
if
(
func
==
t
o_last_file
)
{
selected
=
filelist_len
-
1
;
}
else
if
(
func
==
goto_dir_void
)
{
/* Ask for the directory to go to. */
...
...
@@ -785,13 +785,13 @@ void do_fileresearch(bool forwards)
}
/* Select the first file in the list. */
void
d
o_first_file
(
void
)
void
t
o_first_file
(
void
)
{
selected
=
0
;
}
/* Select the last file in the list. */
void
d
o_last_file
(
void
)
void
t
o_last_file
(
void
)
{
selected
=
filelist_len
-
1
;
}
...
...
This diff is collapsed.
Click to expand it.
src/global.c
View file @
f9ebf038
...
...
@@ -895,9 +895,9 @@ void shortcut_init(void)
add_to_funcs
(
do_page_down
,
MMAIN
|
MHELP
,
nextpage_tag
,
WITHORSANS
(
nextpage_gist
),
TOGETHER
,
VIEW
);
add_to_funcs
(
d
o_first_line
,
MMAIN
|
MHELP
|
MWHEREIS
|
MREPLACE
|
MREPLACEWITH
|
MGOTOLINE
,
add_to_funcs
(
t
o_first_line
,
MMAIN
|
MHELP
|
MWHEREIS
|
MREPLACE
|
MREPLACEWITH
|
MGOTOLINE
,
N_
(
"First Line"
),
WITHORSANS
(
firstline_gist
),
TOGETHER
,
VIEW
);
add_to_funcs
(
d
o_last_line
,
MMAIN
|
MHELP
|
MWHEREIS
|
MREPLACE
|
MREPLACEWITH
|
MGOTOLINE
,
add_to_funcs
(
t
o_last_line
,
MMAIN
|
MHELP
|
MWHEREIS
|
MREPLACE
|
MREPLACEWITH
|
MGOTOLINE
,
N_
(
"Last Line"
),
WITHORSANS
(
lastline_gist
),
BLANKAFTER
,
VIEW
);
#ifdef ENABLE_MULTIBUFFER
...
...
@@ -1053,9 +1053,9 @@ void shortcut_init(void)
add_to_funcs
(
do_page_down
,
MBROWSER
,
nextpage_tag
,
WITHORSANS
(
nextpage_gist
),
TOGETHER
,
VIEW
);
add_to_funcs
(
d
o_first_file
,
MBROWSER
|
MWHEREISFILE
,
add_to_funcs
(
t
o_first_file
,
MBROWSER
|
MWHEREISFILE
,
N_
(
"First File"
),
WITHORSANS
(
firstfile_gist
),
TOGETHER
,
VIEW
);
add_to_funcs
(
d
o_last_file
,
MBROWSER
|
MWHEREISFILE
,
add_to_funcs
(
t
o_last_file
,
MBROWSER
|
MWHEREISFILE
,
N_
(
"Last File"
),
WITHORSANS
(
lastfile_gist
),
BLANKAFTER
,
VIEW
);
#ifndef NANO_TINY
add_to_funcs
(
do_prev_word_void
,
MBROWSER
,
...
...
@@ -1134,12 +1134,12 @@ void shortcut_init(void)
add_to_sclist
(
MMAIN
|
MHELP
|
MBROWSER
|
MLINTER
,
"^V"
,
0
,
do_page_down
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
|
MBROWSER
|
MLINTER
,
"F8"
,
0
,
do_page_down
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
|
MBROWSER
|
MLINTER
,
"PgDn"
,
KEY_NPAGE
,
do_page_down
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
,
"M-
\\
"
,
0
,
d
o_first_line
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
,
"^Home"
,
CONTROL_HOME
,
d
o_first_line
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
,
"M-|"
,
0
,
d
o_first_line
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
,
"M-/"
,
0
,
d
o_last_line
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
,
"^End"
,
CONTROL_END
,
d
o_last_line
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
,
"M-?"
,
0
,
d
o_last_line
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
,
"M-
\\
"
,
0
,
t
o_first_line
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
,
"^Home"
,
CONTROL_HOME
,
t
o_first_line
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
,
"M-|"
,
0
,
t
o_first_line
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
,
"M-/"
,
0
,
t
o_last_line
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
,
"^End"
,
CONTROL_END
,
t
o_last_line
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
,
"M-?"
,
0
,
t
o_last_line
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
|
MBROWSER
,
"M-W"
,
0
,
do_research
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
|
MBROWSER
,
"F16"
,
0
,
do_research
,
0
);
#ifndef NANO_TINY
...
...
@@ -1284,8 +1284,8 @@ void shortcut_init(void)
add_to_sclist
(
MWHEREIS
|
MREPLACE
,
"M-R"
,
0
,
regexp_void
,
0
);
add_to_sclist
(
MWHEREIS
|
MREPLACE
,
"M-B"
,
0
,
backwards_void
,
0
);
add_to_sclist
(
MWHEREIS
|
MREPLACE
,
"^R"
,
0
,
flip_replace
,
0
);
add_to_sclist
(
MWHEREIS
|
MREPLACE
|
MREPLACEWITH
|
MGOTOLINE
|
MFINDINHELP
,
"^Y"
,
0
,
d
o_first_line
,
0
);
add_to_sclist
(
MWHEREIS
|
MREPLACE
|
MREPLACEWITH
|
MGOTOLINE
|
MFINDINHELP
,
"^V"
,
0
,
d
o_last_line
,
0
);
add_to_sclist
(
MWHEREIS
|
MREPLACE
|
MREPLACEWITH
|
MGOTOLINE
|
MFINDINHELP
,
"^Y"
,
0
,
t
o_first_line
,
0
);
add_to_sclist
(
MWHEREIS
|
MREPLACE
|
MREPLACEWITH
|
MGOTOLINE
|
MFINDINHELP
,
"^V"
,
0
,
t
o_last_line
,
0
);
#ifdef ENABLE_JUSTIFY
add_to_sclist
(
MWHEREIS
|
MREPLACE
|
MREPLACEWITH
,
"^W"
,
0
,
do_para_begin_void
,
0
);
add_to_sclist
(
MWHEREIS
|
MREPLACE
|
MREPLACEWITH
,
"^O"
,
0
,
do_para_end_void
,
0
);
...
...
@@ -1307,16 +1307,16 @@ void shortcut_init(void)
}
#endif
#ifdef ENABLE_BROWSER
add_to_sclist
(
MWHEREISFILE
,
"^Y"
,
0
,
d
o_first_file
,
0
);
add_to_sclist
(
MWHEREISFILE
,
"^V"
,
0
,
d
o_last_file
,
0
);
add_to_sclist
(
MBROWSER
|
MWHEREISFILE
,
"M-
\\
"
,
0
,
d
o_first_file
,
0
);
add_to_sclist
(
MBROWSER
|
MWHEREISFILE
,
"M-/"
,
0
,
d
o_last_file
,
0
);
add_to_sclist
(
MBROWSER
,
"Home"
,
KEY_HOME
,
d
o_first_file
,
0
);
add_to_sclist
(
MBROWSER
,
"End"
,
KEY_END
,
d
o_last_file
,
0
);
add_to_sclist
(
MBROWSER
|
MWHEREISFILE
,
"M-|"
,
0
,
d
o_first_file
,
0
);
add_to_sclist
(
MBROWSER
|
MWHEREISFILE
,
"M-?"
,
0
,
d
o_last_file
,
0
);
add_to_sclist
(
MBROWSER
,
"^Home"
,
CONTROL_HOME
,
d
o_first_file
,
0
);
add_to_sclist
(
MBROWSER
,
"^End"
,
CONTROL_END
,
d
o_last_file
,
0
);
add_to_sclist
(
MWHEREISFILE
,
"^Y"
,
0
,
t
o_first_file
,
0
);
add_to_sclist
(
MWHEREISFILE
,
"^V"
,
0
,
t
o_last_file
,
0
);
add_to_sclist
(
MBROWSER
|
MWHEREISFILE
,
"M-
\\
"
,
0
,
t
o_first_file
,
0
);
add_to_sclist
(
MBROWSER
|
MWHEREISFILE
,
"M-/"
,
0
,
t
o_last_file
,
0
);
add_to_sclist
(
MBROWSER
,
"Home"
,
KEY_HOME
,
t
o_first_file
,
0
);
add_to_sclist
(
MBROWSER
,
"End"
,
KEY_END
,
t
o_last_file
,
0
);
add_to_sclist
(
MBROWSER
|
MWHEREISFILE
,
"M-|"
,
0
,
t
o_first_file
,
0
);
add_to_sclist
(
MBROWSER
|
MWHEREISFILE
,
"M-?"
,
0
,
t
o_last_file
,
0
);
add_to_sclist
(
MBROWSER
,
"^Home"
,
CONTROL_HOME
,
t
o_first_file
,
0
);
add_to_sclist
(
MBROWSER
,
"^End"
,
CONTROL_END
,
t
o_last_file
,
0
);
add_to_sclist
(
MBROWSER
,
"^_"
,
0
,
goto_dir_void
,
0
);
add_to_sclist
(
MBROWSER
,
"M-G"
,
0
,
goto_dir_void
,
0
);
add_to_sclist
(
MBROWSER
,
"F13"
,
0
,
goto_dir_void
,
0
);
...
...
@@ -1353,8 +1353,8 @@ void shortcut_init(void)
#ifdef ENABLE_HELP
add_to_sclist
(
MHELP
,
"^G"
,
0
,
do_exit
,
0
);
add_to_sclist
(
MHELP
,
"F1"
,
0
,
do_exit
,
0
);
add_to_sclist
(
MHELP
,
"Home"
,
KEY_HOME
,
d
o_first_line
,
0
);
add_to_sclist
(
MHELP
,
"End"
,
KEY_END
,
d
o_last_line
,
0
);
add_to_sclist
(
MHELP
,
"Home"
,
KEY_HOME
,
t
o_first_line
,
0
);
add_to_sclist
(
MHELP
,
"End"
,
KEY_END
,
t
o_last_line
,
0
);
#endif
#ifdef DEBUG
...
...
@@ -1591,9 +1591,9 @@ sc *strtosc(const char *input)
!
strcasecmp
(
input
,
"nextpage"
))
s
->
scfunc
=
do_page_down
;
else
if
(
!
strcasecmp
(
input
,
"firstline"
))
s
->
scfunc
=
d
o_first_line
;
s
->
scfunc
=
t
o_first_line
;
else
if
(
!
strcasecmp
(
input
,
"lastline"
))
s
->
scfunc
=
d
o_last_line
;
s
->
scfunc
=
t
o_last_line
;
#ifdef ENABLE_MULTIBUFFER
else
if
(
!
strcasecmp
(
input
,
"prevbuf"
))
s
->
scfunc
=
switch_to_prev_buffer
;
...
...
@@ -1658,9 +1658,9 @@ sc *strtosc(const char *input)
else
if
(
!
strcasecmp
(
input
,
"gotodir"
))
s
->
scfunc
=
goto_dir_void
;
else
if
(
!
strcasecmp
(
input
,
"firstfile"
))
s
->
scfunc
=
d
o_first_file
;
s
->
scfunc
=
t
o_first_file
;
else
if
(
!
strcasecmp
(
input
,
"lastfile"
))
s
->
scfunc
=
d
o_last_file
;
s
->
scfunc
=
t
o_last_file
;
#endif
else
{
#ifndef NANO_TINY
...
...
This diff is collapsed.
Click to expand it.
src/help.c
View file @
f9ebf038
...
...
@@ -201,10 +201,10 @@ void do_help(void)
do_page_up
();
}
else
if
(
func
==
do_page_down
)
{
do_page_down
();
}
else
if
(
func
==
d
o_first_line
)
{
d
o_first_line
();
}
else
if
(
func
==
d
o_last_line
)
{
d
o_last_line
();
}
else
if
(
func
==
t
o_first_line
)
{
t
o_first_line
();
}
else
if
(
func
==
t
o_last_line
)
{
t
o_last_line
();
}
else
if
(
func
==
do_search_forward
)
{
do_search
();
bottombars
(
MHELP
);
...
...
This diff is collapsed.
Click to expand it.
src/move.c
View file @
f9ebf038
...
...
@@ -24,7 +24,7 @@
#include <string.h>
/* Move to the first line of the file. */
void
d
o_first_line
(
void
)
void
t
o_first_line
(
void
)
{
openfile
->
current
=
openfile
->
fileage
;
openfile
->
current_x
=
0
;
...
...
@@ -34,7 +34,7 @@ void do_first_line(void)
}
/* Move to the last line of the file. */
void
d
o_last_line
(
void
)
void
t
o_last_line
(
void
)
{
openfile
->
current
=
openfile
->
filebot
;
openfile
->
current_x
=
strlen
(
openfile
->
filebot
->
data
);
...
...
@@ -128,7 +128,7 @@ void do_page_up(void)
/* Move up the required number of lines or chunks. If we can't, we're
* at the top of the file, so put the cursor there and get out. */
if
(
go_back_chunks
(
mustmove
,
&
openfile
->
current
,
&
leftedge
)
>
0
)
{
d
o_first_line
();
t
o_first_line
();
return
;
}
...
...
@@ -158,7 +158,7 @@ void do_page_down(void)
/* Move down the required number of lines or chunks. If we can't, we're
* at the bottom of the file, so put the cursor there and get out. */
if
(
go_forward_chunks
(
mustmove
,
&
openfile
->
current
,
&
leftedge
)
>
0
)
{
d
o_last_line
();
t
o_last_line
();
return
;
}
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
f9ebf038
...
...
@@ -189,8 +189,8 @@ void browser_refresh(void);
void
browser_select_dirname
(
const
char
*
needle
);
void
do_filesearch
(
void
);
void
do_fileresearch
(
bool
forwards
);
void
d
o_first_file
(
void
);
void
d
o_last_file
(
void
);
void
t
o_first_file
(
void
);
void
t
o_last_file
(
void
);
char
*
strip_last_component
(
const
char
*
path
);
#endif
...
...
@@ -366,8 +366,8 @@ bool has_old_position(const char *file, ssize_t *line, ssize_t *column);
#endif
/* Most functions in move.c. */
void
d
o_first_line
(
void
);
void
d
o_last_line
(
void
);
void
t
o_first_line
(
void
);
void
t
o_last_line
(
void
);
void
do_page_up
(
void
);
void
do_page_down
(
void
);
#ifdef ENABLE_JUSTIFY
...
...
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