Skip to content

Commit

Permalink
console.lua: fix ctrl+f and ctrl+b keybindings
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
guidocella committed May 11, 2024
1 parent 1e73cde commit 07d1158
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions player/lua/console.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 07d1158

Please sign in to comment.