mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Fix nix-mode for nix-shell shell scripts
Wasn't correctly detecting the interpreter argument for nix-shell shebangs. It must be done in two parts in case cached-nix-shell is used (which means the shebang will span 2+ lines).
This commit is contained in:
@ -53,7 +53,8 @@
|
|||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(if (not (re-search-forward "#! *\\(?:cached-\\)?nix-shell +-i +\\([^ \n]+\\)" 256 t))
|
(if (not (and (re-search-forward "\\_<nix-shell " (line-end-position 2) t)
|
||||||
|
(re-search-forward "-i +\"?\\([^ \"\n]+\\)" (line-end-position) t)))
|
||||||
(message "Couldn't determine mode for this script")
|
(message "Couldn't determine mode for this script")
|
||||||
(let* ((interp (match-string 1))
|
(let* ((interp (match-string 1))
|
||||||
(mode
|
(mode
|
||||||
|
Reference in New Issue
Block a user