emacs-lsp / lsp-treemacs

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

Reusing a window with `treemacs-RET-action` #170

Open AndreasMatthias opened 10 months ago

AndreasMatthias commented 10 months ago
  1. I have opened several windows such that I need to press M-0 (bound to treemacs-select-window) several times before I get to the LSP Errors List window.
  2. I press <return> (treemacs-RET-action) on a file node in LSP Errors List.
  3. Lsp-treemacs opens this file in a window that seems to be the last window I travelled through be pressing M-0.
  4. Lsp-treemacs doesn't care if this file was already visible in another window. Thus the same file might be displayed in two or more windows.

This behavior is in contrast to Treemacs (Treemacs-Scoped-Buffer window). If a buffer is already visible in a certain window, treemacs jumps exactly to this window. It does not open the buffer twice.

The behavior of treemacs seems more natural to me than the one of lsp-treemacs.

Note: I have not modified treemacs-RET-action-config.