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.
Showing the changes to player/lua/console.lua (1 of 1 file). Show all
Unified · Split
| @@ -825,7 +825,7 @@ local function determine_hovered_item() · 824 unmodified lines | |||
| 825 | -- Calculate how many lines could be printed without decreasing them for | 825 | -- Calculate how many lines could be printed without decreasing them for |
| 826 | -- the input line and OSC. | 826 | -- the input line and OSC. |
| 827 | local max_lines = height / opts.font_size | 827 | local max_lines = height / opts.font_size |
| 828 | local clicked_line = math.floor(y / height * max_lines + .5) | 828 | local clicked_line = math.ceil(y / height * max_lines) |
| 829 | 829 | ||
| 830 | local offset = first_match_to_print - 1 | 830 | local offset = first_match_to_print - 1 |
| 831 | local min_line = 1 | 831 | local min_line = 1 |