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

treemacs-project-follow-mode and treemacs-follow-mode focusing to the project root rather than an open file when sidebar shown #1035

Closed
iamkarlson opened this issue Jun 17, 2023 · 2 comments

Comments

@iamkarlson
Copy link

iamkarlson commented Jun 17, 2023

Whenever sidebar is open with treemacs-toggle it's always focusing on the root of the project, rather than the currently open file.
image

It immediately sync once I navigate to the buffer but it means that whenever I open treemacs, I have to jump back and forth to make follow-mode works

@Alexander-Miller
Copy link
Owner

Whenever sidebar is open with treemacs-toggle it's always focusing on the root of the project, rather than the currently open file.

I don't seem to be able to reproduce that locally. In addition there is no treemacs-toggle command. You either mean something else, or it's a doom feature. I know that doom makes some additions to treemacs, and that it also pins the versions of its module dependencies.

So first we need to see if this has something to do with doom - can you still reproduce this bug when you install the latest version of treemacs as a normal package, and not a doom module? And if yes, what exactly are the steps to reproduce it, and what does your config look like?

@iamkarlson
Copy link
Author

You're right, with treemacs command it works fine. Doom has indeed a helper function that is called +treemacs-toggle and it's defined like this:

;;;###autoload
(defun +treemacs/toggle ()
  "Initialize or toggle treemacs.

Ensures that only the current project is present and all other projects have
been removed.

Use `treemacs' command for old functionality."
  (interactive)
  (require 'treemacs)
  (pcase (treemacs-current-visibility)
    (`visible (delete-window (treemacs-get-local-window)))
    (_ (if (doom-project-p)
           (treemacs-add-and-display-current-project)
         (treemacs)))))

I will make an issue to doomemacs. Thanks!

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

No branches or pull requests

2 participants