joplin icon indicating copy to clipboard operation
joplin copied to clipboard

Cursor Jumping when entering backtick marks using markdown

Open Basti-Fantasti opened this issue 2 years ago • 28 comments

Environment

Joplin version: 2.7.13 prod,win32 Platform: Windows OS specifics: Windows 10, German Language, German Keyboard

Steps to reproduce

The thread leading to this bug report can be found in the joplin forum

@JackGruber also added a short video which shows the issue

  1. Start a note with a headline
  2. go to next line and try to enter the quotation mark for this highlighting
  3. just start typing directly with the quotation mark followed by e.g. the word for
  4. then the f will be added after the quotation mark and the cursor jumps back to the beginning of the note

Describe what you expected to happen

That I can use regular markdown syntax with typical writing 😄

Logfile

None available, but the video as linked above!

Basti-Fantasti avatar Mar 11 '22 10:03 Basti-Fantasti

I can't replicate this. Please could you provide a video showing the issue?

laurent22 avatar Mar 11 '22 11:03 laurent22

I try to write the following in the markdown editor.

Hello `world`

Joplin_CfWWnMyYCV

No plugins activated.

Windows 11

Joplin 2.7.14 (dev, win32)

Client ID: 0a26e311ccea4bd5903ab8e3fd82597f
Sync Version: 3
Profile Version: 41
Keychain Supported: Yes

Revision: 75cc9d7

This habbens also with the PortableVersions (Tested down to version 2.4.9), but I never noticed the error before.

JackGruber avatar Mar 11 '22 11:03 JackGruber

Hmm, I still can't replicate it on macOS, but backticks are special on French keyboards. Which layout are you using?

laurent22 avatar Mar 11 '22 11:03 laurent22

A German QWERTZ Layout.

JackGruber avatar Mar 11 '22 12:03 JackGruber

Tried to replicate on Linux but don't seem to be able to. Enabled German keyboard layout and tried to follow the steps (with the assumption that the backtick key is the one next to backspace and acts as a dead key). Pressed shift + ` twice to get it to print but it worked correctly from what I can see.

Daeraxa avatar Mar 11 '22 12:03 Daeraxa

Can't replicate either (Linux, no German layout)

roman-r-m avatar Mar 11 '22 12:03 roman-r-m

Ok I can replicate it with QWERTZ layout on Windows. The sequence of key is h, e, l, l, o, Space, Shift+Backtick, w. So the W is pressed while the backtick hasn't been printed yet. I wonder if it's some CodeMirror shortcut that's being triggered?

laurent22 avatar Mar 11 '22 12:03 laurent22

That gets me something very different on Linux - hello ẁ

Daeraxa avatar Mar 11 '22 12:03 Daeraxa

Actually it does it with the French layout too - Altr Gr + 7, W. I'm used to always press space after backtick, so that it prints it, but if you press the next letter directly, it goes back at the beginning.

laurent22 avatar Mar 11 '22 12:03 laurent22

Thats True, after pressing a space the backtick is shown and the cursor dosn't jump.

JackGruber avatar Mar 11 '22 12:03 JackGruber

So a space works fine too, basically whatever it is doesn't seem to be an issue on Linux (or at the very least Linux Mint Cinnamon). h, e, l, l, o, Space, Shift+Backtick, Space, w and h, e, l, l, o, Space, Shift+Backtick, Shift+Backspace, w both produce a normal output - hello w

@JackGruber out of interest what was your exact keypress combo?

Daeraxa avatar Mar 11 '22 13:03 Daeraxa

Cursor jumps: h e l l o SPACE Shift + Backtick w No curser jump: h e l l o SPACE Shift + Backtick SPACE w

JackGruber avatar Mar 11 '22 13:03 JackGruber

This seems to be Windows only because I cannot replicate it on macOS either.

laurent22 avatar Mar 12 '22 11:03 laurent22

I had a similar bug when using Espanso but it's not triggered by backtick marks. I reported it as an Espanso bug but perhaps it's related to this.

shbach avatar Mar 12 '22 17:03 shbach

I've been experiencing the same issue. I haven't found this one, so I started #6275

a few remarks:

  1. safe mode solves the problem
  2. german keyboard layout as well as the czech one suffers from the problem
  3. whereas german and czech keyboards insert ~~one backtick, when backtick pressed (shift + ´ has to be pressed actually)~~, english layout works differently: when I press backtick: `, two backticks are written, just like by the "code" keyboard shortcut (default ctrl + alt + c I believe)

JakubGIT avatar Mar 14 '22 17:03 JakubGIT

when I press backtick: `, two backticks are written, just like by the "code" keyboard shortcut (default ctrl + alt + c I believe)

