helm-swoop
helm-swoop copied to clipboard
Pre-select the pre-input so that it can be clear immediately by any new input
Similar to many other softwares (e..g, Chrome), when we initiate word search by Ctrl-F, the pre-input is pre-selected so that we can replace it by simply typing a new keyword, or append new string to it by first pressing right-arrow key. Can we have the same behavior in helm-swoop? Thanks.
I achieved it by adding following hook:
(defun my-minibuffer-setup-hook () ;; select input string (if any). (setq this-command-keys-shift-translated t) (handle-shift-selection) (beginning-of-line) ) (add-hook 'minibuffer-setup-hook #'my-minibuffer-setup-hook)
This ought to be the default behaviour of all such helm input buffers. I would suggest reopening.
OK.
@rileyrg, the default behaviour of all such helm input buffers
is what?
I usually use ivy, I have not familiar with helm. What concrete helm function works like that, please listing?
@rileyrg You'd better open a feature request in helm's issue tracking system to achieve this goal. Because helm-swoop
is specialized for buffer searching.
I usually use ivy, I have not familiar with helm. What concrete helm function works like that, please listing?
I guess he want a flex placeholder for minibuffer.
Thanks. Anyway, any change with breakage hard to merge to master. If user customization can satisfy your requirements, we would be glad if you could respond there.
I'm not sure how this is going but in any ui that opens with a preselect it should be "selected" meaning any typing deletes it and starts a new search. Should I want to append or edit I arrow to remove the region selection. Eg I would normally use the symbol at point pre select... But if I type its a new search request without the need to C-x del first. Like the op it seems the only sensible operation. If there were a configured flag to enable this that's great.
On Tue, 24 Dec 2019, 13:53 Naoya Yamashita [email protected] wrote:
Thanks. Anyway, any change with breakage hard to merge to master. If user customization can satisfy your requirements, we would be glad if you could respond there.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/emacsorphanage/helm-swoop/issues/118?email_source=notifications&email_token=AACYTCZ2ZEXFPTAEZ4NIKELQ2IA5LA5CNFSM4DWWE4X2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHTFH7A#issuecomment-568742908, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACYTC5T4IFZR225B45SGITQ2IA5LANCNFSM4DWWE4XQ .
May this configure helps you?
;; If a symbol or phrase is selected, use it as the initial query.
(setq helm-swoop-pre-input-function
(lambda ()
(if mark-active
(buffer-substring-no-properties (mark) (point))
"")))
This pre-input-function fill selected string if mark active. If you search for something you want, deactivate the mark and launch helm-swoop.