about summary refs log tree commit diff stats
path: root/src/local
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-12-09 14:43:10 +0100
committerbptato <nincsnevem662@gmail.com>2023-12-09 16:36:23 +0100
commit6a1b1a2edfc6adf3d1d1a1aaa2c9fd95eccc8ff7 (patch)
treef2760bbb12b79925fa1c87dde9e05ddd74310683 /src/local
parent14f5605061501fa56d9b4970571858f6451e4710 (diff)
downloadchawan-6a1b1a2edfc6adf3d1d1a1aaa2c9fd95eccc8ff7.tar.gz
pager: add `{', `}'; document externInto
{ & } acts like in vi (except the cursor is not moved to the line
beginning).

No reason to leave externInto undocumented, as it is even used in
the default config.
Diffstat (limited to 'src/local')
-rw-r--r--src/local/container.nim14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/local/container.nim b/src/local/container.nim
index 2a0051e6..7cb67862 100644
--- a/src/local/container.nim
+++ b/src/local/container.nim
@@ -850,6 +850,20 @@ proc cursorPrevLink*(container: Container) {.jsfunc.} =
       if res.x > -1 and res.y != -1:
         container.setCursorXYCenter(res.x, res.y))
 
+proc cursorNextParagraph*(container: Container, n = 1) {.jsfunc.} =
+  container.iface
+    .findNextParagraph(container.cursory, n)
+    .then(proc(res: int) =
+      container.setCursorY(res)
+    )
+
+proc cursorPrevParagraph*(container: Container, n = 1) {.jsfunc.} =
+  container.iface
+    .findPrevParagraph(container.cursory, n)
+    .then(proc(res: int) =
+      container.setCursorY(res)
+    )
+
 proc cursorNthLink*(container: Container, n = 1) {.jsfunc.} =
   container.iface
     .findNthLink(n)