When defining a header or a row of cells, write enough text that the line becomes longer than the point where it would usually wrap
Press the ‘End’ key on your keyboard
Expected result
The cursor should be moved to the end of the line.
Actual result
The cursor roughly moves to the point where text would wrap. This happens regardless of whether your cursor is to the left of that point or to the right of it: if you’re further into the line, it will bring the cursor back.
I think this might be affected by the size of the window as well, but I’m not sure.
Environment
Operating system: Windows 10
Obsidian version: v0.8.12
Additional information
This is the table that I was writing when I discovered this bug:
Classe A
objet pointé par A*
objet référencé par A&
ne change pas durant l’execution
ne peut être connu qu’au moment de l’execution
ne peut être connu qu’au moment de l’execution
coïncide avec le [[Type statique 202009101142
type statique]] de A
peut varier au cours de l’execution
ne coïncide pas forcément avec le type statique de A*
ne coïncide pas forcément avec le type statique de A&
Just ran into this issue; here’s what’s happening and how it can be fixed.
(You can, of course, temporarily work around the problem by turning off “Line Wrap” under the “Editor” settings. But obviously that’s not a practical long term solution.)
Basically, the issue here is that in Obsidian’s default keymap for CodeMirror, the “End” key is bound to the goLineRight command, which is actually what you want for lines that might be wrapped (i.e. everything but tables).
So it needs to be replaced with a function that checks if the line is a table line and then executes goLineEnd instead of goLineRight. I added a proof-of-concept workaround to one of my in-progress plugins, like so:
For the Obsidian core fix, It can of course be implemented without the around decorator, e.g. by adding it as a new smartEnd command that the End key is then bound to, and which then calls either goLineEnd or goLineRight as appropriate.