Cleanup expand_unprintable and avoid calling iswprint on base ascii
This commit is contained in:
parent
93c50b3cd9
commit
a52bb9146e
|
@ -1329,14 +1329,15 @@ void expand_unprintable(HighlightContext context, DisplayBuffer& display_buffer,
|
||||||
{
|
{
|
||||||
for (auto atom_it = line.begin(); atom_it != line.end(); ++atom_it)
|
for (auto atom_it = line.begin(); atom_it != line.end(); ++atom_it)
|
||||||
{
|
{
|
||||||
if (atom_it->type() == DisplayAtom::Range)
|
if (atom_it->type() != DisplayAtom::Range)
|
||||||
{
|
continue;
|
||||||
|
|
||||||
for (auto it = get_iterator(buffer, atom_it->begin()),
|
for (auto it = get_iterator(buffer, atom_it->begin()),
|
||||||
end = get_iterator(buffer, atom_it->end()); it < end;)
|
end = get_iterator(buffer, atom_it->end()); it < end;)
|
||||||
{
|
{
|
||||||
auto coord = it.coord();
|
auto coord = it.coord();
|
||||||
Codepoint cp = utf8::read_codepoint(it, end);
|
Codepoint cp = utf8::read_codepoint(it, end);
|
||||||
if (cp != '\n' and not iswprint((wchar_t)cp))
|
if (cp != '\n' and (cp < ' ' or cp > '~') and not iswprint((wchar_t)cp))
|
||||||
{
|
{
|
||||||
if (coord != atom_it->begin())
|
if (coord != atom_it->begin())
|
||||||
atom_it = ++line.split(atom_it, coord);
|
atom_it = ++line.split(atom_it, coord);
|
||||||
|
@ -1351,7 +1352,6 @@ void expand_unprintable(HighlightContext context, DisplayBuffer& display_buffer,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void update_line_specs_ifn(const Buffer& buffer, LineAndSpecList& line_flags)
|
static void update_line_specs_ifn(const Buffer& buffer, LineAndSpecList& line_flags)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user