mirror of
https://github.com/wez/wezterm.git
synced 2024-11-23 06:54:45 +03:00
search: fix coordinates for matches at EOL
The returned coords didn't include the last cell on the line; adjust the fallback case to generate an exclusive rather than inclusive end coordinate.
This commit is contained in:
parent
ec46aba089
commit
5831bd7c8d
@ -628,7 +628,13 @@ impl Pane for LocalPane {
|
|||||||
.binary_search_by(|ele| ele.byte_idx.cmp(&idx))
|
.binary_search_by(|ele| ele.byte_idx.cmp(&idx))
|
||||||
.or_else(|i| -> Result<usize, usize> { Ok(i) })
|
.or_else(|i| -> Result<usize, usize> { Ok(i) })
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let coord = coords.get(c).or_else(|| coords.last()).unwrap();
|
let coord = coords.get(c).map(|c| *c).unwrap_or_else(|| {
|
||||||
|
let last = coords.last().unwrap();
|
||||||
|
Coord {
|
||||||
|
grapheme_idx: last.grapheme_idx + 1,
|
||||||
|
..*last
|
||||||
|
}
|
||||||
|
});
|
||||||
(coord.grapheme_idx, coord.stable_row)
|
(coord.grapheme_idx, coord.stable_row)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user