Closed gongzhitaao closed 5 years ago
I tried to debug helm-exit-and-execute-action
,found actions
variable in (let ((actions (helm-get-actions-from-current-source)))
was ("Go to Line" . helm-swoop--goto-line-action)
.
Force to (setq actions 'helm-swoop--edit)
it worked. But i don't know how to fix it.
(defun helm-exit-and-execute-action (action)
"..."
;; If ACTION is not an action available in source 'action attribute,
;; return an error. This allow to remove unneeded actions from
;; source that inherit actions from type, note that ACTION have to
;; be bound to a symbol and not to be an anonymous action
;; i.e. lambda or byte-code.
(let ((actions (helm-get-actions-from-current-source)))
(setq actions 'helm-swoop--edit)
Looks like the culprit is this commit to Helm, which restricted the list of actions that helm-exit-and-execute-action
can do to only available actions. The issue here seems to be that helm-swoop--edit
is not added as an= action for any of the helm-swoop*
sources.
I was able to hack together ab working solution by adding ("Edit" . `helm-swoop--edit)
to the action
list of helm-c-source-swoop
...
(defun helm-c-source-swoop ()
...
(action . (("Go to Line" . helm-swoop--goto-line-action)
("Edit" . helm-swoop--edit)))
...
)
...and helm-multi-swoop--exec
.
cl-defun helm-multi-swoop--exec (ignored &key $query $buflist $func $action)
...
(or $action
`(("Go to Line"
. (lambda ($line)
(switch-to-buffer ,$buf)
(helm-swoop--goto-line
(when (string-match "^[0-9]+" $line)
(string-to-number
(match-string 0 $line))))
(when (re-search-forward
(mapconcat 'identity
(split-string
helm-pattern " ") "\\|")
nil t)
(helm-swoop-flash-word (match-beginning 0) (match-end 0))
(goto-char (match-beginning 0)))
(helm-swoop--recenter)))
("Edit" . helm-multi-swoop--edit)))
...
)
You may also need to add this to the appropriate location of helm-swoop-same-face-at-point
-- I'm not 100% sure what that does.
Any updates on this issue? Any known work-arounds? Not being able to edit swoop results is quite annoying.
I have a PR open (#138). You could install from my fork in the meantime.
This project desperately needs a maintainer. @ShingoFukuyama has anyone ever reached to you to discuss that? If for any reason you currently have no bandwidth to deal with issues and PRs would you please nominate someone. Thank you!
@ashiklom Thank you, I was able to fix it in my spacemacs config by pointing it to your fork:
dotspacemacs-additional-packages '(
;; helm-swoop-edit is broken, see: https://github.com/ShingoFukuyama/helm-swoop/issues/133
(helm-swoop :location (recipe :fetcher github :repo "ashiklom/helm-swoop"))
)
does anyone know an alternative to helm-swoop?
There's helm-do-this-file
from helm-ag
. However, it does not support jump to the line when your selection changes. At least not out of the box.
Having said that, I'm using a version of helm-swoop
with a couple of patches applied (credits to @ashiklom and @CeleritasCelery). Just copy it into my ~/.emacs.d/elpa
and byte-recompile-file
. The upstream has not been changing for a while, so I had no need to repeat it.
Does anyone in this thread have interests in #143?
Please test current master.
It works! Nice Job. Thank you!
When C-c C-e during
helm-swoop
, I received the following error:I tried the followings but they do not help
helm-swoop
andhelm
only (no other packages except foruse-package
,cask
andpallet
for package managing) with zero configurationThe backtrace is