BUG: Editor crash when showing window diagnostic window
MohammedKHC opened this issue · 0 comments
Also please note that editor was containing Arabic characters
2024-07-02 16:17:29.550 28525-28525 GraphicTextRow com.mohammedkhc.rustroid W start > end. if this is caused by editor, please provide feedback (Ask Gemini)
java.lang.Throwable
at io.github.rosemoe.sora.graphics.GraphicTextRow.measureText(GraphicTextRow.java:283)
at io.github.rosemoe.sora.widget.layout.BidiLayoutHelper.horizontalOffset(BidiLayoutHelper.kt:70)
at io.github.rosemoe.sora.widget.layout.LineBreakLayout.getCharLayoutOffset(LineBreakLayout.java:222)
at io.github.rosemoe.sora.widget.layout.Layout.getCharLayoutOffset(Layout.java:125)
at io.github.rosemoe.sora.widget.CodeEditor.getCharOffsetY(CodeEditor.java:508)
at io.github.rosemoe.sora.widget.component.EditorDiagnosticTooltipWindow.updateWindowPosition(EditorDiagnosticTooltipWindow.kt:346)
at io.github.rosemoe.sora.widget.component.EditorDiagnosticTooltipWindow.updateDiagnostic(EditorDiagnosticTooltipWindow.kt:291)
at io.github.rosemoe.sora.widget.component.EditorDiagnosticTooltipWindow.updateDiagnostic(EditorDiagnosticTooltipWindow.kt:255)
at io.github.rosemoe.sora.widget.component.EditorDiagnosticTooltipWindow.registerEditorEvents$lambda$7(EditorDiagnosticTooltipWindow.kt:144)
at io.github.rosemoe.sora.widget.component.EditorDiagnosticTooltipWindow.$r8$lambda$VPDXoqCSNbldWZdXLo2T4XC4jTc(Unknown Source:0)
at io.github.rosemoe.sora.widget.component.EditorDiagnosticTooltipWindow$$ExternalSyntheticLambda9.onReceive(D8$$SyntheticClass:0)
at io.github.rosemoe.sora.event.EventManager.dispatchEvent(EventManager.java:242)
at io.github.rosemoe.sora.event.EventManager.dispatchEvent(EventManager.java:270)
at io.github.rosemoe.sora.widget.CodeEditor.dispatchEvent(CodeEditor.java:3854)
at io.github.rosemoe.sora.widget.CodeEditor.onSelectionChanged(CodeEditor.java:4376)
at io.github.rosemoe.sora.widget.CodeEditor.afterDelete(CodeEditor.java:5001)
at io.github.rosemoe.sora.text.Content.dispatchAfterDelete(Content.java:1035)
at io.github.rosemoe.sora.text.Content.deleteInternal(Content.java:554)
at io.github.rosemoe.sora.text.Content.delete(Content.java:474)
at io.github.rosemoe.sora.widget.CodeEditor.deleteText(CodeEditor.java:1883)
at io.github.rosemoe.sora.widget.EditorInputConnection.deleteSurroundingText(EditorInputConnection.java:389)
at android.view.inputmethod.RemoteInputConnectionImpl.lambda$deleteSurroundingText$32(RemoteInputConnectionImpl.java:933)
at android.view.inputmethod.RemoteInputConnectionImpl.$r8$lambda$UQStXOZ2WNd3-AAjcek6SvGL-pM(Unknown Source:0)
at android.view.inputmethod.RemoteInputConnectionImpl$$ExternalSyntheticLambda8.run(Unknown Source:8)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8248)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
2024-07-02 16:17:29.558 28525-32100 EventHandler com.mohammedkhc.rustroid W Ignored content modified error message
2024-07-02 16:17:29.645 28525-32100 EventHandler com.mohammedkhc.rustroid W Ignored content modified error message
2024-07-02 16:17:29.863 28525-28525 AndroidRuntime com.mohammedkhc.rustroid E FATAL EXCEPTION: main (Ask Gemini)
Process: com.mohammedkhc.rustroid, PID: 28525
java.lang.IndexOutOfBoundsException: Index 17 out of bounds for length 17
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.util.Objects.checkIndex(Objects.java:359)
at java.util.ArrayList.get(ArrayList.java:434)
at io.github.rosemoe.sora.text.Content.getLine(Content.java:259)
at io.github.rosemoe.sora.text.Content.getColumnCount(Content.java:282)
at io.github.rosemoe.sora.widget.layout.LineBreakLayout.getCharLayoutOffset(LineBreakLayout.java:222)
at io.github.rosemoe.sora.widget.layout.Layout.getCharLayoutOffset(Layout.java:125)
at io.github.rosemoe.sora.widget.CodeEditor.getCharOffsetX(CodeEditor.java:497)
at io.github.rosemoe.sora.widget.component.EditorDiagnosticTooltipWindow.updateWindowPosition(EditorDiagnosticTooltipWindow.kt:345)
at io.github.rosemoe.sora.widget.component.EditorDiagnosticTooltipWindow.registerEditorEvents$lambda$8(EditorDiagnosticTooltipWindow.kt:154)
at io.github.rosemoe.sora.widget.component.EditorDiagnosticTooltipWindow.$r8$lambda$st4i2rwDn5AsYGyJ3pqxmJRvWv0(Unknown Source:0)
at io.github.rosemoe.sora.widget.component.EditorDiagnosticTooltipWindow$$ExternalSyntheticLambda10.onReceive(D8$$SyntheticClass:0)
at io.github.rosemoe.sora.event.EventManager.dispatchEvent(EventManager.java:242)
at io.github.rosemoe.sora.event.EventManager.dispatchEvent(EventManager.java:270)
at io.github.rosemoe.sora.widget.CodeEditor.dispatchEvent(CodeEditor.java:3854)
at io.github.rosemoe.sora.widget.CodeEditor.ensurePositionVisible(CodeEditor.java:2091)
at io.github.rosemoe.sora.widget.CodeEditor.ensurePositionVisible(CodeEditor.java:2024)
at io.github.rosemoe.sora.widget.CodeEditor.ensureSelectionVisible(CodeEditor.java:2014)
at io.github.rosemoe.sora.widget.CodeEditor.afterDelete(CodeEditor.java:4991)
at io.github.rosemoe.sora.text.Content.dispatchAfterDelete(Content.java:1035)
at io.github.rosemoe.sora.text.Content.deleteInternal(Content.java:554)
at io.github.rosemoe.sora.text.Content.delete(Content.java:474)
at io.github.rosemoe.sora.widget.CodeEditor.deleteText(CodeEditor.java:1859)
at io.github.rosemoe.sora.widget.EditorInputConnection.deleteSurroundingText(EditorInputConnection.java:389)
at android.view.inputmethod.RemoteInputConnectionImpl.lambda$deleteSurroundingText$32(RemoteInputConnectionImpl.java:933)
at android.view.inputmethod.RemoteInputConnectionImpl.$r8$lambda$UQStXOZ2WNd3-AAjcek6SvGL-pM(Unknown Source:0)
at android.view.inputmethod.RemoteInputConnectionImpl$$ExternalSyntheticLambda8.run(Unknown Source:8)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8248)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)