aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraltermo <107814000+altermo@users.noreply.github.com>2024-03-04 12:08:23 +0100
committerGitHub <noreply@github.com>2024-03-04 19:08:23 +0800
commita8131aee9ecc640415903d590b15863ce1c99112 (patch)
treef7eb08232faf21903db4ea465e380087e24b8475
parent3df1211ebc4c7ec4562d0ad0fa51a24569b81e15 (diff)
downloadrneovim-a8131aee9ecc640415903d590b15863ce1c99112.tar.gz
rneovim-a8131aee9ecc640415903d590b15863ce1c99112.tar.bz2
rneovim-a8131aee9ecc640415903d590b15863ce1c99112.zip
fix(tohtml): replace hex escape with digit escape (#27728)
-rw-r--r--runtime/lua/tohtml.lua4
-rw-r--r--test/functional/plugin/tohtml_spec.lua2
2 files changed, 4 insertions, 2 deletions
diff --git a/runtime/lua/tohtml.lua b/runtime/lua/tohtml.lua
index 52e0742ef3..d15412edee 100644
--- a/runtime/lua/tohtml.lua
+++ b/runtime/lua/tohtml.lua
@@ -906,7 +906,9 @@ local function styletable_listchars(state)
if listchars.nbsp then
for _, match in
- ipairs(vim.fn.matchbufline(state.bufnr, '\xe2\x80\xaf\\|\xa0', 1, '$') --[[@as (table[])]])
+ ipairs(
+ vim.fn.matchbufline(state.bufnr, '\226\128\175\\|\194\160', 1, '$') --[[@as (table[])]]
+ )
do
style_line_insert_overlay_char(
state.style[match.lnum],
diff --git a/test/functional/plugin/tohtml_spec.lua b/test/functional/plugin/tohtml_spec.lua
index 66dcfde3aa..0d0f10671f 100644
--- a/test/functional/plugin/tohtml_spec.lua
+++ b/test/functional/plugin/tohtml_spec.lua
@@ -315,7 +315,7 @@ describe(':TOhtml', function()
fn.setline(1, '\tfoo\t')
fn.setline(2, ' foo foo ')
fn.setline(3, ' foo foo ')
- fn.setline(4, 'foo\x2cfoo')
+ fn.setline(4, 'foo\194\160 \226\128\175foo')
run_tohtml_and_assert(screen)
exec('new|only')
fn.setline(1, '\tfoo\t')