From 367c95b498fac808fe8c3daf0febb830eaa62706 Mon Sep 17 00:00:00 2001 From: bptato Date: Wed, 28 Dec 2022 00:40:58 +0100 Subject: buffer/container: fix highlighting width --- src/buffer/container.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/buffer/container.nim b/src/buffer/container.nim index 8383485b..9963f98e 100644 --- a/src/buffer/container.nim +++ b/src/buffer/container.nim @@ -608,7 +608,7 @@ proc cursorNextMatch*(container: Container, regex: Regex, wrap: bool) {.jsfunc.} container.setCursorXY(res.x, res.y) if container.hlon: container.clearSearchHighlights() - let ex = res.x + res.str.twidth(res.x) - 1 + let ex = res.str.twidth(res.x) - 1 let hl = Highlight(x: res.x, y: res.y, endx: ex, endy: res.y, clear: true) container.highlights.add(hl) container.triggerEvent(UPDATE) @@ -627,7 +627,7 @@ proc cursorPrevMatch*(container: Container, regex: Regex, wrap: bool) {.jsfunc.} container.setCursorXY(res.x, res.y) if container.hlon: container.clearSearchHighlights() - let ex = res.x + res.str.twidth(res.x) - 1 + let ex = res.str.twidth(res.x) - 1 let hl = Highlight(x: res.x, y: res.y, endx: ex, endy: res.y, clear: true) container.highlights.add(hl) container.hlon = false) -- cgit 1.4.1-2-gfad0