Skip to content

Commit

Permalink
Ensure there's an auto-mode-alist entry for nix-ts-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed Aug 2, 2024
1 parent 6972ba9 commit 9dcdb02
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lisp/init-nix.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
;;; Code:

(if (maybe-require-package 'nix-ts-mode)
(when (and (fboundp 'treesit-ready-p) (treesit-ready-p 'nix t))
(add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-ts-mode)))
;; If the TS mode is installed, then the non-TS mode is not, so
;; nobody will have added an auto-mode-alist entry
(add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-ts-mode))
(maybe-require-package 'nix-mode))

(with-eval-after-load 'eglot
Expand Down

0 comments on commit 9dcdb02

Please sign in to comment.