lang/lua: improve moonscript & love2D support
- Fix moonscript-mode not highlighting/treating single-quoted strings as strings - Fontify interpolated expressions in moonscript-mode strings (PR upstream?) - Fix +lua-love-mode project detection - Fix +lua/run-love-game love project root resolution
This commit is contained in:
parent
74877edd5d
commit
1f0a5f04f2
4 changed files with 66 additions and 32 deletions
|
@ -19,21 +19,28 @@
|
|||
(set-company-backend! 'lua-mode '(company-lua company-yasnippet)))
|
||||
|
||||
|
||||
;;;###package moonscript
|
||||
(setq-hook! 'moonscript-mode-hook moonscript-indent-offset tab-width)
|
||||
(def-package! moonscript
|
||||
:when (featurep! +moonscript)
|
||||
:defer t
|
||||
:config
|
||||
(setq-hook! 'moonscript-mode-hook
|
||||
moonscript-indent-offset tab-width)
|
||||
(add-hook! 'moonscript-mode-hook
|
||||
#'(+lua|moonscript-fix-single-quotes
|
||||
+lua|moonscript-fontify-interpolation)))
|
||||
|
||||
|
||||
;;
|
||||
;;; Frameworks
|
||||
|
||||
(def-project-mode! +lua-love-mode
|
||||
:modes (lua-mode markdown-mode json-mode)
|
||||
:files (and "main.lua" "conf.lua")
|
||||
:modes (moonscript-mode lua-mode markdown-mode json-mode)
|
||||
:when #'+lua-love-project-root
|
||||
:on-load
|
||||
(progn
|
||||
(set-project-type! 'love2d
|
||||
:predicate #'+lua-love-project-root
|
||||
:run #'+lua/run-love-game)
|
||||
:run #'+lua-love-build-command)
|
||||
(map! :localleader
|
||||
:map +lua-love-mode-map
|
||||
"b" #'+lua/run-love-game)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue