tweak(python): use toml mode for uv.lock files

When +uv is set, find the right toml mode for the configuration and use that.
This commit is contained in:
Chris Rose 2026-02-03 12:25:24 -08:00 committed by Henrik Lissner
parent 2113b02e49
commit 2bfa0c8be1

View file

@ -220,6 +220,13 @@
:when (modulep! +uv)
:after python
:config
;; open uv.lock files in toml-mode
(add-to-list 'auto-mode-alist
(cons "/uv\\.lock\\'"
(if (and (modulep! :tools tree-sitter)
(fboundp 'toml-ts-mode))
'toml-ts-mode
'conf-toml-mode)))
;; HACK: A faster (cached) version of the mode-line segment. See
;; `+python-uv-mode-set-auto-h'.
(setq uv-mode-mode-line-format '(+python--uv-version ("UV:" +python--uv-version " ")))