Skip to content

Neotree opens file buffer in terminal window when terminal window focused #802

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

Closed
airtonix opened this issue Mar 11, 2023 · 3 comments
Closed

Comments

@airtonix
Copy link

airtonix commented Mar 11, 2023

Your favourite mouth breathing, mouse using frontend developer peasant here.

Not sure if this is a problem with neo-tree, neovim, or just that I'm a filthy frontend developer, but:

  • be focused in a terminal window
  • use the unclean dirty mouse to move hover over the neotree window 😄
  • use the mouse to double click 😱 on a file
  • see that your terminal window is now a confusing not-a-terminal-window 😭

Should this be some kind of :

  • bug fix in neo-tree
  • an autocmd that something something something sprinkle-vim-sorcery force open in non-terminal window?
  • something else?
@cseickel
Copy link
Contributor

You finally convinced me to do something about this even though it doesn't matter to me one bit. I guess it's because your issue was entertaining and I just can't get enough of well placed emojis.

Anyhow, neo-tree will now avoid replacing certain buffers based on their filetypes. If you want to control which filetypes it will avoid, change this new config option:

require("neo-tree").setup({
  open_files_do_not_replace_filetypes = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes
})

@cseickel
Copy link
Contributor

Correction, now it will work, and the option has been renamed to:

require("neo-tree").setup({
  open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes
})

@airtonix
Copy link
Author

image

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

No branches or pull requests

2 participants