mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Fix file template :when logic to apply to modes
When a file template rule is evaluated against a particular buffer it is supposed to call the :when function if it is defined. Currently, the function is ignored if the PRED of the template rule is a mode. This fixes this issue.
This commit is contained in:
@ -122,10 +122,10 @@ information.")
|
|||||||
(eq major-mode pred))
|
(eq major-mode pred))
|
||||||
(and (stringp pred)
|
(and (stringp pred)
|
||||||
(stringp buffer-file-name)
|
(stringp buffer-file-name)
|
||||||
(string-match-p pred buffer-file-name)
|
(string-match-p pred buffer-file-name)))
|
||||||
(or (not (plist-member plist :when))
|
(or (not (plist-member plist :when))
|
||||||
(funcall (plist-get plist :when)
|
(funcall (plist-get plist :when)
|
||||||
buffer-file-name))))
|
buffer-file-name))
|
||||||
rule)))
|
rule)))
|
||||||
|
|
||||||
(defun +file-templates-check-h ()
|
(defun +file-templates-check-h ()
|
||||||
|
Reference in New Issue
Block a user