Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctrl+F to Search #225

Closed
GfEW opened this issue Feb 16, 2024 · 7 comments
Closed

Ctrl+F to Search #225

GfEW opened this issue Feb 16, 2024 · 7 comments

Comments

@GfEW
Copy link

GfEW commented Feb 16, 2024

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
Copy link
Owner

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
Copy link
Author

GfEW commented Feb 19, 2024

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:

  • Ctrl+A: Mark all
  • Ctrl+C: Copy
  • Ctrl+E: Edit mode
  • Ctrl+Shift+E: View mode
  • Ctrl+N(,Ctrl+Shift+N): New file
  • Ctrl+O(,Ctrl+Shift+O): Open ...
  • Ctrl+S: Save
  • Ctrl+Shift+S: Save as ...
  • Ctrl+V(,Ctrl+Shift+V): Paste
  • Ctrl+X: Cut
  • Ctrl+Z: Undo
  • Ctrl+Shift+Z: Redo

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:

  • Ctrl+F: Find
  • F3,Ctrl+G: Find next(*)
  • Shift+F3,Ctrl+Shift+G: Find previous(*)
  • Ctrl++: Increase font size
  • Ctrl+-: Decrease font size

(*)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:

  • Ctrl+P: Print ...

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

  • Ctrl+M: Toggle menu

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
Copy link
Owner

OK, I will investigate.

@billthefarmer
Copy link
Owner

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
Copy link
Author

GfEW commented Feb 20, 2024

That sounds and looks really great.

Two remarks:

  • Ctrl+G for "Go to" makes sense, as does F10 for "Menu" - both are rather common shortcuts, too. My suggestion included non-function-key shortcuts everywhere, including "Find next", "Find prev" and "Menu", because I know many people use more or less reduced external keyboard layouts with their android devices, where function keys can be somewhat elaborate to type. (Since I prefer full layout though, this doesn't affect myself, personally.)
  • Regarding "Find previous" (could also apply to "Find next"), I'm afraid a non-regex backwards search could end up rather confusing if you actually use regexes in your (forward) searches. To name some of the problems with such a hybrid, it could make the sequence "Find next", then "Find previous", end up elsewhere than where it started, and "Find prev" might completely fail to get you to the particular match you want to get to.
    Couldn't you, instead of searching again, reuse and cycle through the highlights list that is already maintained by Editor once a search has been conducted?

@billthefarmer
Copy link
Owner

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
Copy link
Author

GfEW commented Feb 22, 2024

Awesome, thanks a lot!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants