Skip to content

Commit e988704

Browse files
committed
Change the changed line for text_editor on text paste differently
Fixes #2946 for multiline text
1 parent 5de7bc8 commit e988704

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

graphics/src/text/editor.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ impl editor::Editor for Editor {
375375
);
376376
}
377377
Edit::Paste(text) => {
378+
internal.topmost_line_changed =
379+
Some(editor.cursor().line);
378380
editor.insert_string(&text, None);
379381
}
380382
Edit::Indent => {
@@ -414,8 +416,9 @@ impl editor::Editor for Editor {
414416
.selection_bounds()
415417
.map(|(start, _)| start)
416418
.unwrap_or(cursor);
417-
418-
internal.topmost_line_changed = Some(selection_start.line);
419+
_ = internal
420+
.topmost_line_changed
421+
.get_or_insert(selection_start.line);
419422
}
420423

421424
// Mouse events

0 commit comments

Comments
 (0)