Skip to content

Commit

Permalink
Merge pull request #138 from xiliuya/add-macos-config-support
Browse files Browse the repository at this point in the history
Set darwin's eglot config dir
  • Loading branch information
NathanLovato authored May 9, 2024
2 parents 4ae8760 + a6efb87 commit 32086df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion gdscript-eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ definitions of HOST, PORT, and INTERACTIVE.
For more context, see
https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-04/msg01070.html."
(save-excursion
(let* ((cfg-dir (or (getenv "XDG_CONFIG_HOME") "~/.config"))
(let* ((cfg-dir (or (getenv "XDG_CONFIG_HOME")
(pcase system-type
('darwin "~/Library/Application Support/Godot/")
('windows-nt "%APPDATA%\\Godot\\")
('gnu/linux "~/.config/"))))
(cfg-buffer
(find-file-noselect
(expand-file-name
Expand Down
6 changes: 4 additions & 2 deletions gdscript-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@
;;;###autoload
(with-eval-after-load 'eglot
(defvar eglot-server-programs)
(push (cons 'gdscript-mode #'gdscript-eglot-contact)
eglot-server-programs))
(unless (equal (alist-get 'gdscript-mode eglot-server-programs)
#'gdscript-eglot-contact)
(push (cons 'gdscript-mode #'gdscript-eglot-contact)
eglot-server-programs)))

(defvar gdscript-mode-map (let ((map (make-sparse-keymap)))
;; Movement
Expand Down

0 comments on commit 32086df

Please sign in to comment.