GiorgosXou / TUIFIManager

A cross-platform terminal-based termux-oriented file manager (and component), meant to be used with a Uni-Curses project or as is.
GNU General Public License v3.0
688 stars 13 forks source link

Using EDITOR instead of tuifi_default_editor #30

Closed michaelBelsanti closed 1 year ago

michaelBelsanti commented 1 year ago

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 if tuifi_default_editor is set, and otherwise fallback to EDITOR?

GiorgosXou commented 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

michaelBelsanti commented 1 year ago

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.

GiorgosXou commented 1 year ago

https://github.com/GiorgosXou/TUIFIManager/blob/master/CHANGELOG.md#v213