mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 11:21:15 -03:00
Fix crash on kitty when clicking in scrolled command line
When the command line occupies the whole screen such that no prompt line is shown, we crash due to overflow. Fix that. Fixes #12178
This commit is contained in:
@@ -642,7 +642,7 @@ pub fn offset_in_cmdline_given_cursor(
|
||||
);
|
||||
0
|
||||
})
|
||||
.max(self.actual.visible_prompt_lines - 1)
|
||||
.max(self.actual.visible_prompt_lines.saturating_sub(1))
|
||||
.min(self.actual.line_count() - 1);
|
||||
let line = self.actual.line(y);
|
||||
let x = viewport_position.x.max(line.indentation);
|
||||
|
||||
Reference in New Issue
Block a user