Skip to content
GitLab
Menu
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
5237a42d
Commit
5237a42d
authored
7 years ago
by
David Lawrence Ramsey
Committed by
Benno Schulenberg
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
weeding: remove the unused be_clever parameter from do_home()/do_end()
parent
46ccc9ba
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/global.c
+8
-8
src/global.c
src/move.c
+9
-22
src/move.c
src/prompt.c
+2
-2
src/prompt.c
src/proto.h
+2
-4
src/proto.h
src/rcfile.c
+1
-1
src/rcfile.c
with
22 additions
and
37 deletions
+22
-37
src/global.c
View file @
5237a42d
...
...
@@ -842,9 +842,9 @@ void shortcut_init(void)
add_to_funcs
(
do_next_word_void
,
MMAIN
,
N_
(
"Next Word"
),
IFSCHELP
(
nano_nextword_msg
),
TOGETHER
,
VIEW
);
add_to_funcs
(
do_home
_void
,
MMAIN
,
add_to_funcs
(
do_home
,
MMAIN
,
N_
(
"Home"
),
IFSCHELP
(
nano_home_msg
),
TOGETHER
,
VIEW
);
add_to_funcs
(
do_end
_void
,
MMAIN
,
add_to_funcs
(
do_end
,
MMAIN
,
N_
(
"End"
),
IFSCHELP
(
nano_end_msg
),
BLANKAFTER
,
VIEW
);
add_to_funcs
(
do_up_void
,
MMAIN
|
MHELP
|
MBROWSER
,
...
...
@@ -1157,10 +1157,10 @@ void shortcut_init(void)
}
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
&
~
MBROWSER
),
"^A"
,
0
,
do_home
_void
,
0
);
add_to_sclist
((
MMOST
&
~
MBROWSER
),
"Home"
,
KEY_HOME
,
do_home
_void
,
0
);
add_to_sclist
((
MMOST
&
~
MBROWSER
),
"^E"
,
0
,
do_end
_void
,
0
);
add_to_sclist
((
MMOST
&
~
MBROWSER
),
"End"
,
KEY_END
,
do_end
_void
,
0
);
add_to_sclist
((
MMOST
&
~
MBROWSER
),
"^A"
,
0
,
do_home
,
0
);
add_to_sclist
((
MMOST
&
~
MBROWSER
),
"Home"
,
KEY_HOME
,
do_home
,
0
);
add_to_sclist
((
MMOST
&
~
MBROWSER
),
"^E"
,
0
,
do_end
,
0
);
add_to_sclist
((
MMOST
&
~
MBROWSER
),
"End"
,
KEY_END
,
do_end
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
|
MBROWSER
,
"^P"
,
0
,
do_up_void
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
|
MBROWSER
,
"^N"
,
0
,
do_down_void
,
0
);
#ifdef ENABLE_UTF8
...
...
@@ -1548,9 +1548,9 @@ sc *strtosc(const char *input)
else
if
(
!
strcasecmp
(
input
,
"nextword"
))
s
->
scfunc
=
do_next_word_void
;
else
if
(
!
strcasecmp
(
input
,
"home"
))
s
->
scfunc
=
do_home
_void
;
s
->
scfunc
=
do_home
;
else
if
(
!
strcasecmp
(
input
,
"end"
))
s
->
scfunc
=
do_end
_void
;
s
->
scfunc
=
do_end
;
else
if
(
!
strcasecmp
(
input
,
"prevblock"
))
s
->
scfunc
=
do_prev_block
;
else
if
(
!
strcasecmp
(
input
,
"nextblock"
))
...
...
This diff is collapsed.
Click to expand it.
src/move.c
View file @
5237a42d
...
...
@@ -338,10 +338,9 @@ void do_next_word_void(void)
}
/* Move to the beginning of the current line (or softwrapped chunk).
* If be_clever is TRUE, do a smart home when wanted and possible,
* and do a dynamic home when in softwrap mode and it's possible.
* If be_clever is FALSE, just do a simple home. */
void
do_home
(
bool
be_clever
)
* When enabled, do a smart home. When softwrapping, go the beginning
* of the full line when already at the start of a chunk. */
void
do_home
(
void
)
{
filestruct
*
was_current
=
openfile
->
current
;
size_t
was_column
=
xplustabs
();
...
...
@@ -355,7 +354,7 @@ void do_home(bool be_clever)
leftedge_x
=
actual_x
(
openfile
->
current
->
data
,
leftedge
);
}
if
(
ISSET
(
SMART_HOME
)
&&
be_clever
)
{
if
(
ISSET
(
SMART_HOME
))
{
size_t
indent_x
=
indent_length
(
openfile
->
current
->
data
);
if
(
openfile
->
current
->
data
[
indent_x
]
!=
'\0'
)
{
...
...
@@ -375,7 +374,7 @@ void do_home(bool be_clever)
if
(
!
moved
&&
ISSET
(
SOFTWRAP
))
{
/* If already at the left edge of the screen, move fully home.
* Otherwise, move to the left edge. */
if
(
openfile
->
current_x
==
leftedge_x
&&
be_clever
)
if
(
openfile
->
current_x
==
leftedge_x
)
openfile
->
current_x
=
0
;
else
{
openfile
->
current_x
=
leftedge_x
;
...
...
@@ -398,16 +397,10 @@ void do_home(bool be_clever)
update_line
(
openfile
->
current
,
openfile
->
current_x
);
}
/* Do a (smart or dynamic) home. */
void
do_home_void
(
void
)
{
do_home
(
TRUE
);
}
/* Move to the end of the current line (or softwrapped chunk).
*
If be_clever is TRUE, do a dynamic end when in softwrap mode and
*
it's possible. If be_clever is FALSE, just do a simple end
. */
void
do_end
(
bool
be_clever
)
*
When softwrapping and alredy at the end of a chunk, go to the
*
end of the full line
. */
void
do_end
(
void
)
{
filestruct
*
was_current
=
openfile
->
current
;
size_t
was_column
=
xplustabs
();
...
...
@@ -433,7 +426,7 @@ void do_end(bool be_clever)
/* If already at the right edge of the screen, move fully to
* the end of the line. Otherwise, move to the right edge. */
if
(
openfile
->
current_x
==
rightedge_x
&&
be_clever
)
if
(
openfile
->
current_x
==
rightedge_x
)
openfile
->
current_x
=
line_len
;
else
{
openfile
->
current_x
=
rightedge_x
;
...
...
@@ -456,12 +449,6 @@ void do_end(bool be_clever)
update_line
(
openfile
->
current
,
openfile
->
current_x
);
}
/* Do a (dynamic) end. */
void
do_end_void
(
void
)
{
do_end
(
TRUE
);
}
/* Move the cursor to the preceding line or chunk. If scroll_only is TRUE,
* also scroll the screen one row, so the cursor stays in the same spot. */
void
do_up
(
bool
scroll_only
)
...
...
This diff is collapsed.
Click to expand it.
src/prompt.c
View file @
5237a42d
...
...
@@ -122,9 +122,9 @@ int do_statusbar_input(bool *ran_func, bool *finished)
else
if
(
s
->
scfunc
==
do_next_word_void
)
do_statusbar_next_word
();
#endif
else
if
(
s
->
scfunc
==
do_home
_void
)
else
if
(
s
->
scfunc
==
do_home
)
do_statusbar_home
();
else
if
(
s
->
scfunc
==
do_end
_void
)
else
if
(
s
->
scfunc
==
do_end
)
do_statusbar_end
();
/* When in restricted mode at the "Write File" prompt and the
* filename isn't blank, disallow any input and deletion. */
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
5237a42d
...
...
@@ -374,10 +374,8 @@ void do_prev_word(bool allow_punct, bool update_screen);
void
do_prev_word_void
(
void
);
bool
do_next_word
(
bool
allow_punct
,
bool
update_screen
);
void
do_next_word_void
(
void
);
void
do_home
(
bool
be_clever
);
void
do_home_void
(
void
);
void
do_end
(
bool
be_clever
);
void
do_end_void
(
void
);
void
do_home
(
void
);
void
do_end
(
void
);
void
do_up
(
bool
scroll_only
);
void
do_up_void
(
void
);
void
do_down
(
bool
scroll_only
);
...
...
This diff is collapsed.
Click to expand it.
src/rcfile.c
View file @
5237a42d
...
...
@@ -352,7 +352,7 @@ void parse_syntax(char *ptr)
bool
is_universal
(
void
(
*
func
)(
void
))
{
if
(
func
==
do_left
||
func
==
do_right
||
func
==
do_home
_void
||
func
==
do_end
_void
||
func
==
do_home
||
func
==
do_end
||
#ifndef NANO_TINY
func
==
do_prev_word_void
||
func
==
do_next_word_void
||
#endif
...
...
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