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
a4044a7e
Commit
a4044a7e
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: remove some cluttering conditional compilation
parent
2fa93ae9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/move.c
+7
-24
src/move.c
with
7 additions
and
24 deletions
+7
-24
src/move.c
View file @
a4044a7e
...
...
@@ -56,10 +56,7 @@ void do_page_up(void)
/* If the cursor is less than a page away from the top of the file,
* put it at the beginning of the first line. */
if
(
openfile
->
current
->
lineno
==
1
||
(
#ifndef NANO_TINY
!
ISSET
(
SOFTWRAP
)
&&
#endif
if
(
openfile
->
current
->
lineno
==
1
||
(
!
ISSET
(
SOFTWRAP
)
&&
openfile
->
current
->
lineno
<=
editwinrows
-
2
))
{
do_first_line
();
return
;
...
...
@@ -67,10 +64,7 @@ void do_page_up(void)
/* If we're not in smooth scrolling mode, put the cursor at the
* beginning of the top line of the edit window, as Pico does. */
#ifndef NANO_TINY
if
(
!
ISSET
(
SMOOTH_SCROLL
))
#endif
{
if
(
!
ISSET
(
SMOOTH_SCROLL
))
{
openfile
->
current
=
openfile
->
edittop
;
openfile
->
placewewant
=
openfile
->
current_y
=
0
;
}
...
...
@@ -83,7 +77,7 @@ void do_page_up(void)
if
(
ISSET
(
SOFTWRAP
)
&&
openfile
->
current
)
{
skipped
+=
strlenpt
(
openfile
->
current
->
data
)
/
editwincols
;
#ifdef DEBUG
fprintf
(
stderr
,
"
do_page_
up: i = %d, skipped = %d based on line %ld len %lu
\n
"
,
fprintf
(
stderr
,
"
paging
up: i = %d, skipped = %d based on line %ld len %lu
\n
"
,
i
,
skipped
,
(
long
)
openfile
->
current
->
lineno
,
(
unsigned
long
)
strlenpt
(
openfile
->
current
->
data
));
#endif
}
...
...
@@ -93,11 +87,6 @@ void do_page_up(void)
openfile
->
current_x
=
actual_x
(
openfile
->
current
->
data
,
openfile
->
placewewant
);
#ifdef DEBUG
fprintf
(
stderr
,
"do_page_up: openfile->current->lineno = %lu, skipped = %d
\n
"
,
(
unsigned
long
)
openfile
->
current
->
lineno
,
skipped
);
#endif
/* Scroll the edit window up a page. */
adjust_viewport
(
STATIONARY
);
refresh_needed
=
TRUE
;
...
...
@@ -117,10 +106,7 @@ void do_page_down(void)
/* If we're not in smooth scrolling mode, put the cursor at the
* beginning of the top line of the edit window, as Pico does. */
#ifndef NANO_TINY
if
(
!
ISSET
(
SMOOTH_SCROLL
))
#endif
{
if
(
!
ISSET
(
SMOOTH_SCROLL
))
{
openfile
->
current
=
openfile
->
edittop
;
openfile
->
placewewant
=
openfile
->
current_y
=
0
;
}
...
...
@@ -130,7 +116,7 @@ void do_page_down(void)
for
(
i
=
mustmove
;
i
>
0
&&
openfile
->
current
!=
openfile
->
filebot
;
i
--
)
{
openfile
->
current
=
openfile
->
current
->
next
;
#ifdef DEBUG
fprintf
(
stderr
,
"
do_page_
down: moving to line %lu
\n
"
,
(
unsigned
long
)
openfile
->
current
->
lineno
);
fprintf
(
stderr
,
"
paging
down: moving to line %lu
\n
"
,
(
unsigned
long
)
openfile
->
current
->
lineno
);
#endif
}
...
...
@@ -424,11 +410,8 @@ void do_up(bool scroll_only)
/* If we're at the top of the file, or if scroll_only is TRUE and
* the top of the file is onscreen, get out. */
if
(
openfile
->
current
==
openfile
->
fileage
#ifndef NANO_TINY
||
(
scroll_only
&&
openfile
->
edittop
==
openfile
->
fileage
)
#endif
)
if
(
openfile
->
current
==
openfile
->
fileage
||
(
scroll_only
&&
openfile
->
edittop
==
openfile
->
fileage
))
return
;
assert
(
ISSET
(
SOFTWRAP
)
||
openfile
->
current_y
==
openfile
->
current
->
lineno
-
openfile
->
edittop
->
lineno
);
...
...
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