Skip to content

Commit

Permalink
Add syntax-checking-auto-hide-tooltips variable to syntax-checking la…
Browse files Browse the repository at this point in the history
…yer.
  • Loading branch information
Martinsos committed Aug 25, 2020
1 parent 04b80d6 commit 3295b78
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.develop
Original file line number Diff line number Diff line change
Expand Up @@ -3314,6 +3314,7 @@ Other:
- Fixed =goto-flycheck-error-list= (thanks to Thanh Vuong)
- Added lsp support for sqls
- Added layer variable =sql-lsp-sqls-workspace-config-path= to setting workspace configuration
- Added layer variable =syntax-checking-auto-hide-tooltips= (thanks to Martin Sosic)
**** Swift
- Update Swift REPL key bindings (thanks to Elliot Bulmer)
**** Systemd
Expand Down
14 changes: 14 additions & 0 deletions layers/+checkers/syntax-checking/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [[#enable-flycheck-globally][Enable flycheck globally]]
- [[#enable-support-for-traditional-error-navigation][Enable support for traditional error navigation]]
- [[#bitmaps][Bitmaps]]
- [[#auto-hide-tooltips][Auto hide tooltips]]
- [[#key-bindings][Key bindings]]

* Description
Expand Down Expand Up @@ -93,6 +94,19 @@ variable =syntax-checking-use-original-bitmaps= to =t=:
'((syntax-checking :variables syntax-checking-use-original-bitmaps t)))
#+END_SRC


** Auto hide tooltips
You can set time in seconds after which tooltips are automatically hidden by setting
the variable =syntax-checking-auto-hide-tooltips= to a positive number of seconds.

Default value of =syntax-checking-auto-hide-tooltips= is =nil=, and in that case tooltips
are kept open until the cursor is moved.

#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
'((syntax-checking :variables syntax-checking-auto-hide-tooltips 10)))
#+END_SRC

* Key bindings

| Key binding | Description |
Expand Down
3 changes: 3 additions & 0 deletions layers/+checkers/syntax-checking/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
(defvar syntax-checking-enable-tooltips t
"If non nil some feedback are displayed in tooltips.")

(defvar syntax-checking-auto-hide-tooltips nil
"If non-nil and positive number, auto hide tooltips after number of seconds.")

(defvar syntax-checking-enable-by-default t
"Enable syntax-checking by default.")

Expand Down
3 changes: 2 additions & 1 deletion layers/+checkers/syntax-checking/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
:defer t
:init
(with-eval-after-load 'flycheck
(flycheck-pos-tip-mode))))
(flycheck-pos-tip-mode)
(setq flycheck-pos-tip-timeout (or syntax-checking-auto-hide-tooltips 0)))))

(defun syntax-checking/pre-init-popwin ()
(spacemacs|use-package-add-hook popwin
Expand Down

0 comments on commit 3295b78

Please sign in to comment.