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

OSX: Entering curly braces and brackets is broken in 0.10.5 while 0.10.4 works (javafx14) #967

Closed
Siedlerchr opened this issue Oct 2, 2020 · 7 comments · Fixed by #968
Closed

Comments

@Siedlerchr
Copy link

Expected Behavior

On a Macbook with Mac OSX 10.15 I am able to enter curly braces and brackets. []{}. using the Option (or Alt) ⌥ key

Actual Behavior

With version 0.10.5 I am unable to enter curly braces and brackets , when I downgrade to 0.10.4 it works.

Reproducible Demo

Orgiinal code

public class Bug extends Application {

 public void start(Stage primaryStage) {

	StackPane root = new StackPane();
       Scene scene = new Scene(root,400,400);

        CodeArea codeArea = new CodeArea();
        codeArea.setWrapText(true);
        codeArea.setInputMethodRequests(new InputMethodRequestsObject());
        codeArea.setOnInputMethodTextChanged(event -> {
            String committed = event.getCommitted();
            if (!committed.isEmpty()) {
                codeArea.insertText(codeArea.getCaretPosition(), committed);
            }
        });


        codeArea.setId("bibtexSourceCodeArea");
         root.getChildren().add(codeArea);
 primaryStage.setScene(scene);

  primaryStage.show();



 }
 /* Work around for different input methods.
     * https://github.com/FXMisc/RichTextFX/issues/146
     */
    private static class InputMethodRequestsObject implements InputMethodRequests {

        @Override
        public String getSelectedText() {
            return "";
        }

        @Override
        public int getLocationOffset(int x, int y) {
            return 0;
        }

        @Override
        public void cancelLatestCommittedText() {
            return;
        }

        @Override
        public Point2D getTextLocation(int offset) {
            return new Point2D(0, 0);
        }
    }
}

Environment info:

  • RichTextFX Version: 0.10.5
  • Operating System: OSX 10.15.7
  • Java version: 14 + openjfx14

Current Workarounds

Downgrade to 0.10.4

@Jugen
Copy link
Collaborator

Jugen commented Oct 4, 2020

I think this is related to PR #922 ?  I think the offending code may be !e.isAltDown() here which, if I'm not mistaken, wasn't there before. I'll submit a new PR to address this.

@Jugen
Copy link
Collaborator

Jugen commented Oct 4, 2020

Can you please look at (and try) the fix in the PR and let me know if it works. Thanks.

@Siedlerchr
Copy link
Author

Thanks for the quick fix, I will test it later today

@Siedlerchr
Copy link
Author

@Jugen Would you provide me a build snapshot of the lib with your fix? I am having troubles building it (because I probably only have a newer version of jdk installed)

@Jugen
Copy link
Collaborator

Jugen commented Oct 4, 2020

Sure here it is: richtextfx-0.10.6-beta.zip
(Just rename the zip to jar)

@Siedlerchr
Copy link
Author

@Jugen Confirmed, works now again! Would be nice if you could release a new version with that fix.

@Jugen
Copy link
Collaborator

Jugen commented Oct 4, 2020

Great, will release new version probably later this week or the next.

@Jugen Jugen closed this as completed in #968 Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants