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
21d9bd11
Commit
21d9bd11
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename some variables to be more readable
parent
5864d975
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/winio.c
+21
-22
src/winio.c
with
21 additions
and
22 deletions
+21
-22
src/winio.c
View file @
21d9bd11
...
...
@@ -1792,18 +1792,17 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
if
(
is_cntrl_mbchar
(
buf_mb
))
{
if
(
column
<
start_col
)
{
char
*
c
trl_buf_mb
=
charalloc
(
mb_cur_max
());
int
c
trl_buf_mb_
len
,
i
;
char
*
c
haracter
=
charalloc
(
mb_cur_max
());
int
c
har
len
,
i
;
ctrl_buf_mb
=
control_mbrep
(
buf_mb
,
ctrl_buf_mb
,
&
ctrl_buf_mb_len
);
character
=
control_mbrep
(
buf_mb
,
character
,
&
charlen
);
for
(
i
=
0
;
i
<
c
trl_buf_mb_
len
;
i
++
)
converted
[
index
++
]
=
c
trl_buf_mb
[
i
];
for
(
i
=
0
;
i
<
c
har
len
;
i
++
)
converted
[
index
++
]
=
c
haracter
[
i
];
start_col
+=
mbwidth
(
c
trl_buf_mb
);
start_col
+=
mbwidth
(
c
haracter
);
free
(
c
trl_buf_mb
);
free
(
c
haracter
);
start_index
+=
buf_mb_len
;
}
...
...
@@ -1868,25 +1867,25 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
}
/* If buf contains a control character, interpret it. */
}
else
if
(
is_cntrl_mbchar
(
buf_mb
))
{
char
*
c
trl_buf_mb
=
charalloc
(
mb_cur_max
());
int
c
trl_buf_mb_
len
,
i
;
char
*
c
haracter
=
charalloc
(
mb_cur_max
());
int
c
har
len
,
i
;
converted
[
index
++
]
=
'^'
;
start_col
++
;
c
trl_buf_mb
=
control_mbrep
(
buf_mb
,
c
trl_buf_mb
,
&
ctrl_buf_mb_
len
);
c
haracter
=
control_mbrep
(
buf_mb
,
c
haracter
,
&
char
len
);
for
(
i
=
0
;
i
<
c
trl_buf_mb_
len
;
i
++
)
converted
[
index
++
]
=
c
trl_buf_mb
[
i
];
for
(
i
=
0
;
i
<
c
har
len
;
i
++
)
converted
[
index
++
]
=
c
haracter
[
i
];
start_col
+=
mbwidth
(
c
trl_buf_mb
);
start_col
+=
mbwidth
(
c
haracter
);
free
(
c
trl_buf_mb
);
free
(
c
haracter
);
/* If buf contains a non-control character, interpret it. If buf
* contains an invalid multibyte sequence, display it as such. */
}
else
{
char
*
nctrl_buf_mb
=
charalloc
(
mb_cur_max
());
int
nctrl_buf_mb_
len
,
i
;
char
*
character
=
charalloc
(
mb_cur_max
());
int
char
len
,
i
;
#ifdef ENABLE_UTF8
/* Make sure an invalid sequence-starter byte is properly
...
...
@@ -1895,14 +1894,14 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
if
(
using_utf8
()
&&
buf_mb_len
==
1
)
buf_mb
[
1
]
=
'\0'
;
#endif
nctrl_buf_mb
=
mbrep
(
buf_mb
,
nctrl_buf_mb
,
&
nctrl_buf_mb_
len
);
character
=
mbrep
(
buf_mb
,
character
,
&
char
len
);
for
(
i
=
0
;
i
<
nctrl_buf_mb_
len
;
i
++
)
converted
[
index
++
]
=
nctrl_buf_mb
[
i
];
for
(
i
=
0
;
i
<
char
len
;
i
++
)
converted
[
index
++
]
=
character
[
i
];
start_col
+=
mbwidth
(
nctrl_buf_mb
);
start_col
+=
mbwidth
(
character
);
free
(
nctrl_buf_mb
);
free
(
character
);
}
start_index
+=
buf_mb_len
;
...
...
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