easy-markdown-editor
easy-markdown-editor copied to clipboard
Pos1 and End key behavior unexpected
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.
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.
I was able to fix this by using the following keyMap:
easymde.codemirror.addKeyMap({
'Home': 'goLineLeft',
'End': 'goLineRight',
})
@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?