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
644fedcb
Commit
644fedcb
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: reshuffle some more lines and improve four comments
parent
da3a015f
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/move.c
+16
-16
src/move.c
with
16 additions
and
16 deletions
+16
-16
src/move.c
View file @
644fedcb
...
...
@@ -49,7 +49,7 @@ void do_last_line(void)
focusing
=
FALSE
;
}
/* Move up
one page
. */
/* Move up
nearly one screenful
. */
void
do_page_up
(
void
)
{
int
mustmove
=
(
editwinrows
<
3
)
?
1
:
editwinrows
-
2
;
...
...
@@ -87,7 +87,7 @@ void do_page_up(void)
refresh_needed
=
TRUE
;
}
/* Move down
one page
. */
/* Move down
nearly one screenful
. */
void
do_page_down
(
void
)
{
int
mustmove
=
(
editwinrows
<
3
)
?
1
:
editwinrows
-
2
;
...
...
@@ -451,10 +451,9 @@ void do_end_void(void)
* also scroll the screen one row, so the cursor stays in the same spot. */
void
do_up
(
bool
scroll_only
)
{
size_t
was_column
=
xplustabs
();
filestruct
*
was_current
=
openfile
->
current
;
size_t
leftedge
=
0
;
size_t
target_column
=
openfile
->
placewewant
;
size_t
was_column
=
xplustabs
()
;
size_t
leftedge
=
0
,
target_column
;
/* When just scrolling and the top of the file is onscreen, get out. */
if
(
scroll_only
&&
openfile
->
edittop
==
openfile
->
fileage
&&
...
...
@@ -470,16 +469,17 @@ void do_up(bool scroll_only)
leftedge
=
(
realspan
/
editwincols
)
*
editwincols
;
target_column
=
openfile
->
placewewant
%
editwincols
;
}
}
else
#endif
target_column
=
openfile
->
placewewant
;
/*
M
ove up one line or chunk. */
/*
If we can't m
ove up one line or chunk
, we're at top of file
. */
if
(
go_back_chunks
(
1
,
&
openfile
->
current
,
&
leftedge
)
>
0
)
return
;
openfile
->
current_x
=
actual_x
(
openfile
->
current
->
data
,
leftedge
+
target_column
);
openfile
->
placewewant
=
leftedge
+
target_column
;
openfile
->
current_x
=
actual_x
(
openfile
->
current
->
data
,
openfile
->
placewewant
);
/* When the cursor was on the first line of the edit window (or when just
* scrolling without moving the cursor), scroll the edit window up -- one
...
...
@@ -511,10 +511,9 @@ void do_up_void(void)
* scroll the screen one row, so the cursor stays in the same spot. */
void
do_down
(
bool
scroll_only
)
{
size_t
was_column
=
xplustabs
();
filestruct
*
was_current
=
openfile
->
current
;
size_t
leftedge
=
0
;
size_t
target_column
=
openfile
->
placewewant
;
size_t
was_column
=
xplustabs
()
;
size_t
leftedge
=
0
,
target_column
;
#ifndef NANO_TINY
if
(
ISSET
(
SOFTWRAP
))
{
...
...
@@ -525,16 +524,17 @@ void do_down(bool scroll_only)
leftedge
=
(
realspan
/
editwincols
)
*
editwincols
;
target_column
=
openfile
->
placewewant
%
editwincols
;
}
}
else
#endif
target_column
=
openfile
->
placewewant
;
/*
M
ove down one line or chunk. */
/*
If we can't m
ove down one line or chunk
, we're at bottom of file
. */
if
(
go_forward_chunks
(
1
,
&
openfile
->
current
,
&
leftedge
)
>
0
)
return
;
openfile
->
current_x
=
actual_x
(
openfile
->
current
->
data
,
leftedge
+
target_column
);
openfile
->
placewewant
=
leftedge
+
target_column
;
openfile
->
current_x
=
actual_x
(
openfile
->
current
->
data
,
openfile
->
placewewant
);
/* When the cursor was on the last line of the edit window (or when just
* scrolling without moving the cursor), scroll the edit window down -- one
...
...
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