mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
give a chance to rebuild ranges after removing to support immediate editing of end after start
This commit is contained in:
@@ -218,6 +218,7 @@ public class XmlTagNameSynchronizer extends CommandAdapter implements Applicatio
|
||||
}
|
||||
if (!fitsInMarker) {
|
||||
clearMarkers();
|
||||
beforeDocumentChange(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,13 @@ public class XmlSyncTagTest extends LightPlatformCodeInsightFixtureTestCase {
|
||||
doTest("<div></div<caret>>", "v", "<divv></divv>");
|
||||
}
|
||||
|
||||
public void testStartToEndAndEndToStart() {
|
||||
doTest("<div<caret>></div>", "v", "<divv></divv>");
|
||||
myFixture.getEditor().getCaretModel().moveToOffset(12);
|
||||
type("\b");
|
||||
myFixture.checkResult("<div></div>");
|
||||
}
|
||||
|
||||
public void testLastCharDeleted() {
|
||||
doTest("<div<caret>></div>", "\b\b\b", "<></>");
|
||||
}
|
||||
@@ -94,6 +101,11 @@ public class XmlSyncTagTest extends LightPlatformCodeInsightFixtureTestCase {
|
||||
|
||||
private void doTest(final String text, final String toType, final String result) {
|
||||
myFixture.configureByText(XmlFileType.INSTANCE, text);
|
||||
type(toType);
|
||||
myFixture.checkResult(result);
|
||||
}
|
||||
|
||||
private void type(String toType) {
|
||||
for (int i = 0; i < toType.length(); i++) {
|
||||
final char c = toType.charAt(i);
|
||||
CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
|
||||
@@ -108,7 +120,6 @@ public class XmlSyncTagTest extends LightPlatformCodeInsightFixtureTestCase {
|
||||
}
|
||||
}, "Typing", DocCommandGroupId.noneGroupId(myFixture.getEditor().getDocument()), myFixture.getEditor().getDocument());
|
||||
}
|
||||
myFixture.checkResult(result);
|
||||
}
|
||||
|
||||
private void doTestCompletion(final String text, final String toType, final String result) {
|
||||
|
||||
Reference in New Issue
Block a user