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

Hotkeys to search on the current line #435

Open
ProgerXP opened this issue Sep 20, 2022 · 0 comments
Open

Hotkeys to search on the current line #435

ProgerXP opened this issue Sep 20, 2022 · 0 comments

Comments

@ProgerXP
Copy link
Owner

ProgerXP commented Sep 20, 2022

This is like f F t T in Vim.

Hotkeys except F1 should be currently available. Unbind F1 from About.

Shift/Alt/F1, Shift/Alt+F2 pressed when the text area is focused move focus to an invisible text input. If the document is empty, they do nothing (as Alt+F and others).

  1. When a key was pressed while this input is focused and the input's new value is not empty, perform the operation (typically user would input a single symbol, but it's possible to enter an arbitrary string with the usual Alt+V hotkey even though the caret is not visible on screen).
  2. When a hotkey (Shift/Alt/F1, Shift/Alt+F2) was pressed while this input is focused, if its current value is empty then do nothing (retain focus there), else perform the operation. This way, because input value is retained for the lifetime of the process, pressing the hotkey twice invokes operation using the previously entered search text.

Operation depends on the hotkey that was pressed either when entering this mode if anything was input (1), or hotkey pressed when leaving it without inputting (2, in this case the first hotkey pressed to focus the input is irrelevant). All operations perform the case-sensitive search for the entered string on the current line; hotkeys differ in the search direction used and positioning of caret and selection. In case no match was found, the operation ends without changing anything.

Hotkey Direction Caret Selection
F1 Forward Before match Empty
Shift+F1 Backward Before match Empty
Alt+F1 Forward After match Empty
Shift+Alt+F1 Backward After match Empty
Alt+F2 Forward After match Match selected
Shift+Alt+F2 Backward Before match Match selected

If main window loses focus, this mode ends (focus returns to the text area). Same happens if the document is changed, a dialog is opened or Escape is pressed.

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

1 participant