roam-unofficial/roam-toolkit

Pressing a to "Click Selection and Go-to End of Line" goes at the beginning of the line

vjrli opened this issue · 4 comments

vjrli commented

Whenever I press a, more often than not, it goes at the beginning of the line instead of at the end.

Pressing "a" repeatedly makes it work and go at the end of line 1 out of 5 times.

having the same issue with "a" and "i"

also with the use of "o" and "O" to insert above and below. Although I've found that if I insert with "i" into a line first and then "o" and "O" work properly 90% of the time.

I thought that maybe it may have something to do with using the bullet path script: https://gist.github.com/azlen/cc8d543f0e46e17d978e705650df0e9e but I haven't had a chance to see if that was actually the issue.

@vjrli are you using any other js scripts on top of roam toolkit?

vjrli commented

@yangkennyk same here for "i" and "o".

No js scripts. I do have roam42 installed though.

Stvad commented

The problem is coming from the fact that to accomplish this functionality Roam Toolkit does keyboard input emulation. And that's inherently unreliable (esp for things that involve emulating a sequence of keystrokes & waiting on interaction with Roam UI ) 🙁.

Some of this can be improved with new Roam Api's (specifically block creation). But most things would continue to require the simulation I've described above =. That said it may be possible to make it more stable (e.g. by adjusting timings or verifying the Roam state vs expecting it, etc)

aum12 commented

I'm experiencing the same behaviour described by @vjrli and @yangkennyk.

@tntmarket Do you know how to correct this behaviour? Could you contribute to the fix?