mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 11:21:15 -03:00
Fix off-by-one error in new commandline --column
parse_util_lineno() returns 1-based line numbers but
parse_util_get_offset_from_line() expects zero based line offsets.
Fixes #11162
(cherry picked from commit afbdb9f268)
This commit is contained in:
@@ -475,7 +475,7 @@ pub fn commandline(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr])
|
||||
rstate.cursor_pos + 1
|
||||
- parse_util_get_offset_from_line(
|
||||
&rstate.text,
|
||||
i32::try_from(parse_util_lineno(&rstate.text, rstate.cursor_pos))
|
||||
i32::try_from(parse_util_lineno(&rstate.text, rstate.cursor_pos) - 1)
|
||||
.unwrap(),
|
||||
)
|
||||
.unwrap_or_default()
|
||||
|
||||
Reference in New Issue
Block a user