[fix] make <f2> open the layer source instead of gh-md
Since helm-spacemacs//layer-action-open-file shares between first and second actions, we always want second action to open file. For that reason, we set helm-prefix-arg before calling the function.
This commit is contained in:
parent
3f41fdb19c
commit
a8394e4aca
|
@ -112,14 +112,15 @@
|
||||||
(concat (ht-get configuration-layer-paths
|
(concat (ht-get configuration-layer-paths
|
||||||
(intern candidate))
|
(intern candidate))
|
||||||
candidate)))))
|
candidate)))))
|
||||||
(if helm-current-prefix-arg
|
(if (or (equal (file-name-extension file) "md")
|
||||||
(find-file (concat path file))
|
helm-current-prefix-arg)
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
(with-current-buffer (find-file-noselect (concat path file))
|
(with-current-buffer (find-file-noselect (concat path file))
|
||||||
(gh-md-render-buffer)
|
(gh-md-render-buffer)
|
||||||
(kill-this-buffer))
|
(kill-this-buffer))
|
||||||
;; if anything fails, fall back to simply open file
|
;; if anything fails, fall back to simply open file
|
||||||
(find-file (concat path file))))))
|
(find-file (concat path file)))
|
||||||
|
(find-file (concat path file)))))
|
||||||
|
|
||||||
(defun helm-spacemacs//layer-action-open-readme (candidate)
|
(defun helm-spacemacs//layer-action-open-readme (candidate)
|
||||||
"Open the `README.md' file of the passed CANDIDATE."
|
"Open the `README.md' file of the passed CANDIDATE."
|
||||||
|
|
Loading…
Reference in a new issue