about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-12-21 17:58:42 +0100
committerbptato <nincsnevem662@gmail.com>2023-12-21 18:02:44 +0100
commit140e1c494d4fb340c73144656f270e4a4d363698 (patch)
tree320b77bd24853a50346a2636df0028a9ea039db1
parent3563b6e5d67e88dd9f7a261b65d15d9360e979bd (diff)
downloadchawan-140e1c494d4fb340c73144656f270e4a4d363698.tar.gz
container: fix gotoMarkY
Now it actually does what it was supposed to do.

Also, clarify what it does in config.md
-rw-r--r--doc/config.md4
-rw-r--r--src/local/container.nim2
2 files changed, 3 insertions, 3 deletions
diff --git a/doc/config.md b/doc/config.md
index 04749ca6..dcc63d6c 100644
--- a/doc/config.md
+++ b/doc/config.md
@@ -1036,8 +1036,8 @@ do nothing and return false.</td>
 
 <tr>
 <td>`pager.gotoMarkY(id)`</td>
-<td>If the mark `id` exists, jump to its Y position and return true. Otherwise,
-do nothing and return false.</td>
+<td>If the mark `id` exists, jump to the beginning of the line at
+its Y position and return true. Otherwise, do nothing and return false.</td>
 </tr>
 
 <tr>
diff --git a/src/local/container.nim b/src/local/container.nim
index 74011a53..ea1f5173 100644
--- a/src/local/container.nim
+++ b/src/local/container.nim
@@ -964,7 +964,7 @@ proc gotoMarkY*(container: Container, id: string): bool {.jsfunc.} =
   let mark = container.getMarkPos(id)
   if mark.isSome:
     let mark = mark.get
-    container.setCursorXYCenter(mark.x, mark.y)
+    container.setCursorXYCenter(0, mark.y)
     container.markPos()
     return true
   return false