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 authored and Kacper Michajłow committed 2024-05-12 23:13:48 +02:00
1 parent 1ebe11d06f
commit 30fd3c1a96
1 file changed
+10 -2
+10 -2
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