Browser: add caret browsing to smart select text area #345
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add caret browsing function for EAF browser. It can be used to smart select text area.
The
core/js/caret_browsing.js
is derived from qutebrowser's caret.js under GPL-3.0.Usage
Under my configuration, Press
M-c
to activate caret browsing,C-q
to deactivate. Caret browsing is deactivated by default.If caret browsing is activated, press
C-i
to toggle mark. if mark is on, the cursor will be used to select. If mark is off, the cursor will only move around according to commands. Mark is off by default.Here is a list of keybindings under my configuration for caret browsing, it will work only if caret browsing is activated.
If mark is on and caret browsing is activated, Press
/
to search text forward and select,?
to search text backward and select.C-.
to clear current searching text.Example
Take here https://superuser.com/questions/1236864/how-to-use-vimium-to-select-text-from-a-page for example, if we want to achieve the same result, you can do as follows:
M-c
to activate caret browsing, then pressC-i
to set mark on./
to open search and select, entermailto
in the minibuffer and then pressenter
to confirm.C-.
to clear current searching text, and again press/
to open search and select, entervery
in the minibuffer and then pressenter
to confirm.w
to select one word at a time ora
to gradually select it.M-w
to yank the textverycomplicatedandlonganduglydomainthatiwontsearachfor.com
Signed-off-by: Hollow Man hollowman186@vip.qq.com