Giter Club home page Giter Club logo

Comments (11)

yydcdut avatar yydcdut commented on August 28, 2024 1

Sorry, I will fix it at this weekend.

from rxmarkdown.

yydcdut avatar yydcdut commented on August 28, 2024 1

I will fix it tomorrow~
haha, thank you

from rxmarkdown.

korelstar avatar korelstar commented on August 28, 2024

This bug still occurs in 0.0.8-beta. Do you were able to reproduce it?

from rxmarkdown.

yydcdut avatar yydcdut commented on August 28, 2024

@korelstar
So, type Test and then, delete t, s, e. When deleting T, app crashed?

from rxmarkdown.

korelstar avatar korelstar commented on August 28, 2024

Using the example app in this repository:

  1. Change default Text to Test in https://github.com/yydcdut/RxMarkdown/blob/master/app/src/main/java/com/yydcdut/markdowndemo/EditActivity.java#L81
  2. Start example app, chose Edit and Show
  3. Put the cursor to the end of the line (after Test)
  4. Press ⌫ on your virtual keyboard (removes t)
  5. Press ⌫ on your virtual keyboard (removes s)
  6. Press ⌫ on your virtual keyboard (the app crashes)

It is important that no other Text is in the EditText.

from rxmarkdown.

yydcdut avatar yydcdut commented on August 28, 2024

It doesn't crash on my phone

from rxmarkdown.

korelstar avatar korelstar commented on August 28, 2024

That's strange. I've tested with different devices and in the emulator. Always the same.

I will try to investigate further ...

from rxmarkdown.

korelstar avatar korelstar commented on August 28, 2024

I've installed Android Studio (latest version) on another computer with another OS (Windows instead of Linux) using the default configuration, created an emulator with the default configuration and checked out the master branch of this repository. Then I did the steps shown above (#19 (comment)) and found that the app crashes! Here is the updated Exception (line numbers differ to my first posting, since master has changed).

java.lang.IndexOutOfBoundsException: getChars (1 ... 2) ends beyond length 1
    at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1265)
    at android.text.SpannableStringBuilder.getChars(SpannableStringBuilder.java:1147)
    at android.text.TextUtils.getChars(TextUtils.java:89)
    at android.text.SpannableStringBuilder.<init>(SpannableStringBuilder.java:66)
    at android.text.SpannableStringBuilder.subSequence(SpannableStringBuilder.java:1139)
    at com.yydcdut.rxmarkdown.edit.BlockQuotesController.onTextChanged(BlockQuotesController.java:74)
    at com.yydcdut.rxmarkdown.RxMDEditText.onTextChanged4Controller(RxMDEditText.java:291)
    at com.yydcdut.rxmarkdown.RxMDEditText.access$900(RxMDEditText.java:54)
    at com.yydcdut.rxmarkdown.RxMDEditText$EditTextWatcher.onTextChanged(RxMDEditText.java:212)
    at android.widget.TextView.sendOnTextChanged(TextView.java:8186)
    at android.widget.TextView.handleTextChanged(TextView.java:8248)
    at android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:10370)
    at android.text.SpannableStringBuilder.sendTextChanged(SpannableStringBuilder.java:1208)
    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:578)
    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:509)
    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:508)
    at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:844)
    at android.view.inputmethod.BaseInputConnection.setComposingText(BaseInputConnection.java:617)
    at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:400)
    at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:91)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6077)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

So what's different between us? Is it possible that you try with a fresh installation, too?

from rxmarkdown.

yydcdut avatar yydcdut commented on August 28, 2024

It's no reason crashed on method com.yydcdut.rxmarkdown.edit.BlockQuotesController.onTextChanged(CharSequence s, int start, int before, int after) when deleting.
The parameter 'after' is always 0 when deleting, and

if (after == 0) {
        return;
}

from rxmarkdown.

yydcdut avatar yydcdut commented on August 28, 2024

OK, I reproduced it.
Delete 3 or 4 chars and add less 3 or 4 char in the same time.

from rxmarkdown.

korelstar avatar korelstar commented on August 28, 2024

Exactly! Phew, I'm very happy that you were able to reproduce it. 😄

Any ideas how to solve this? I had problems to understand the respective code ...

from rxmarkdown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.