emacs-lsp / lsp-treemacs

lsp-mode :heart: treemacs
GNU General Public License v3.0
398 stars 47 forks source link

Make `lsp-treemacs-symbols` close the window if it's already opened #35

Open Ekleog opened 4 years ago

Ekleog commented 4 years ago

This would be consistent with upstream's treemacs function.

(I'm discovering the treemacs as well as lsp parts of emacs, and they all look great! just have a few weirdnesses to hammer out and… :))

minikN commented 3 years ago

How about this?

(defun db/lsp-treemacs-symbols-toggle ()
  "Toggle the lsp-treemacs-symbols buffer."
  (interactive)
  (if (get-buffer "*LSP Symbols List*")
      (kill-buffer "*LSP Symbols List*")
    (progn (lsp-treemacs-symbols)
           (other-window -1))))