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
0bffd99d
Commit
0bffd99d
authored
9 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
scrolling: elide a variable, to make clearer that edittop is being moved
parent
4c075f37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/winio.c
+9
-10
src/winio.c
with
9 additions
and
10 deletions
+9
-10
src/winio.c
View file @
0bffd99d
...
...
@@ -3032,8 +3032,7 @@ void edit_refresh(void)
* more than needed to bring current into view. */
void
edit_update
(
update_type
manner
)
{
filestruct
*
foo
=
openfile
->
current
;
int
goal
;
int
goal
=
0
;
/* If manner is CENTERING, move edittop half the number of window
* lines back from current. If manner is STATIONARY, move edittop
...
...
@@ -3047,9 +3046,7 @@ void edit_update(update_type manner)
if
(
manner
==
CENTERING
)
goal
=
editwinrows
/
2
;
else
if
(
manner
==
FLOWING
)
{
if
(
openfile
->
current
->
lineno
<
openfile
->
edittop
->
lineno
)
goal
=
0
;
else
if
(
openfile
->
current
->
lineno
>=
openfile
->
edittop
->
lineno
)
goal
=
editwinrows
-
1
;
}
else
{
goal
=
openfile
->
current_y
;
...
...
@@ -3059,14 +3056,16 @@ void edit_update(update_type manner)
goal
=
editwinrows
-
1
;
}
for
(;
goal
>
0
&&
foo
->
prev
!=
NULL
;
goal
--
)
{
foo
=
foo
->
prev
;
openfile
->
edittop
=
openfile
->
current
;
while
(
goal
>
0
&&
openfile
->
edittop
->
prev
!=
NULL
)
{
openfile
->
edittop
=
openfile
->
edittop
->
prev
;
goal
--
;
#ifndef NANO_TINY
if
(
ISSET
(
SOFTWRAP
)
&&
foo
)
goal
-=
strlenpt
(
foo
->
data
)
/
COLS
;
if
(
ISSET
(
SOFTWRAP
))
goal
-=
strlenpt
(
openfile
->
edittop
->
data
)
/
COLS
;
#endif
}
openfile
->
edittop
=
foo
;
#ifdef DEBUG
fprintf
(
stderr
,
"edit_update(): setting edittop to lineno %ld
\n
"
,
(
long
)
openfile
->
edittop
->
lineno
);
#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