Rosemoe / sora-editor

A multifunctional Android code editor library. (aka CodeEditor)
GNU Lesser General Public License v2.1
1k stars 156 forks source link

[BUG] Crash on deleting text #186

Closed MrIkso closed 2 years ago

MrIkso commented 2 years ago

Stacktrace: java.lang.StringIndexOutOfBoundsException: Column 39 out of bounds.line: 38 ,column count:24 at io.github.rosemoe.sora.text.Content.checkLineAndColumn(Content.java:896) at io.github.rosemoe.sora.text.Content.deleteInternal(Content.java:419) at io.github.rosemoe.sora.text.Content.replace(Content.java:525) at io.github.rosemoe.sora.widget.EditorInputConnection.setComposingText(EditorInputConnection.java:429) at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:650) at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:118) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8663) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

Rosemoe commented 2 years ago

It seems to be caused by an abnornal input connection close. How frequent does that happen? Is there any way to reproduce?

Rosemoe commented 2 years ago

Or it can be caused by an external text change not by the input connection

Rosemoe commented 2 years ago

I am interested in what IDE application are you using and what keyboard do you use? Could you please send me the name and version?

MrIkso commented 2 years ago

AndroidIDE latest version, keyboard - Gboard version 11.7.06.439544614

Rosemoe commented 2 years ago

Thanks a lot