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
4172268b
Commit
4172268b
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
chars: the representation of control characters is always two columns wide
parent
a9f79a61
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/chars.c
+3
-15
src/chars.c
with
3 additions
and
15 deletions
+3
-15
src/chars.c
View file @
4172268b
...
...
@@ -423,22 +423,10 @@ int parse_mbchar(const char *buf, char *chr, size_t *col)
* current value of col. */
if
(
*
buf
==
'\t'
)
*
col
+=
tabsize
-
*
col
%
tabsize
;
/* If we have a control character, get its width using one
* column for the "^" that will be displayed in front of it,
* and the width in columns of its visible equivalent as
* returned by control_mbrep(). */
/* If we have a control character, it's two columns wide: one
* column for the "^", and one for the visible character. */
else
if
(
is_cntrl_mbchar
(
buf
))
{
char
*
ctrl_buf_mb
=
charalloc
(
MB_CUR_MAX
);
int
ctrl_buf_mb_len
;
(
*
col
)
++
;
ctrl_buf_mb
=
control_mbrep
(
buf
,
ctrl_buf_mb
,
&
ctrl_buf_mb_len
);
*
col
+=
mbwidth
(
ctrl_buf_mb
);
free
(
ctrl_buf_mb
);
*
col
+=
2
;
/* If we have a normal character, get its width in columns
* normally. */
}
else
...
...
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