mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-56405 Soft wrap, editing: typing on line split border replaces wrap sign with line feed; AssertionError at SoftWrapModelImpl.beforeDocumentChangeAtCaret()
Avoiding processing soft wraps for removed document regions
This commit is contained in:
+6
-1
@@ -123,7 +123,12 @@ public class SoftWrapDocumentChangeManager implements DocumentListener {
|
||||
int diff = event.getNewLength() - event.getOldLength();
|
||||
for (int i = index; i < softWraps.size(); i++) {
|
||||
TextChangeImpl softWrap = softWraps.get(i);
|
||||
softWrap.advance(diff);
|
||||
|
||||
// Process only soft wraps not affected by the document change. E.g. there is a possible case that whole document text
|
||||
// is replaced, hence, all registered soft wraps are affected by that and no offset advance should be performed.
|
||||
if (softWrap.getStart() >= event.getOffset() + event.getOldLength()) {
|
||||
softWrap.advance(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user