1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-17 21:27:08 +00:00

console.lua: fix ctrl+f and ctrl+b keybindings

With mp.input.select() these keybindings were both scrolling and moving
the cursor because of how the condition was written and
handle_pgup()/handle_pgdown() not returning a truthy value.
This commit is contained in:
Guido Cella 2024-05-11 19:38:30 +02:00 committed by Kacper Michajłow
parent 1ebe11d06f
commit 30fd3c1a96

View File

@ -890,11 +890,19 @@ function handle_pgdown()
end
local function page_up_or_prev_char()
return selectable_items and handle_pgup() or prev_char()
if selectable_items then
handle_pgup()
else
prev_char()
end
end
local function page_down_or_next_char()
return selectable_items and handle_pgdown() or next_char()
if selectable_items then
handle_pgdown()
else
next_char()
end
end
-- Move to the start of the current word, or if already at the start, the start