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
ac8eb42a
Commit
ac8eb42a
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: elide a superfluous allocation
parent
6c2c6b58
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
+5
-6
src/text.c
with
5 additions
and
6 deletions
+5
-6
src/text.c
View file @
ac8eb42a
...
...
@@ -461,18 +461,16 @@ void handle_indent_action(undo *u, bool undoing, bool add_indent)
/* For each line in the group, add or remove the individual indent. */
while
(
line
&&
line
->
lineno
<=
group
->
bottom_line
)
{
char
*
indentation
=
mallocstrcpy
(
NULL
,
group
->
indentations
[
line
->
lineno
-
group
->
top_line
]);
char
*
blanks
=
group
->
indentations
[
line
->
lineno
-
group
->
top_line
];
if
(
undoing
^
add_indent
)
indent_a_line
(
line
,
indentation
);
indent_a_line
(
line
,
blanks
);
else
unindent_a_line
(
line
,
strlen
(
indentation
));
free
(
indentation
);
unindent_a_line
(
line
,
strlen
(
blanks
));
line
=
line
->
next
;
}
group
=
group
->
next
;
}
...
...
@@ -652,6 +650,7 @@ void handle_comment_action(undo *u, bool undoing, bool add_comment)
COMMENT
:
UNCOMMENT
,
f
,
u
->
strdata
);
f
=
f
->
next
;
}
group
=
group
->
next
;
}
...
...
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