diff options
| author | commodorian <c@commodorian.org> | 2024-11-22 23:57:52 +0100 |
|---|---|---|
| committer | bptato <nincsnevem662@gmail.com> | 2024-11-23 12:41:29 +0100 |
| commit | 92374202eeb7781b3bcf4f70ad131f0063e19134 (patch) | |
| tree | 0a89a2c79d665b31d75d140b89e5d338ab60b1d3 /src/server/buffer.nim | |
| parent | 6e7cae47b2037860f53d4ae90d37a91d8b29906b (diff) | |
| download | chawan-92374202eeb7781b3bcf4f70ad131f0063e19134.tar.gz | |
container: add Lynx-style navigation commands
Diffstat (limited to 'src/server/buffer.nim')
| -rw-r--r-- | src/server/buffer.nim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim index cdffcc7f..120fd748 100644 --- a/src/server/buffer.nim +++ b/src/server/buffer.nim @@ -451,7 +451,11 @@ proc findPrevLink*(buffer: Buffer; cursorx, cursory, n: int): var found = 0 var i = buffer.lines[cursory].findFormatN(cursorx) - 1 var link: Element = nil - if i >= 0: + if cursorx == int.high: + # Special case for when we want to jump to the last link on this + # line (for cursorLinkNavUp). + i = buffer.lines[cursory].formats.len + elif i >= 0: link = buffer.lines[cursory].formats[i].node.getClickable() dec i var ly = 0 # last y |