Is that not just because of the option in config > note Auto-pair braces...etc. Curious that the same option being enabled has different behaviours just because of how the character was inserted on the keyboard.

Daeraxa avatar Mar 14 '22 17:03 Daeraxa

when I press backtick: `, two backticks are written, just like by the "code" keyboard shortcut (default ctrl + alt + c I believe)

Is that not just because of the option in config > note Auto-pair braces...etc. Curious that the same option being enabled has different behaviours just because of how the character was inserted on the keyboard.

I made a mistake, it's actually like that:

keyboard layouts

whereas german and czech keyboards insert one backtick, when backtick pressed (shift + ´ has to be pressed actually) and then another key is pressed (can be a letter or a space or another backtick, english layout works differently: when I press backtick: `, two backticks are immediately inserted, just like by the "code" keyboard shortcut (default ctrl + alt + c I believe)

other applications

but - other applications react like that too - I mean - in english a backtick is immediatelly inserted, in german and czech a backtick waits for another key. It's actually pretty logical, because it's primarily not a backtick, but a reverse axon. Like è à ì, etc. (although so far I know, reverse axon is not used in any of those two languages, but a normal tick - axon is used in czech: á, é, í, ó, ú, ý)

I wish I could use the english layout actually, but I am too old to relearn z vs. y :-D

JakubGIT avatar Mar 14 '22 17:03 JakubGIT

I just mean that the double backticks in English are caused by the option to auto pair them, if you turn it off you only get one. My expectation is that when set to German pressing shift + ` twice (or once followed by space) would also auto-pair - which it does on Linux. Is this not the case?

Daeraxa avatar Mar 14 '22 17:03 Daeraxa

I just mean that the double backticks in English are caused by the option to auto pair them, if you turn it off you only get one. My expectation is that when set to German pressing shift + ` twice (or once followed by space) would also auto-pair - which it does on Linux. Is this not the case?

Yes, it is like that.

but an insteresting thing:

when

  • [x] Auto-pair braces, parenthesis, quotations, etc. then the cursor is moved to the very beginning in the case described in this issue or after three backticks and the first key afterwards

when

  • [ ] Auto-pair braces, parenthesis, quotations, etc. then the cursor is moved to the very beginning immediately after the second backtick comes

JakubGIT avatar Mar 14 '22 18:03 JakubGIT

In the meantime I noticed this does not happen in my Joplin which I use. But when I start it as dev version it does (same plugins installed). The only difference is the note and tag number. Maybe some timing problem, because the dev version reacts faster? I can't see any other difference right now.

JackGruber avatar Apr 14 '22 04:04 JackGruber

Maybe some timing problem, because the dev version reacts faster?

Not quite the same, but in a similar cursor jumping bug I was sort of able to fix it by changing the timing of when I inserted/deleted text. Maybe all of these cursor jump bugs have something to do with timing.

shbach avatar Apr 14 '22 07:04 shbach

As I described on #6460 (a duplicate), this bug seems to occur with all diacritics, i. e. `, ´, ~ and ^.

fabiorzfreitas avatar May 02 '22 16:05 fabiorzfreitas

Just discovered this also happens with shift-clicking the mouse in the editor. It jumps straight to the top of the buffer.

Rolograaf avatar Sep 10 '22 18:09 Rolograaf

I am having the same issue.

Joplin version: 2.9.17 prod,win32 Platform: Windows OS specifics: Windows 10, English Language OS Keyboard: United States-International (this means dead keys are active)! Physical Keyboard: US layout

This is happening with the following characters: `, ', ~, and ^.

RNBermudez avatar Mar 14 '23 21:03 RNBermudez

On which OS?

laurent22 avatar Mar 14 '23 23:03 laurent22

Platform: Windows OS specifics: Windows 10, English Language

Windows 10 Pro x64, Version 10.0.19044 Build 19044, specifically.

RNBermudez avatar Mar 15 '23 00:03 RNBermudez

Not to make any demands on FOSS project, but this bug still happens to me. I'm sorry to say that I started looking for alternatives to Joplin, even though I love it.

Here's my info:

Joplin 2.9.17 (prod, win32)

Client ID: 0ee0b39f54d64204a5307a553a39aba2 Sync Version: 3 Profile Version: 41 Keychain Supported: Yes

Revision: a84a8e7

Windows 10 22H2 19045.2728

Keyboard: Brazilian Portuguese (ABNT-2)

fabiorzfreitas avatar Mar 29 '23 18:03 fabiorzfreitas

I happened to be browsing my GitHub notifications and tried to see if the issue is still present.

It's not, now it works as expected, so this can be closed as Solved.

fabiorzfreitas avatar Jul 09 '23 20:07 fabiorzfreitas