Skip to content

Commit 32086df

Browse files
authored
Merge pull request godotengine#138 from xiliuya/add-macos-config-support
Set darwin's eglot config dir
2 parents 4ae8760 + a6efb87 commit 32086df

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

gdscript-eglot.el

+5-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ definitions of HOST, PORT, and INTERACTIVE.
5252
For more context, see
5353
https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-04/msg01070.html."
5454
(save-excursion
55-
(let* ((cfg-dir (or (getenv "XDG_CONFIG_HOME") "~/.config"))
55+
(let* ((cfg-dir (or (getenv "XDG_CONFIG_HOME")
56+
(pcase system-type
57+
('darwin "~/Library/Application Support/Godot/")
58+
('windows-nt "%APPDATA%\\Godot\\")
59+
('gnu/linux "~/.config/"))))
5660
(cfg-buffer
5761
(find-file-noselect
5862
(expand-file-name

gdscript-mode.el

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656
;;;###autoload
5757
(with-eval-after-load 'eglot
5858
(defvar eglot-server-programs)
59-
(push (cons 'gdscript-mode #'gdscript-eglot-contact)
60-
eglot-server-programs))
59+
(unless (equal (alist-get 'gdscript-mode eglot-server-programs)
60+
#'gdscript-eglot-contact)
61+
(push (cons 'gdscript-mode #'gdscript-eglot-contact)
62+
eglot-server-programs)))
6163

6264
(defvar gdscript-mode-map (let ((map (make-sparse-keymap)))
6365
;; Movement

0 commit comments

Comments
 (0)