console.lua: use math.ceil in determine_hovered_item()

Replace the rounding to calculate the hovered line with ceil which is
what you would expect to work. Rounding worked better before because it
compensated for the errors fixed by the previous 2 commits.
This commit is contained in:
Guido Cella 2024-10-29 21:26:02 +01:00 committed by Kacper Michajłow
parent ce4a804a7d
commit b40241889b
1 changed files with 1 additions and 1 deletions

View File

@ -825,7 +825,7 @@ local function determine_hovered_item()
-- Calculate how many lines could be printed without decreasing them for
-- the input line and OSC.
local max_lines = height / opts.font_size
local clicked_line = math.floor(y / height * max_lines + .5)
local clicked_line = math.ceil(y / height * max_lines)
local offset = first_match_to_print - 1
local min_line = 1