reader: wide tables scroll sideways from the keys

`zl` / `zh` scroll the table, code block or formula at the top of the
view a few columns right or left, and `zL` / `zH` by half its width, as
vim scrolls a long line. It is the first one too wide for the column that
reaches down past the top of the reading view, so it is the one being
read. A CSV's table in the file pane answers the same keys. Before, those
only scrolled with the pointer or a trackpad.
This commit is contained in:
nvrl committed 2026-10-20 15:35:29 +02:00
1 parent 811e09416f
commit e728d468cb
7 files changed
+46 -6

No files matched your search

+7 -1
View File
@@ -713,13 +713,19 @@
void runCommand('d')
return
}
if (previous === 'z' && ['h', 'l', 'H', 'L'].includes(key)) {
event.preventDefault()
const amount = ({ h: -1, l: 1, H: 'halfleft', L: 'halfright' } as const)[key as 'h' | 'l' | 'H' | 'L']
if (!reading || !hooks.scrollWide(amount)) workspace.say('nothing wider than the column in view', 'error')
return
}
if ((previous === ']' && key === ']') || (previous === '[' && key === '[')) {
event.preventDefault()
// Past the last heading there is still the end, as in vim.
if (reading && !hooks.jumpHeading(key === ']' ? 1 : -1)) hooks.scrollReader(key === ']' ? 'bottom' : 'top')
return
}
if (key === 'g' || key === 'd' || key === ']' || key === '[') {
if (key === 'g' || key === 'd' || key === ']' || key === '[' || key === 'z') {
pending = key
return
}