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
ffa0a9ef
Commit
ffa0a9ef
authored
6 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: calculate the length of a completion word in a more direct way
parent
eef6b2b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/text.c
+4
-7
src/text.c
with
4 additions
and
7 deletions
+4
-7
src/text.c
View file @
ffa0a9ef
...
...
@@ -3041,20 +3041,17 @@ void do_verbatim_input(void)
}
#ifdef ENABLE_WORDCOMPLETION
/*
Copy
the found completion candidate. */
/*
Return a copy of
the found completion candidate. */
char
*
copy_completion
(
char
*
check_line
,
int
start
)
{
char
*
word
;
size_t
position
=
start
,
len_of_word
=
0
,
index
=
0
;
/* Find the length of the word by travelling to its end. */
while
(
is_word_mbchar
(
&
check_line
[
position
],
FALSE
))
{
size_t
next
=
move_mbright
(
check_line
,
position
);
len_of_word
+=
next
-
position
;
position
=
next
;
}
while
(
is_word_mbchar
(
&
check_line
[
position
],
FALSE
))
position
=
move_mbright
(
check_line
,
position
);
len_of_word
=
position
-
start
;
word
=
charalloc
(
len_of_word
+
1
);
/* Simply copy the word. */
...
...
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