parent
6bbe189809
commit
3310dc79db
1 changed files with 8 additions and 1 deletions
|
|
@ -369,6 +369,12 @@ impl editor::Editor for Editor {
|
||||||
|
|
||||||
// Editing events
|
// Editing events
|
||||||
Action::Edit(edit) => {
|
Action::Edit(edit) => {
|
||||||
|
let topmost_line_before_edit = editor
|
||||||
|
.selection_bounds()
|
||||||
|
.map(|(start, _)| start)
|
||||||
|
.unwrap_or_else(|| editor.cursor())
|
||||||
|
.line;
|
||||||
|
|
||||||
match edit {
|
match edit {
|
||||||
Edit::Insert(c) => {
|
Edit::Insert(c) => {
|
||||||
editor.action(
|
editor.action(
|
||||||
|
|
@ -417,7 +423,8 @@ impl editor::Editor for Editor {
|
||||||
.map(|(start, _)| start)
|
.map(|(start, _)| start)
|
||||||
.unwrap_or(cursor);
|
.unwrap_or(cursor);
|
||||||
|
|
||||||
internal.topmost_line_changed = Some(selection_start.line);
|
internal.topmost_line_changed =
|
||||||
|
Some(selection_start.line.min(topmost_line_before_edit));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mouse events
|
// Mouse events
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue