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

<End> key / lineEnd command bug with RTL #6531

Open
esm7 opened this issue Dec 22, 2020 · 2 comments
Open

<End> key / lineEnd command bug with RTL #6531

esm7 opened this issue Dec 22, 2020 · 2 comments

Comments

@esm7
Copy link

@esm7 esm7 commented Dec 22, 2020

When in visual RTL mode, if the last word in a line is an English one, the End key (and the lineEnd command) jump to the wrong place.

Way to recreate, in an RTL CodeMirror instance, e.g. https://codemirror.net/demo/bidi.html:

  1. Write a text in an RTL language (e.g. Hebrew) that ends with an LTR language (e.g. English). I used "ניסיון ABC". Unlike here in this text, the ABC should appear to the left of the Hebrew word.
  2. In that line, press the <End> key. The cursor is actually before the English word instead of after it.
  3. If at this point you press <Enter>, the English word will move to the next line. The expected behavior is of course that <End> followed by <Enter> will start a new empty line.
@marijnh
Copy link
Member

@marijnh marijnh commented Dec 27, 2020

The bidi handling in CodeMirror 5.x is a bit of a tangled (and, in parts, misguided) mess. I just checked the upcoming version 6, which seems to handle this properly.

It is unlikely that I'll patch this in 5.x, but if you want to try your hand at a pull request, that'd be welcome. Upgrading to the new code is not really recommended yet unless you're willing to deal with beta-quality, somewhat-unstable software, but will be the recommended way to deal with this on the long term.

@esm7
Copy link
Author

@esm7 esm7 commented Dec 28, 2020

I tried to spend some time going over the relevant code but like you say, it's somewhat tangled.
We'll wait for version 6 in this case.

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

Successfully merging a pull request may close this issue.

None yet
2 participants