I use the CLI app quite a lot and there is a feature I have thought might be useful for a while now but never got around to playing with it - the ability to specify an editor when editing a note.
Just wondering if there is any advantage to have this implemented or if this is undesirable.
I've already added this to my own fork in a very simplistic manner, basically it extends
edit <note> to
edit <note> [myEditor] (ignore the variable/argument names, its just for playing around with atm).
It doesn't break existing functionality (that I've found anyway) so
edit $n and just pressing Enter on a note still works as normal.
So if my
nano but I want to use VIM I can:
edit $n vim
You can also pass arguments if quoted (just using existing functionality in the code) so:
edit $n "gnome-text-editor -n"
Will pass the new window argument to it.
I haven't tried this in shell mode (and honestly not sure how to without just installing a full package in a VM as I don't want to break my actual, in use install) but it seems to work ok so far in the dev env.
If there is a desire for this then I suspect I need to do some extra work to add some extra logic to catch potential errors, for example specifying an editor or path that doesn't exist returns this to the console which isn't all that clear to the uninitiated.
> edit $n notAnEditor Error opening note in editor: spawnSync notAnEditor ENOENT
I'm also guessing it should have a test unit added.
I'm guessing this is also probably a terrible way to organise it from a programming perspective, I'm very much not a programmer so any comments on how the code should actually look would be appreciated.
Interested to see any comments, I know the number of people that use the CLI app is much lower than desktop or mobile but I personally adore it and want to see it get some love.
If you feel the need to try it you can build from my GitHub fork.