esm7 / obsidian-rtl

RTL support for Obsidian.md
MIT License
136 stars 11 forks source link

Home and End keys still behave unexpectedly #17

Open esm7 opened 3 years ago

esm7 commented 3 years ago

In spite of the work done to improve this, they are still not working great at times.

MatanRubin commented 9 months ago

+1 for this one. I love this plugin, but navigating the text using the keyboard is soooo unexpected... :(

MatanRubin commented 9 months ago

I'll be more specific. I've found that the Home and End buttons behave as they should. However, on a mac, the cmd+left and cmd+right, which should move to the leftmost or rightmost of the current line, misbehave in RTL mode. This is strange, because I tried CodeMirror's RTL demo (see here) and it seems to behave exactly as it should, so I'm wondering what's the reason this doesn't behave well in Obsidian.

MatanRubin commented 9 months ago

If you think there's a solution for this that I could implement, I'd be happy to contribute, but I do need some guidance. Any thoughts on this?

esm7 commented 9 months ago

Can you elaborate on what versions of Obsidian and the obsidian-rtl plugin you are using? Also, what is the document direction - rtl or auto?

On Fri, Dec 15, 2023, 23:11 Matan Rubin @.***> wrote:

If you think there's a solution for this that I could implement, I'd be happy to contribute, but I do need some guidance. Any thoughts on this?

— Reply to this email directly, view it on GitHub https://github.com/esm7/obsidian-rtl/issues/17#issuecomment-1858493017, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRZ2YESQLNS2XUKERS33KLYJS4ILAVCNFSM47RU2NW2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBVHA2DSMZQGE3Q . You are receiving this because you authored the thread.Message ID: @.***>

MatanRubin commented 9 months ago

Obisidian 1.4.16, obsidian-rtl 1.1.1. The behavior is the same in RTL and Auto mode.

zoli commented 9 months ago

Just wanted to note I checked this (CTLR + left/right) in Linux and it works fine. Both in RTL and AUTO mode.

omeraloni commented 9 months ago

Obisidian 1.4.16, obsidian-rtl 1.1.1. The behavior is the same in RTL and Auto mode.

  • When pressing cmd+right the cursor is moved to the right, to the beginning of the line, as it should.
  • When pressing cmd+left the cursor is moved to the right, to the beginning of the line, which is wrong. It should go to the left, to the end of the line.
  • When pressing cmd+left again, the cursor stays at the beginning of the line.

@esm7 confirming that I experience exactly the same behavior (Obisidian 1.4.16). Tried it on an empty vault with nothing installed but obsidian-rtl 1.1.1.

esm7 commented 9 months ago

That's really surprising, I was sure this bug is irrelevant since very long ago. As @zoli mentioned, in Linux it stopped being relevant ever since Obsidian upgraded to CM6. I need to work on this plugin in the upcoming days regardless, as it's not behaving well on Obsidian's soon-to-be-released 1.5 version. I'll use this opportunity to try understand what we might be doing differently than the CodeMirror RTL demo. @MatanRubin if you're able to contribute, I'd start by checking the pure RTL (not auto) mode, and how we might be missing something in using it.

omeraloni commented 9 months ago

Adding that I’m also on macOS. @esm7, I tried it in auto as well as manual.

MatanRubin commented 9 months ago

@esm7 , since you're already going to touch the plugin in the next few days, I prefer waiting until you finish, hoping you'll spot the issue more easily than I could. If you can't spot the issue as part of your work on Obsidian 1.5 support - I'll try digging myself. Let me know how it goes.

esm7 commented 9 months ago

Updating that I did the fixes for Obsidian 1.5, and as part of it tried to look into this, but I couldn't recreate it nor understand from basic detective work what could be causing it on MacOS :-/