Closed michaelBelsanti closed 1 year ago
Using EDITOR will use the correct editor out of the box for most users
I didn't know this env-variable existed, I might consider adding it to the fallback line of code that I mention bellow.
If you want to offer the ability to use an editor other than what EDITOR is set to, perhaps you could check if tuifi_default_editor is set, and otherwise fallback to EDITOR?
That's what I've thought about tuifi_default_editor
too, and if no env-variable exists, it falls-back to one of those:
https://github.com/GiorgosXou/TUIFIManager/blob/9272ecce2e7c77738f936d5bc55fd236bba5d7d7/TUIFIManager/TUIFIProfile.py#L22
Makes sense. I think it would be best to add an or getenv('EDITOR')
after checking for tuifi_default_editor
. This way, when a new user tries to edit a file it will default to their preferred editor, and if they wish for tuifi to use a seperate editor, they still can by setting tuifi_default_editor
.
Is there any benefit to using a custom variable for the editor? Using
EDITOR
will use the correct editor out of the box for most users, since most people heavily using the terminal will have it set. If you want to offer the ability to use an editor other than what EDITOR is set to, perhaps you could check iftuifi_default_editor
is set, and otherwise fallback toEDITOR
?