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
c8c6340c
Commit
c8c6340c
authored
8 years ago
by
David Lawrence Ramsey
Committed by
Benno Schulenberg
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: conditionalize a bit of softwrap code
This addresses
https://savannah.gnu.org/bugs/?49803
.
parent
62634163
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/winio.c
+18
-18
src/winio.c
with
18 additions
and
18 deletions
+18
-18
src/winio.c
View file @
c8c6340c
...
...
@@ -2804,31 +2804,31 @@ bool need_horizontal_scroll(const size_t old_column, const size_t new_column)
return
(
get_page_start
(
old_column
)
!=
get_page_start
(
new_column
));
}
/* When edittop changes, try and figure out how many lines
*
we really
have to work with
(i.e. set maxrows)
. */
/* When edittop changes, try and figure out how many lines
we really
* have to work with
, accounting for softwrap mode
. */
void
compute_maxrows
(
void
)
{
int
n
;
filestruct
*
foo
=
openfile
->
edittop
;
if
(
!
ISSET
(
SOFTWRAP
))
{
maxrows
=
editwinrows
;
return
;
}
#ifndef NANO_TINY
if
(
ISSET
(
SOFTWRAP
))
{
int
n
;
filestruct
*
foo
=
openfile
->
edittop
;
maxrows
=
0
;
for
(
n
=
0
;
n
<
editwinrows
&&
foo
;
n
++
)
{
maxrows
++
;
n
+=
strlenpt
(
foo
->
data
)
/
editwincols
;
foo
=
foo
->
next
;
}
maxrows
=
0
;
for
(
n
=
0
;
n
<
editwinrows
&&
foo
;
n
++
)
{
maxrows
++
;
n
+=
strlenpt
(
foo
->
data
)
/
editwincols
;
foo
=
foo
->
next
;
}
if
(
n
<
editwinrows
)
maxrows
+=
editwinrows
-
n
;
if
(
n
<
editwinrows
)
maxrows
+=
editwinrows
-
n
;
#ifdef DEBUG
fprintf
(
stderr
,
"compute_maxrows(): maxrows = %d
\n
"
,
maxrows
);
fprintf
(
stderr
,
"compute_maxrows(): maxrows = %d
\n
"
,
maxrows
);
#endif
}
else
#endif
/* !NANO_TINY */
maxrows
=
editwinrows
;
}
/* Scroll the edit window in the given direction and the given number
...
...
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