about summary refs log tree commit diff stats
path: root/doc/api.md
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-05-31 00:27:54 +0200
committerbptato <nincsnevem662@gmail.com>2024-05-31 00:53:49 +0200
commit27a39add498a9b1dca790c11a14cc3320cce2e31 (patch)
treebcd3e836591d015c5b574f1613b08b9752bcd739 /doc/api.md
parenta78fa4ee235006239bf9e81d8d83adc59415b524 (diff)
downloadchawan-27a39add498a9b1dca790c11a14cc3320cce2e31.tar.gz
pager: rework D/discard buffer
The previous solution had the issue that it switched between "delete
buffer, then move back" and "delete buffer, then move forward" depending
on whether the buffer was the root of the buffer tree, which made its
behavior quite unpredictable.

Now the pager (sort of) remembers the direction you are coming from,
and D moves in that direction. So e.g.:

* Enter, D just moves back to where you were coming from (as before)
* Comma, D deletes the previous buffer, then returns to the current
  buffer

If no buffer exists in the target direction, then we alert.

Also, new commands are: `d,' `d.'. They do the same thing the
non-d-prefixed variations do, but also delete the current buffer. Useful
if you're no longer sure where you are coming from, but know where you
want to go. (`d,' in particular is equivalent to w3m's `B'.)
Diffstat (limited to 'doc/api.md')
-rw-r--r--doc/api.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/api.md b/doc/api.md
index 5d8f7b2f..ac928baf 100644
--- a/doc/api.md
+++ b/doc/api.md
@@ -122,10 +122,10 @@ Use this for loading automatically retrieved (i.e. non-user-provided) URLs.</td>
 </tr>
 
 <tr>
-<td>`discardBuffer()`</td>
-<td>Discard the current buffer, and move back to its previous sibling buffer,
-or if that doesn't exist, to its parent. If the current buffer is a root buffer
-(i.e. it has no parent), move to the next sibling buffer instead.</td>
+<td>`discardBuffer(buffer = pager.buffer, dir = pager.navDirection)`</td>
+<td>Discard `buffer`, then move back to the buffer opposite to `dir`.
+Possible values of `dir` are: "prev", "next", "prev-sibling", "next-sibling",
+"parent", "first-child", "any".</td>
 </tr>
 
 <tr>