AndroidIDE icon indicating copy to clipboard operation
AndroidIDE copied to clipboard

[Bug]: Editor unexpectedly closes when closing angle brackets (<>)

Open MatheusTGP opened this issue 3 years ago • 2 comments

What happened?

I was working on a project, editing the strings.xml files in the latest build version in AndroidIDE, but when I'm about to close the angle brackets (>), I unexpectedly get the error below:

Screenshot_2022-08-29-18-24-56-291_com itsaky androidide

What's the expected behavior?

When closing angle brackets in strings.xml the editor does not close

What version of AndroidIDE you're using?

v2.1.2 (debug builds)

Relevant log output

AndroidIDE crash report
Manufacturer: Xiaomi
Device: M2102J20SG
App version: 2.1.2-beta (212)

 Stacktrace: 
java.lang.IndexOutOfBoundsException: dstOffset 31
	at io.github.rosemoe.sora.text.ContentLine.insert(ContentLine.java:173)
	at io.github.rosemoe.sora.text.Content.insertInternal(Content.java:370)
	at io.github.rosemoe.sora.text.Content.insert(Content.java:333)
	at io.github.rosemoe.sora.widget.CodeEditor.commitText(CodeEditor.java:1655)
	at io.github.rosemoe.sora.widget.EditorInputConnection.commitTextInternal(EditorInputConnection.java:279)
	at io.github.rosemoe.sora.widget.EditorInputConnection.commitText(EditorInputConnection.java:129)
	at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:549)
	at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:111)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:210)
	at android.os.Looper.loop(Looper.java:299)
	at android.app.ActivityThread.main(ActivityThread.java:8261)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)

Duplicate issues

  • [X] This issue has not been reported yet.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

MatheusTGP avatar Aug 29 '22 21:08 MatheusTGP

I'm not able to reproduce this. Is there a specific way to reproduce this issue?

itsaky avatar Sep 21 '22 06:09 itsaky

I'm not able to reproduce this. Is there a specific way to reproduce this issue?

for example, when you are going to add a new string in the strings.xml file, when you are about to close the angle bracket ">", the editor crashes, or returns this error above

Example:

<string name="app_name"> <= Hangs or returns error when closing the latter ">"

MatheusTGP avatar Sep 21 '22 20:09 MatheusTGP

I'm not able to reproduce this. Is there a specific way to reproduce this issue?

for example, when you are going to add a new string in the strings.xml file, when you are about to close the angle bracket ">", the editor crashes, or returns this error above

Example:

<string name="app_name"> <= Hangs or returns error when closing the latter ">"

Cannot reproduce this issue with this. Could you check if this happens with the latest CI build?

itsaky avatar Sep 25 '22 14:09 itsaky

I'm not able to reproduce this. Is there a specific way to reproduce this issue? for example, when you are going to add a new string in the strings.xml file, when you are about to close the angle bracket ">", the editor crashes, or returns this error above Example:

<string name="app_name"> <= Hangs or returns error when closing the latter ">"

Cannot reproduce this issue with this. Could you check if this happens with the latest CI build?

From what I've tested, the error has been fixed.

MatheusTGP avatar Sep 25 '22 21:09 MatheusTGP