billthefarmer / editor

Android simple text editor
https://billthefarmer.github.io/editor
GNU General Public License v3.0
474 stars 85 forks source link

Ctrl+F to Search #225

Closed GfEW closed 6 months ago

GfEW commented 6 months ago

Due to some accessibility issues, I'm preferrably using external keyboards. Editor generally works great in this regard, except that I can't count just how many times a week I'm pressing Ctrl+F in order to naturally start a search, only to be remembered it doesn't work in Editor the way it does in other apps.

Is there any reason not to use that very common keyboard shortcut in Editor?

If there is no such reason, I'd greatly appreciate if Ctrl+F was made functional.

Thank you for considering, as well as for creating such a nice, lightweight, functional Editor at all!

billthefarmer commented 6 months ago

OK, that will be in the next version with Ctrl-Shift-F to close the search widget. It wasn't in there because I didn't think of it and nobody asked for it, I use Emacs where incremental search is Ctrl-S, reverse ditto is Ctrl-R and search and replace is Ctrl-Shift-%. So I am open to suggestions for any other useful keyboard shortcuts.

GfEW commented 6 months ago

That's good news, thank you!

First of all, I'd like to appreciate the remarkable list of working shortcuts that I've discovered and used in Editor, as of 1.92:

Have I forgotten or misrepresented anything? I'm particularly curious about the alternative shortcuts marked by parentheses - do they have any distinct meaning?

If so, please let me know, and I'll happily improve that list to show up if other users search this repo for any keyboard shortcuts.

That said, these are the missing shortcuts that I'd regard as most crucial in terms of keyboard accessability, in decreasing order:

(*)These two could be even more useful if they worked independently of the search widget, based on the last search. Maybe the search term could be remembered across search invocations, anyway?

The following one would be nice to have, although of limited use, as the android printing dialog is still rather poorly accessible via keyboard:

Finally, it's important to have a practical fallback to accessing menu items that don't have a dedicated shortcut:

Thanks for your time, Bill! <3 I'm looking forward to your take on these suggestions, or any questions that may arise.

Re emacs: I'd be glad if emacs in all its glory was available at android! Aside from termux, the closest approach I know is Acode. However in my view, Editor is a different kettle of fish alltogether, and so are its commonplace shortcuts - elegantly simple and lightweight, offering a very flat learning curve even to completely new users.

billthefarmer commented 6 months ago

OK, I will investigate.

billthefarmer commented 6 months ago

OK, I have added F3 - find next, can't use Ctrl+G because that is goto, I will look at find previous, If it works it will be text only, not regex because regular expressions don't work backwards. Ctrl+G – goto, the left and right cursor keys move the slider. Ctrl++ and Ctrl+- – increase and decrease text size,. F10 – open menu. Ctrl+P &ndash print. About half of the shortcuts you listed initially are built in to android – there are a lot more but they don't appear to be documented definitively. The reason why some of the shortcuts ignore the shift key is because I don't check it unless I need to. The code that implements them is here.

GfEW commented 6 months ago

That sounds and looks really great.

Two remarks:

billthefarmer commented 6 months ago

Find previous doesn't work. I have added Ctrl+Alt+F Find next, Ctrl+M Menu. I have been cautious with Ctrl+character shortcuts because I don't want to preempt existing shortcuts, see #151. That will be in the next version.

GfEW commented 6 months ago

Awesome, thanks a lot!

I'm looking forward to using these shortcuts in the coming version of Editor.