diff options
author | bptato <nincsnevem662@gmail.com> | 2022-12-28 00:40:58 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-12-28 00:40:58 +0100 |
commit | 367c95b498fac808fe8c3daf0febb830eaa62706 (patch) | |
tree | 8fc9a9bba6d403542c031f3d3ff83a3c4c68ca3b /src/buffer | |
parent | 79e6de78006c14d08365d86d0179790274edb8f4 (diff) | |
download | chawan-367c95b498fac808fe8c3daf0febb830eaa62706.tar.gz |
buffer/container: fix highlighting width
Diffstat (limited to 'src/buffer')
-rw-r--r-- | src/buffer/container.nim | 4 |
1 files changed, 2 insertions, 2 deletions
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) |