diff options
author | Timo Wilken | 2023-11-07 14:04:24 +0100 |
---|---|---|
committer | Timo Wilken | 2023-11-07 14:04:24 +0100 |
commit | c0734862851006793cf67aee431aaa57e09a3dfe (patch) | |
tree | c21aa0c3e8f3aca9cf9ed9f7a37b5d36c351a2c2 /tw/home/files | |
parent | 7409fef3cbe6bba6c66ce8b03aef6c2d9dc6c7e7 (diff) |
Fix actionlint buffer detection
In multi-mode yaml buffers, e.g. parts of alidist-mode buffers,
`buffer-file-name' returns nil instead, which previously raised an error here.
Diffstat (limited to 'tw/home/files')
-rw-r--r-- | tw/home/files/emacs-packages/actionlint.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tw/home/files/emacs-packages/actionlint.el b/tw/home/files/emacs-packages/actionlint.el index 64c90bd5..68a25c57 100644 --- a/tw/home/files/emacs-packages/actionlint.el +++ b/tw/home/files/emacs-packages/actionlint.el @@ -131,7 +131,9 @@ Any running invocations are killed before running another one." (defun actionlint-github-workflow-p () "Does the current buffer contain a GitHub Action?" - (string-match-p (rx ".github/workflows/" (+ (not ?\/)) ".yml" eos) (buffer-file-name))) + (let ((name (buffer-file-name))) + (and name (string-match-p + (rx ".github/workflows/" (+ (not ?\/)) ".yml" eos) name)))) (defun actionlint-setup () "Set up actionlint in this buffer, if it is recognised as a workflow file." |