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
5d5666fb
Commit
5d5666fb
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: swap two blocks of code to reduce the number of #ifdefs
parent
980e334e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/winio.c
+20
-22
src/winio.c
with
20 additions
and
22 deletions
+20
-22
src/winio.c
View file @
5d5666fb
...
...
@@ -2689,28 +2689,7 @@ int update_line(filestruct *fileptr, size_t index)
return
0
;
#ifndef NANO_TINY
if
(
!
ISSET
(
SOFTWRAP
))
{
#endif
/* First, blank out the row. */
blank_row
(
edit
,
row
,
0
,
COLS
);
/* Next, find out from which column to start displaying the line. */
from_col
=
get_page_start
(
strnlenpt
(
fileptr
->
data
,
index
));
/* Expand the line, replacing tabs with spaces, and control
* characters with their displayed forms. */
converted
=
display_string
(
fileptr
->
data
,
from_col
,
editwincols
,
TRUE
);
/* Draw the line. */
edit_draw
(
fileptr
,
converted
,
row
,
from_col
);
free
(
converted
);
if
(
from_col
>
0
)
mvwaddch
(
edit
,
row
,
margin
,
'$'
);
if
(
strlenpt
(
fileptr
->
data
)
>
from_col
+
editwincols
)
mvwaddch
(
edit
,
row
,
COLS
-
1
,
'$'
);
#ifndef NANO_TINY
}
else
{
if
(
ISSET
(
SOFTWRAP
))
{
size_t
full_length
=
strlenpt
(
fileptr
->
data
);
for
(
from_col
=
0
;
from_col
<=
full_length
&&
...
...
@@ -2733,6 +2712,25 @@ int update_line(filestruct *fileptr, size_t index)
}
#endif
/* First, blank out the row. */
blank_row
(
edit
,
row
,
0
,
COLS
);
/* Next, find out from which column to start displaying the line. */
from_col
=
get_page_start
(
strnlenpt
(
fileptr
->
data
,
index
));
/* Expand the line, replacing tabs with spaces, and control
* characters with their displayed forms. */
converted
=
display_string
(
fileptr
->
data
,
from_col
,
editwincols
,
TRUE
);
/* Draw the line. */
edit_draw
(
fileptr
,
converted
,
row
,
from_col
);
free
(
converted
);
if
(
from_col
>
0
)
mvwaddch
(
edit
,
row
,
margin
,
'$'
);
if
(
strlenpt
(
fileptr
->
data
)
>
from_col
+
editwincols
)
mvwaddch
(
edit
,
row
,
COLS
-
1
,
'$'
);
return
0
;
}
...
...
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