mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
test case for a fix in commit 0cd3b58 (fix AIOOBE during editor painting)
This commit is contained in:
@@ -19,6 +19,8 @@ import com.intellij.openapi.actionSystem.IdeActions;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.LogicalPosition;
|
||||
import com.intellij.openapi.editor.VisualPosition;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.editor.impl.view.IterationState;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
|
||||
import java.awt.*;
|
||||
@@ -426,6 +428,19 @@ public class EditorRtlTest extends AbstractEditorTest {
|
||||
checkSelection(1, 2);
|
||||
}
|
||||
|
||||
public void testIterationStateAfterLineEnd() throws Exception {
|
||||
init("rl");
|
||||
myEditor.getCaretModel().moveToVisualPosition(new VisualPosition(0, 1, true));
|
||||
|
||||
IterationState it = new IterationState((EditorEx)myEditor, 1, 2, true, false, false, false);
|
||||
assertFalse(it.atEnd());
|
||||
assertEquals(1, it.getStartOffset());
|
||||
assertEquals(2, it.getEndOffset());
|
||||
it.advance();
|
||||
assertTrue(it.atEnd());
|
||||
assertFalse(it.hasPastLineEndBackgroundSegment());
|
||||
}
|
||||
|
||||
private void init(String text) throws IOException {
|
||||
initText(text.replace(RTL_CHAR_REPRESENTATION, RTL_CHAR));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user