From ba344be51f1d1862d20773a88f7bffd8aece45d2 Mon Sep 17 00:00:00 2001 From: nojhan Date: Wed, 31 Mar 2021 15:28:23 +0200 Subject: [PATCH] fix show-whitespace: add missing NNBSP character - Add the Narrow No-Break SPace (0x202F, NNBSP) to the list of handled spaces in the show-whitespace highlighter. - Do not add an aditional option, just handle it like NBSP, with the same highlight character. --- src/highlighters.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index 1768742d..448427ec 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -1049,7 +1049,7 @@ private: { auto coord = it.coord(); Codepoint cp = utf8::read_codepoint(it, end); - if (cp == '\t' or cp == ' ' or cp == '\n' or cp == 0xA0) + if (cp == '\t' or cp == ' ' or cp == '\n' or cp == 0xA0 or cp == 0x202F) { if (coord != begin.coord()) atom_it = ++line.split(atom_it, coord); @@ -1067,7 +1067,7 @@ private: atom_it->replace(m_spc); else if (cp == '\n') atom_it->replace(m_lf); - else if (cp == 0xA0) + else if (cp == 0xA0 or cp == 0x202F) atom_it->replace(m_nbsp); atom_it->face = merge_faces(atom_it->face, whitespaceface); break;