Bump :ui treemacs
Alexander-Miller/treemacs@10c96c9 -> Alexander-Miller/treemacs@5c01829 The new treemacs-add-and-display-current-project command does what the old +treemacs/toggle did, now we just need +treemacs/toggle to do-what-I-mean with respect to projects (if not in a project, treemacs-add-and-display-current-project unhelpfully aborts with an error).
This commit is contained in:
parent
bd6405673e
commit
383bc03f4c
4 changed files with 7 additions and 34 deletions
|
@ -180,7 +180,7 @@
|
|||
:desc "Find file in project sidebar" "P" #'+neotree/find-this-file)
|
||||
(:when (featurep! :ui treemacs)
|
||||
:desc "Project sidebar" "p" #'+treemacs/toggle
|
||||
:desc "Find file in project rsidebar" "P" #'+treemacs/find-file)
|
||||
:desc "Find file in project rsidebar" "P" #'treemacs-find-file)
|
||||
(:when (featurep! :term shell)
|
||||
:desc "Toggle shell popup" "t" #'+shell/toggle
|
||||
:desc "Open shell here" "T" #'+shell/here)
|
||||
|
@ -541,4 +541,4 @@
|
|||
;;; treemacs
|
||||
(:when (featurep! :ui treemacs)
|
||||
"<f9>" #'+treemacs/toggle
|
||||
"<C-f9>" #'+treemacs/find-file))
|
||||
"<C-f9>" #'treemacs-find-file))
|
||||
|
|
|
@ -526,7 +526,7 @@
|
|||
:desc "Find file in project sidebar" "P" #'+neotree/find-this-file)
|
||||
(:when (featurep! :ui treemacs)
|
||||
:desc "Project sidebar" "p" #'+treemacs/toggle
|
||||
:desc "Find file in project sidebar" "P" #'+treemacs/find-file)
|
||||
:desc "Find file in project sidebar" "P" #'treemacs-find-file)
|
||||
(:when (featurep! :term shell)
|
||||
:desc "Toggle shell popup" "t" #'+shell/toggle
|
||||
:desc "Open shell here" "T" #'+shell/here)
|
||||
|
|
|
@ -1,24 +1,5 @@
|
|||
;;; ui/treemacs/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defun +treemacs--init ()
|
||||
(require 'treemacs)
|
||||
(let ((origin-buffer (current-buffer)))
|
||||
;; Toggle treemacs without prompting for the first project.
|
||||
(cl-letf (((symbol-function 'treemacs-workspace->is-empty?)
|
||||
(symbol-function 'ignore)))
|
||||
(treemacs--init))
|
||||
(unless (bound-and-true-p persp-mode)
|
||||
(dolist (project (treemacs-workspace->projects (treemacs-current-workspace)))
|
||||
(treemacs-do-remove-project-from-workspace project)))
|
||||
(with-current-buffer origin-buffer
|
||||
(let ((project-root (or (doom-project-root) default-directory)))
|
||||
(treemacs-do-add-project-to-workspace
|
||||
(treemacs--canonical-path project-root)
|
||||
(doom-project-name project-root)))
|
||||
(setq treemacs--ready-to-follow t)
|
||||
(when (or treemacs-follow-after-init treemacs-follow-mode)
|
||||
(treemacs--follow)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +treemacs/toggle ()
|
||||
"Initialize or toggle treemacs.
|
||||
|
@ -28,16 +9,8 @@ been removed.
|
|||
|
||||
Use `treemacs' command for old functionality."
|
||||
(interactive)
|
||||
(require 'treemacs)
|
||||
(pcase (treemacs-current-visibility)
|
||||
(`visible (delete-window (treemacs-get-local-window)))
|
||||
(_ (+treemacs--init))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +treemacs/find-file (arg)
|
||||
"Open treemacs (if necessary) and find current file."
|
||||
(interactive "P")
|
||||
(let ((origin-buffer (current-buffer)))
|
||||
(+treemacs--init)
|
||||
(with-current-buffer origin-buffer
|
||||
(treemacs-find-file arg))))
|
||||
(_ (if (doom-project-p)
|
||||
(treemacs-add-and-display-current-project)
|
||||
(treemacs)))))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; ui/treemacs/packages.el
|
||||
|
||||
(package! treemacs :pin "10c96c9cd9e06f1bff7a708987861a8e73480647")
|
||||
(package! treemacs :pin "5c01829fe07ec96a74b6f9c2728933e6aff66324")
|
||||
;; These packages have no :pin because they're in the same repo
|
||||
(when (featurep! :editor evil +everywhere)
|
||||
(package! treemacs-evil))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue