Fix counsel-projectile-find-file from occur buffers #2268
counsel-projectile-find-file-action would open the candidate from wrong buffer. This is an experimental fix.
This commit is contained in:
parent
fb261a9c65
commit
d7d873e11b
1 changed files with 8 additions and 0 deletions
|
@ -200,6 +200,14 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
:config
|
:config
|
||||||
(set-popup-rule! "^\\*ivy-occur" :size 0.35 :ttl 0 :quit nil)
|
(set-popup-rule! "^\\*ivy-occur" :size 0.35 :ttl 0 :quit nil)
|
||||||
|
|
||||||
|
;; HACK Fix an issue where `counsel-projectile-find-file-action' would try to
|
||||||
|
;; open a candidate in an occur buffer relative to the wrong buffer,
|
||||||
|
;; causing it to fail to find the file we want.
|
||||||
|
(defadvice! +ivy--run-from-ivy-directory-a (orig-fn &rest args)
|
||||||
|
:around #'counsel-projectile-find-file-action
|
||||||
|
(let ((default-directory (ivy-state-directory ivy-last)))
|
||||||
|
(apply orig-fn args)))
|
||||||
|
|
||||||
;; Don't use ^ as initial input. Set this here because `counsel' defines more
|
;; Don't use ^ as initial input. Set this here because `counsel' defines more
|
||||||
;; of its own, on top of the defaults.
|
;; of its own, on top of the defaults.
|
||||||
(setq ivy-initial-inputs-alist nil)
|
(setq ivy-initial-inputs-alist nil)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue