|
|
|
@ -5002,16 +5002,20 @@ fn increment_impl(cx: &mut Context, increment_direction: IncrementDirection) {
|
|
|
|
|
overlapping_indexes.insert(i + 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let changes = changes.into_iter().enumerate().filter_map(|(i, change)| {
|
|
|
|
|
if overlapping_indexes.contains(&i) {
|
|
|
|
|
None
|
|
|
|
|
} else {
|
|
|
|
|
Some(change)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
let changes: Vec<_> = changes
|
|
|
|
|
.into_iter()
|
|
|
|
|
.enumerate()
|
|
|
|
|
.filter_map(|(i, change)| {
|
|
|
|
|
if overlapping_indexes.contains(&i) {
|
|
|
|
|
None
|
|
|
|
|
} else {
|
|
|
|
|
Some(change)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.collect();
|
|
|
|
|
|
|
|
|
|
if changes.clone().count() > 0 {
|
|
|
|
|
let transaction = Transaction::change(doc.text(), changes);
|
|
|
|
|
if !changes.is_empty() {
|
|
|
|
|
let transaction = Transaction::change(doc.text(), changes.into_iter());
|
|
|
|
|
let transaction = transaction.with_selection(selection.clone());
|
|
|
|
|
|
|
|
|
|
apply_transaction(&transaction, doc, view);
|
|
|
|
|