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

[closebrackets] CloseBrackets misbehaves in visual RTL mode #6527

Closed
esm7 opened this issue Dec 20, 2020 · 1 comment
Closed

[closebrackets] CloseBrackets misbehaves in visual RTL mode #6527

esm7 opened this issue Dec 20, 2020 · 1 comment

Comments

@esm7
Copy link

esm7 commented Dec 20, 2020

When the editor direction is set to RTL with rtlMoveVisually set to true (the default in most occasions), entering an opening bracket causes a cursor jump to the wrong direction. Instead of entering a closing bracket and putting the cursor in the middle, the cursor jumps an extra character ahead, possibly to the next line if it exists.
I tried reading through the code and I believe the reason is that in closebrackets.js, in handleChar, this flow uses the goCharLeft command. In visual RTL moving the cursor left means moving it forward rather than backwards, so CodeMirror enters a closing bracket and moves the cursor further forward.

@marijnh
Copy link
Member

marijnh commented Dec 21, 2020

Good point. Attached patch should help.

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

No branches or pull requests

2 participants