Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with window #1128

Open
georgtree opened this issue Nov 3, 2024 · 6 comments
Open

Error with window #1128

georgtree opened this issue Nov 3, 2024 · 6 comments
Labels

Comments

@georgtree
Copy link

Hello!
I frequently got this error:

Window #<window 7 on fileName<projectName>> has same side left as window #<window 11 on  *Treemacs-Scoped-Buffer-No Tab*> but no common parent

it prevents from creating or removing windows, and I don't know how to get rid of it.
Config is:

(use-package treemacs
  :ensure t
  :defer t
  :init
  (with-eval-after-load 'winum
    (define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
  :config
  (progn
    (setq treemacs-collapse-dirs                   (if treemacs-python-executable 3 0)
          treemacs-deferred-git-apply-delay        0.01
          treemacs-directory-name-transformer      #'identity
          treemacs-display-in-side-window          t
          treemacs-eldoc-display                   'simple
          treemacs-file-event-delay                2000
          treemacs-file-extension-regex            treemacs-last-period-regex-value
          treemacs-file-follow-delay               0.01
          treemacs-file-name-transformer           #'identity
          treemacs-follow-after-init               t
          treemacs-expand-after-init               t
          treemacs-find-workspace-method           'find-for-file-or-pick-first
          treemacs-git-command-pipe                ""
          treemacs-goto-tag-strategy               'refetch-index
          treemacs-header-scroll-indicators        '(nil . "^^^^^^")
          treemacs-hide-dot-git-directory          t
          treemacs-indentation                     2
          treemacs-indentation-string              " "
          treemacs-is-never-other-window           t
          treemacs-max-git-entries                 5000
          treemacs-missing-project-action          'ask
          treemacs-move-files-by-mouse-dragging    t
          treemacs-move-forward-on-expand          nil
          treemacs-no-png-images                   nil
          treemacs-no-delete-other-windows         nil
          treemacs-project-follow-cleanup          nil
          treemacs-persist-file                    (expand-file-name ".cache/treemacs-persist" user-emacs-directory)
          treemacs-position                        'left
          treemacs-read-string-input               'from-child-frame
          treemacs-recenter-distance               0.1
          treemacs-recenter-after-file-follow      nil
          treemacs-recenter-after-tag-follow       nil
          treemacs-recenter-after-project-jump     'always
          treemacs-recenter-after-project-expand   'on-distance
          treemacs-litter-directories              '("/node_modules" "/.venv" "/.cask")
          treemacs-project-follow-into-home        nil
          treemacs-show-cursor                     nil
          treemacs-show-hidden-files               t
          treemacs-silent-filewatch                nil
          treemacs-silent-refresh                  nil
          treemacs-sorting                         'alphabetic-asc
          treemacs-select-when-already-in-treemacs 'move-back
          treemacs-space-between-root-nodes        t
          treemacs-tag-follow-cleanup              t
          treemacs-tag-follow-delay                1.5
          treemacs-text-scale                      nil
          treemacs-user-mode-line-format           nil
          treemacs-user-header-line-format         nil
          treemacs-wide-toggle-width               50
          treemacs-width                           50
          treemacs-width-increment                 1
          treemacs-width-is-initially-locked       t
          treemacs-workspace-switch-cleanup        nil)

    ;; The default width and height of the icons is 22 pixels. If you are
    ;; using a Hi-DPI display, uncomment this to double the icon size.
    ;;(treemacs-resize-icons 44)

    (treemacs-follow-mode t)
    (treemacs-filewatch-mode t)
    (treemacs-fringe-indicator-mode 'always)
    (when treemacs-python-executable
      (treemacs-git-commit-diff-mode t))

    (pcase (cons (not (null (executable-find "git")))
                 (not (null treemacs-python-executable)))
      (`(t . t)
       (treemacs-git-mode 'deferred))
      (`(t . _)
       (treemacs-git-mode 'simple)))

    (treemacs-hide-gitignored-files-mode nil))
  :bind
  (:map global-map
        ("M-0"       . treemacs-select-window)
        ("C-x t 1"   . treemacs-delete-other-windows)
        ("C-x t t"   . treemacs)
        ("C-x t d"   . treemacs-select-directory)
        ("C-x t B"   . treemacs-bookmark)
        ("C-x t C-t" . treemacs-find-file)
        ("C-x t M-t" . treemacs-find-tag)))

(use-package treemacs-evil
  :after (treemacs evil)
  :ensure t)

(use-package treemacs-projectile
  :after (treemacs projectile)
  :ensure t)

(use-package treemacs-icons-dired
  :hook (dired-mode . treemacs-icons-dired-enable-once)
  :ensure t)

(use-package treemacs-magit
  :after (treemacs magit)
  :ensure t)

(use-package treemacs-persp ;;treemacs-perspective if you use perspective.el vs. persp-mode
  :after (treemacs persp-mode) ;;or perspective vs. persp-mode
  :ensure t
  :config (treemacs-set-scope-type 'Perspectives))

(use-package treemacs-tab-bar ;;treemacs-tab-bar if you use tab-bar-mode
  :after (treemacs)
  :ensure t
  :config (treemacs-set-scope-type 'Tabs))

(add-hook 'emacs-startup-hook 'treemacs)

Thank you in advance

@georgtree
Copy link
Author

Error is similar too this issue:

#734

Copy link

stale bot commented Jan 2, 2025

This issue has been automatically marked as stale because it has not had recent activity (this bot only works as a reminder, it will not close issues).

@stale stale bot added the stale label Jan 2, 2025
@stale stale bot removed the stale label Jan 3, 2025
@Alexander-Miller
Copy link
Owner

The error indicates that something has gone very wrong in the state of your windows and put them into an invalid state. Treemacs does not do anything special - by default it just spawns as a side window. This behavior is controlled by treemacs-display-in-side-window.

You should be able to get out of this by spawning a new frame and closing the previous one.

Unfortunately I can't say what's causing this, probably some other package or mode that manipulates windows in a way that doesn't agree with side windows. The only one I know of is the builtin windmove, but that was patched some time ago.

If you use windmove updating treemacs should fix your issue. If not I will a reproduction recipe to help further.

@georgtree
Copy link
Author

I suspect that this is a conflict with centaur-tabs package - treemacs spawn new tabs, and if I click on it, the two treemacs windows appears at the same time.

@Alexander-Miller
Copy link
Owner

Use this to check if it's a general side-window problem:

(display-buffer-in-side-window (get-buffer-create "Test Buffer") '((side . left) (slot . 1)))

That will spawn a side-window the same way that treemacs does. If you experience the same issues as with treemacs then it's on centaur tabs to integrate with side-windows.

@Alexander-Miller
Copy link
Owner

I am also curious about *Treemacs-Scoped-Buffer-No Tab*. The name indicates that you're using treemacs' tab-bar integration. However, AFAIU centaur-tabs is it's own independent tabs provider. Your config also shows you adding treemacs-persp. These are contradictions, both packages decide what treemacs buffers are scoped to - the current tab, the current perspective, or, by default, the current frame.

It looks like you copied a bit too much from the example setup. I don't know what your setup is intended to look like, but you only need one, if any, extra scope package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants