diff options
author | bptato <nincsnevem662@gmail.com> | 2023-10-01 11:18:13 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-10-01 11:36:27 +0200 |
commit | 8cb26e37aad9c4b9b4a719d3a24c4cc8cc4bfc5e (patch) | |
tree | 912103460920b489fba2c774f74bda3aa1479db0 /src | |
parent | 37792c785df6cc09411c19dbe7e2dd50a242755e (diff) | |
download | chawan-8cb26e37aad9c4b9b4a719d3a24c4cc8cc4bfc5e.tar.gz |
container: center column in setCursorXYCenter
Makes searching on long lines work properly.
Diffstat (limited to 'src')
-rw-r--r-- | src/local/container.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/local/container.nim b/src/local/container.nim index 34d4d181..dfa70ee9 100644 --- a/src/local/container.nim +++ b/src/local/container.nim @@ -529,9 +529,12 @@ proc centerColumn(container: Container) {.jsfunc.} = proc setCursorXYCenter(container: Container, x, y: int, refresh = true) {.jsfunc.} = let fy = container.fromy + let fx = container.fromx container.setCursorXY(x, y, refresh) if fy != container.fromy: container.centerLine() + if fx != container.fromx: + container.centerColumn() proc cursorDown(container: Container, n = 1) {.jsfunc.} = if container.select.open: |