orbitalquark / textadept

Textadept is a fast, minimalist, and remarkably extensible cross-platform text editor for programmers.
https://orbitalquark.github.io/textadept
MIT License
636 stars 38 forks source link

Menu (feature request) #438

Open marco-trovato opened 1 year ago

marco-trovato commented 1 year ago

This is currently the only text editor for terminal with CUA standard keybindings that supports text selection, mouse, and ESPECIALLY text folding/collapsing (it's literally the only one with this feature).

Tilde, Micro, and NiceEditor are missing these features.

Can you please...please🙏 add a menu? Even just with File -> Open / Save / Quit Thank you

orbitalquark commented 1 year ago

I agree this would be nice to have. Thanks for the reminder. While CDK (the terminal widget toolkit Textadept uses) supports menu widgets, I don't think it has a menu bar or support for nested submenus. Writing those widgets would be difficult for me, so that's why the terminal version of Textadept doesn't have menus :(

The "Tools > Select Command" (Ctrl+P) dialog helps alleviate this to an extent though.

marco-trovato commented 1 year ago

Honest question: is it really that difficult to

  1. Without even saving the text buffer currently on the screen, just violently print withut grace on the top of the screen "FILE" with "SAVE, LOAD and QUIT" below
  2. Wait for the right hotkey and call the relative function
  3. Just redraw/refresh the screen to show the editor to return to the working file

?

I ask because it sounds like 10 lines of C code to my experience and it would make a huge difference in term of usability and initial learning curve.

(instead of hardcoding the menu it could be even easily possibile to use an external file which binds a new item of the menu to the relative function)

orbitalquark commented 1 year ago

It might not be difficult to do, but it is a hard-coded, half-baked, inflexible solution that defeats the purpose of Textadept. Using an external file adds an additional layer of complexity (and failure point) that would likely not be worth it.

Ctrl+P for now is the way to go through Textadept's menu in the terminal.

marco-trovato commented 1 year ago

You are 100% right I didn't know about CTRL-P. I have only one simple legit question: why in the holy cult of the dead cow did you chose CTRL-P instead of ESC ? This menu would have been perfect if I only knew it existed

orbitalquark commented 1 year ago

Textadept's keybindings were designed to be as consistent and predictable as possible across all platforms, including the terminal version. Escape cancels autocompletion, calltips, snippets, find/replace, etc. Having it show the command entry would not fit in.