Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.7-M4] Inserting text via user keyboard input inserts text in reverse order because caret position doesn't advance forward after input #472

Closed
ghost opened this issue Mar 28, 2017 · 14 comments

Comments

@ghost
Copy link

ghost commented Mar 28, 2017

Replicate

  1. Run the Java Keywords demo
  2. Start typing

Expected Results
The caret advances with each character typed.

Actual Results
The caret retains its position, which causes the typed text to be entered backwards.

java-keywords-demo

@JordanMartinez
Copy link
Contributor

I'm guessing you're using the new 0.7-M4 release? That's probably a bug from #468. :-/

@JordanMartinez
Copy link
Contributor

Nope. I was wrong. The bug start showing up in #463. After I moved the model-API to ESD, every time one types a letter, it moves the caret to the right twice so that the caret is one character farther than it should be. After I moved the view API to the area, the behavior reverted to what @DaveJarvis just now described in this issue.

@ghost
Copy link
Author

ghost commented Mar 28, 2017

Correct, this is in the 0.7-M4 release. 0.7-M3 worked as expected.

@JordanMartinez
Copy link
Contributor

I've updated the release notes to note this issue.

@JordanMartinez JordanMartinez changed the title Caret doesn't advance [0.7-M4] Inserting text via user keyboard input inserts text in reverse order because caret position doesn't advance forward after input Mar 28, 2017
@JordanMartinez
Copy link
Contributor

@TomasMikula Would it be possible to re-release the 0.7-M4 release using the updated master branch that accounts for this issue? Or would this require another release?

@JordanMartinez
Copy link
Contributor

JordanMartinez commented Mar 28, 2017 via email

@ghost
Copy link
Author

ghost commented Mar 29, 2017

@JordanMartinez, once the new release is available, I'll try it out.

I'd suggest making a new release, 0.7-M5. (Mostly to avoid caching issues for anyone who already has 0.7-M4 downloaded.)

@TomasMikula
Copy link
Member

I pushed a new SNAPSHOT release, can you try that out?

I think it used to be possible to override a release, but yeah, there can be caching issues.

@JordanMartinez
Copy link
Contributor

:-/ Dang...

@ghost
Copy link
Author

ghost commented Mar 29, 2017

SNAPSHOT release has resolved this issue.

@JordanMartinez
Copy link
Contributor

Can a new milestone release be made then?

@TomasMikula Besides the bugs and dependency bugs tagged in this project's list of issues, is there anything else that needs to be done before a stable 0.7 release can be made?

@JordanMartinez
Copy link
Contributor

JordanMartinez commented Mar 31, 2017

It is possible to fix this regression in the 0.7-M4 release by overriding the replace method like so (Updated to account for TextChange's exception in some situations):

public void replace(int from, int to, StyledDocument<PS, SEG, S> document) {
    if (from == to && document.length() == 0) {
        return; // ignore changes that do nothing. Or TextChange throws IllegalArgumentException
    }
    super.replace(from, to, document);
    int newCaretPos = getCaretPosition() + document.length();
    selectRange(newCaretPos, newCaretPos);
}

@TomasMikula
Copy link
Member

Released 0.7-M5. As for 0.7, I don't know, mainly be it more stable, API-wise and bug-wise.

@JordanMartinez
Copy link
Contributor

Ok. Bug-wise, there's 2 RTFX-specific bugs that can be fixed somewhat quickly (#423 & #362). I'm not sure what is causing the problem with #265 and I can't test (and thus fix) it because I don't use/have a Mac. Then there's the Flowless-related bugs (#412, #390, and probably #260).

How could the API be made more stable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants