update packages
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
;;; treemacs.el --- A tree style file viewer package -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2020 Alexander Miller
|
||||
;; Copyright (C) 2021 Alexander Miller
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
@@ -52,9 +52,9 @@
|
||||
(when (boundp 'indent-guide-inhibit-modes)
|
||||
(push 'treemacs-mode indent-guide-inhibit-modes)))
|
||||
|
||||
(defun persp-after-load ()
|
||||
(with-eval-after-load 'persp-mode
|
||||
(defun treemacs--remove-treemacs-window-in-new-frames (persp-activated-for)
|
||||
(when (or t(eq persp-activated-for 'frame))
|
||||
(when (eq persp-activated-for 'frame)
|
||||
(-when-let (w (--first (treemacs-is-treemacs-window? it)
|
||||
(window-list)))
|
||||
(unless (assoc (treemacs-scope->current-scope treemacs--current-scope-type) treemacs--scope-storage)
|
||||
@@ -64,12 +64,16 @@
|
||||
(add-to-list 'persp-activated-functions #'treemacs--remove-treemacs-window-in-new-frames)
|
||||
(treemacs-log-failure "`persp-activated-functions' not defined - couldn't add compatibility.")))
|
||||
|
||||
(with-eval-after-load 'persp-mode
|
||||
(persp-after-load))
|
||||
|
||||
(with-eval-after-load 'perspective
|
||||
(persp-after-load))
|
||||
|
||||
(defun treemacs--remove-treemacs-window-in-new-frames (&rest _)
|
||||
(-when-let (w (--first (treemacs-is-treemacs-window? it)
|
||||
(window-list)))
|
||||
(unless (assoc (treemacs-scope->current-scope treemacs--current-scope-type) treemacs--scope-storage)
|
||||
(delete-window w))))
|
||||
(declare-function treemacs--remove-treemacs-window-in-new-frames "treemacs-compatibility")
|
||||
(if (boundp 'persp-activated-hook)
|
||||
(add-to-list 'persp-activated-hook #'treemacs--remove-treemacs-window-in-new-frames)
|
||||
(treemacs-log-failure "`persp-activated-hook' not defined - couldn't add compatibility.")))
|
||||
|
||||
(defun treemacs--split-window-advice (original-split-function &rest args)
|
||||
"Advice to make sure window splits are sized correctly with treemacs.
|
||||
@@ -107,6 +111,27 @@ width of the new window when the treemacs window is visible."
|
||||
(when (boundp 'evil-escape-excluded-major-modes)
|
||||
(add-to-list 'evil-escape-excluded-major-modes 'treemacs-mode)))
|
||||
|
||||
(defun treemacs-load-all-the-icons-with-workaround-font (font)
|
||||
"Load the `treemacs-all-the-icons' package using a workaround FONT for tabs.
|
||||
Use this if you experience the issue of icons jumping around when they are
|
||||
closed or opened which can appear when using specific fonts.
|
||||
|
||||
FONT should be a simple string name, for example \"Hermit\".
|
||||
|
||||
Finding the right FONT is a matter of trial and error, you can quickly try
|
||||
different fonts using `set-frame-font'.
|
||||
|
||||
The workaround will overwrite the values for `treemacs-indentation' and
|
||||
`treemacs-indentation-string', using your own values for them is no longer
|
||||
possible.
|
||||
|
||||
Can only work if the `treemacs-all-the-icons' module has not been loaded yet."
|
||||
(defvar treemacs-all-the-icons-tab-font font)
|
||||
(setf treemacs-indentation 1
|
||||
treemacs-indentation-string (propertize "\t" 'face `((:family ,treemacs-all-the-icons-tab-font))))
|
||||
(require 'treemacs-all-the-icons)
|
||||
(treemacs-load-theme "all-the-icons"))
|
||||
|
||||
(provide 'treemacs-compatibility)
|
||||
|
||||
;;; treemacs-compatibility.el ends here
|
||||
|
||||
Reference in New Issue
Block a user