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
a4a32b91
Commit
a4a32b91
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: reshuffle a couple of lines, and trim some comments
parent
28cfab75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/move.c
+15
-19
src/move.c
with
15 additions
and
19 deletions
+15
-19
src/move.c
View file @
a4a32b91
...
@@ -119,9 +119,8 @@ void do_page_up(void)
...
@@ -119,9 +119,8 @@ void do_page_up(void)
* beginning of the top line of the edit window, as Pico does. */
* beginning of the top line of the edit window, as Pico does. */
if
(
!
ISSET
(
SMOOTH_SCROLL
))
{
if
(
!
ISSET
(
SMOOTH_SCROLL
))
{
openfile
->
current
=
openfile
->
edittop
;
openfile
->
current
=
openfile
->
edittop
;
openfile
->
current_y
=
0
;
leftedge
=
openfile
->
firstcolumn
;
leftedge
=
openfile
->
firstcolumn
;
openfile
->
current_y
=
0
;
target_column
=
0
;
target_column
=
0
;
}
else
}
else
get_edge_and_target
(
&
leftedge
,
&
target_column
);
get_edge_and_target
(
&
leftedge
,
&
target_column
);
...
@@ -150,9 +149,8 @@ void do_page_down(void)
...
@@ -150,9 +149,8 @@ void do_page_down(void)
* beginning of the top line of the edit window, as Pico does. */
* beginning of the top line of the edit window, as Pico does. */
if
(
!
ISSET
(
SMOOTH_SCROLL
))
{
if
(
!
ISSET
(
SMOOTH_SCROLL
))
{
openfile
->
current
=
openfile
->
edittop
;
openfile
->
current
=
openfile
->
edittop
;
openfile
->
current_y
=
0
;
leftedge
=
openfile
->
firstcolumn
;
leftedge
=
openfile
->
firstcolumn
;
openfile
->
current_y
=
0
;
target_column
=
0
;
target_column
=
0
;
}
else
}
else
get_edge_and_target
(
&
leftedge
,
&
target_column
);
get_edge_and_target
(
&
leftedge
,
&
target_column
);
...
@@ -178,11 +176,11 @@ void do_para_begin(bool update_screen)
...
@@ -178,11 +176,11 @@ void do_para_begin(bool update_screen)
{
{
filestruct
*
was_current
=
openfile
->
current
;
filestruct
*
was_current
=
openfile
->
current
;
if
(
openfile
->
current
!=
openfile
->
fileage
)
{
if
(
openfile
->
current
!=
openfile
->
fileage
)
d
o
o
penfile
->
current
=
openfile
->
current
->
prev
;
openfile
->
current
=
openfile
->
current
->
prev
;
while
(
!
begpar
(
openfile
->
current
))
;
while
(
!
begpar
(
openfile
->
current
))
}
openfile
->
current
=
openfile
->
current
->
prev
;
openfile
->
current_x
=
0
;
openfile
->
current_x
=
0
;
...
@@ -233,7 +231,7 @@ void do_para_end_void(void)
...
@@ -233,7 +231,7 @@ void do_para_end_void(void)
}
}
#endif
/* !DISABLE_JUSTIFY */
#endif
/* !DISABLE_JUSTIFY */
/* Move to the preceding block of text
in the file
. */
/* Move to the preceding block of text. */
void
do_prev_block
(
void
)
void
do_prev_block
(
void
)
{
{
filestruct
*
was_current
=
openfile
->
current
;
filestruct
*
was_current
=
openfile
->
current
;
...
@@ -255,7 +253,7 @@ void do_prev_block(void)
...
@@ -255,7 +253,7 @@ void do_prev_block(void)
edit_redraw
(
was_current
,
CENTERING
);
edit_redraw
(
was_current
,
CENTERING
);
}
}
/* Move to the next block of text
in the file
. */
/* Move to the next block of text. */
void
do_next_block
(
void
)
void
do_next_block
(
void
)
{
{
filestruct
*
was_current
=
openfile
->
current
;
filestruct
*
was_current
=
openfile
->
current
;
...
@@ -273,9 +271,8 @@ void do_next_block(void)
...
@@ -273,9 +271,8 @@ void do_next_block(void)
edit_redraw
(
was_current
,
CENTERING
);
edit_redraw
(
was_current
,
CENTERING
);
}
}
/* Move to the previous word in the file. If allow_punct is TRUE, treat
/* Move to the previous word. If allow_punct is TRUE, treat punctuation
* punctuation as part of a word. If update_screen is TRUE, update the
* as part of a word. When requested, update the screen afterwards. */
* screen afterwards. */
void
do_prev_word
(
bool
allow_punct
,
bool
update_screen
)
void
do_prev_word
(
bool
allow_punct
,
bool
update_screen
)
{
{
filestruct
*
was_current
=
openfile
->
current
;
filestruct
*
was_current
=
openfile
->
current
;
...
@@ -317,10 +314,9 @@ void do_prev_word(bool allow_punct, bool update_screen)
...
@@ -317,10 +314,9 @@ void do_prev_word(bool allow_punct, bool update_screen)
edit_redraw
(
was_current
,
FLOWING
);
edit_redraw
(
was_current
,
FLOWING
);
}
}
/* Move to the next word in the file. If allow_punct is TRUE, treat
/* Move to the next word. If allow_punct is TRUE, treat punctuation
* punctuation as part of a word. If update_screen is TRUE, update the
* as part of a word. When requested, update the screen afterwards.
* screen afterwards. Return TRUE if we started on a word, and FALSE
* Return TRUE if we started on a word, and FALSE otherwise. */
* otherwise. */
bool
do_next_word
(
bool
allow_punct
,
bool
update_screen
)
bool
do_next_word
(
bool
allow_punct
,
bool
update_screen
)
{
{
filestruct
*
was_current
=
openfile
->
current
;
filestruct
*
was_current
=
openfile
->
current
;
...
@@ -332,7 +328,7 @@ bool do_next_word(bool allow_punct, bool update_screen)
...
@@ -332,7 +328,7 @@ bool do_next_word(bool allow_punct, bool update_screen)
while
(
TRUE
)
{
while
(
TRUE
)
{
/* If at the end of a line, move to the beginning of the next one. */
/* If at the end of a line, move to the beginning of the next one. */
if
(
openfile
->
current
->
data
[
openfile
->
current_x
]
==
'\0'
)
{
if
(
openfile
->
current
->
data
[
openfile
->
current_x
]
==
'\0'
)
{
/*
If at the
end of
the
file, stop. */
/*
When at
end of file, stop. */
if
(
openfile
->
current
->
next
==
NULL
)
if
(
openfile
->
current
->
next
==
NULL
)
break
;
break
;
openfile
->
current
=
openfile
->
current
->
next
;
openfile
->
current
=
openfile
->
current
->
next
;
...
...
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