Homepage    |    GitHub    |    API    |    FAQ

Text Editor - Copy/Cut current line when no selection

In most modern text editors (VS Code, SublimeText), if you do not have any text selected and you CUT or COPY (ctrl+x, ctrl+c), it will cut or copy the current line that the cursor is on.

Joplin does not have this feature. Could we add it (To the desktop apps)? Or would this need to be implemented in the Ace Editor first?

I've just checked - the Ace Editor has an option for this - editor.setOption("copyWithEmptySelection", true), (Tweak copyWithEmptySelection feature by nightwing · Pull Request #3452 · ajaxorg/ace · GitHub) so I think we can use that. We would want to put it as an option. If a maintainer would let me know that a PR to add this would be accepted, I'd happily work on creating the PR.

Joplin uses the CodeMirror editor now. Fortunately it also has an option for the behaviour you want.

Apparently it's enabled by default, but still doesn't work in Joplin, so you might find that it's more than just a setting change to get this to work. If you're serious about working on this, it would be best if you could also get it working with the TinyMCE editor.

Thanks @CalebJohn for the information and context. I have not developed on Joplin before (as you can probably tell), but I'm happy to do my best to take look.