easy-markdown-editor icon indicating copy to clipboard operation
easy-markdown-editor copied to clipboard

Pos1 and End key behavior unexpected

Open maurerle opened this issue 5 years ago • 3 comments

Is your feature request related to a problem? Please describe. When I use the Pos1 Key or End Key while writing notes in the Nextcloud Notes app the behavior is different from other editors I use. It always jumps to the beginning after the last line break instead of the first position of the current visible line (or last positon for End)

Coming from https://github.com/nextcloud/notes/issues/508 the suggestion was to add the new functionality in upstream.

Describe the solution you'd like Just like VSCode or Notepad++ is doing it (with enabled word wrap/automatic line break): Pressing once jumps to beginning/end of visible line Pressing twice jumps to beginning/end of current paragraph.

Describe alternatives you've considered I understand that the current behavior is due to how Markdown works and maybe it is done intentionally like this. I hope that I am not the only one who would like this change and that there isn't somebody who formed a workflow around the current behavior. If needed the functionality can be added configurable so that other projects can stay at the current behavior if they prefer.

maurerle avatar May 13 '20 07:05 maurerle

This sounds like a useful feature but I expect it's really tricky to implement. Because of the responsiveness of the editor, it's not easy to determine where the cursor should go.

Ionaru avatar May 15 '20 12:05 Ionaru

I was able to fix this by using the following keyMap:

easymde.codemirror.addKeyMap({
	'Home': 'goLineLeft',
	'End': 'goLineRight',
})

korelstar avatar Jun 11 '20 13:06 korelstar

@Ionaru I'd really like this feature as well. The behaviour of the Home/End keys on a wrapped line is different with EasyMDE compared to anything else I've used, so I keep getting caught out by it. Would @korelstar's suggestion work here?

SeanDS avatar May 14 '22 09:05 SeanDS