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
c30d3d80
Commit
c30d3d80
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
wrapping: delete trailing blanks upon hardwrapping, when requested
This fulfills
https://savannah.gnu.org/bugs/?52198
.
parent
0c40f87b
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/text.c
+15
-2
src/text.c
with
15 additions
and
2 deletions
+15
-2
src/text.c
View file @
c30d3d80
...
...
@@ -1613,7 +1613,7 @@ bool do_wrap(filestruct *line)
openfile
->
current_x
=
line_len
;
/* If the remainder doesn't end in a blank, add a space. */
if
(
!
is_blank_mbchar
(
tail
)
&&
!
ISSET
(
JUSTIFY_TRIM
)
)
{
if
(
!
is_blank_mbchar
(
tail
))
{
#ifndef NANO_TINY
add_undo
(
ADD
);
#endif
...
...
@@ -1638,8 +1638,21 @@ bool do_wrap(filestruct *line)
}
}
/* Go to the wrap location
and split the line there
. */
/* Go to the wrap location. */
openfile
->
current_x
=
wrap_loc
;
/* When requested, snip trailing blanks off the wrapped line. */
if
(
ISSET
(
JUSTIFY_TRIM
))
{
size_t
cur_x
=
move_mbleft
(
line
->
data
,
wrap_loc
);
while
(
is_blank_mbchar
(
line
->
data
+
cur_x
))
{
openfile
->
current_x
=
cur_x
;
do_delete
();
cur_x
=
move_mbleft
(
line
->
data
,
cur_x
);
}
}
/* Now split the line. */
do_enter
();
if
(
old_x
<
wrap_loc
)
{
...
...
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