Skip to content

Commit

Permalink
[editing-visual] Fix problems with term-cursor in daemon mode
Browse files Browse the repository at this point in the history
Remove `lsp-ui-doc-frame-hook` from `term-cursor-triggers` to fix syl20bnr#15667. The
hook is run with two arguments, but the handler function
`term-cursor--immediate` does not expect any. (It can be added back in case
denrat/term-cursor.el#5 is merged and if it is still
deemed necessary.)

Also do not enable `global-term-cursor-mode` in daemon mode unless a terminal
frame is created.
  • Loading branch information
fnussbaum committed Sep 17, 2024
1 parent 06067c3 commit 4ac439a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions layers/+spacemacs/spacemacs-editing-visual/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@
(interactive)
(spacemacs/toggle-centered-buffer-on)
(spacemacs/centered-buffer-transient-state/body))

(defun spacemacs//maybe-enable-term-cursor ()
"Enable `global-term-cursor-mode' when a first terminal frame is created."
(unless (or (display-graphic-p)
(bound-and-true-p global-term-cursor-mode))
(global-term-cursor-mode)
(remove-hook 'server-after-make-frame-hook 'spacemacs//maybe-enable-term-cursor)))
7 changes: 5 additions & 2 deletions layers/+spacemacs/spacemacs-editing-visual/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,12 @@
(defun spacemacs-editing-visual/init-term-cursor ()
(use-package term-cursor
:defer t
:custom (term-cursor-triggers '(blink-cursor-mode-hook))
:init
(unless (display-graphic-p)
(global-term-cursor-mode))))
(unless (or (daemonp) (display-graphic-p))
(global-term-cursor-mode))
(when (or (daemonp) dotspacemacs-enable-server)
(add-hook 'server-after-make-frame-hook 'spacemacs//maybe-enable-term-cursor))))

(defun spacemacs-editing-visual/init-volatile-highlights ()
(use-package volatile-highlights
Expand Down

0 comments on commit 4ac439a

Please sign in to comment.