Fix cursor offset with Affinity::After at the end of lines in Editor::cursor

This commit is contained in:
Héctor Ramón Jiménez 2023-09-12 18:27:30 +02:00
parent abab144857
commit 4389ab9865
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -143,7 +143,10 @@ impl editor::Editor for Editor {
None
}
})
.unwrap_or((0, 0.0));
.unwrap_or((
0,
layout.last().map(|line| line.w).unwrap_or(0.0),
));
let line_height = buffer.metrics().line_height;