From 3f63e8f58c815b22fd9ced3fab516e2c009aa356 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Tue, 16 Jun 2015 10:37:27 +0300 Subject: [PATCH] test case for a change in commit 4450360 (apply bidi layout algorithm only within lexical entities) --- .../com/intellij/openapi/editor/impl/EditorRtlTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorRtlTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorRtlTest.java index a4642cfb891c..3c9fa7fcda83 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorRtlTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorRtlTest.java @@ -22,6 +22,7 @@ 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 com.intellij.testFramework.TestFileType; import java.awt.*; import java.io.IOException; @@ -441,6 +442,14 @@ public class EditorRtlTest extends AbstractEditorTest { assertFalse(it.hasPastLineEndBackgroundSegment()); } + public void testUsingLexerForBidiLayout() throws Exception { + init("class Foo {\n int " + RTL_CHAR + " = 1;\n}", TestFileType.JAVA); + right(); + right(); + + assertEquals(RTL_CHAR, myEditor.getDocument().getCharsSequence().charAt(myEditor.getCaretModel().getOffset() - 1)); + } + private void init(String text) throws IOException { initText(text.replace(RTL_CHAR_REPRESENTATION, RTL_CHAR)); }