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

buffer appearing in terminal #312

Closed
KELs7 opened this issue Jul 13, 2024 · 13 comments
Closed

buffer appearing in terminal #312

KELs7 opened this issue Jul 13, 2024 · 13 comments

Comments

@KELs7
Copy link

KELs7 commented Jul 13, 2024

Describe the bug

Clicking a deselected tab heading of a buffer when there is a terminal already opened causes the buffer to

appear in the terminal.

To Reproduce

Steps to reproduce the behavior:

  1. Open a file with neovim
  2. open a horizontal or vertical terminal (leader<A-h>/leader<A-v)
  3. click on the deselected tab heading

Expected behavior

Expectation is the terminal buffer should remain unchanged. The current buffer should not reappear in the terminal

Desktop

OS: Linux
Terminal: Alacritty
Version of Neovim: 0.10

nvchad-term-buffer-appearing-in-terminal-2024-07-13_10.25.51.mp4
@LeonardoMor
Copy link
Contributor

This is not a problem with NvChad. It's a Neovim issue. Take a look at stickybuff

@LeonardoMor
Copy link
Contributor

This is not a problem with NvChad. It's a Neovim issue. Take a look at stickybuff

It seems this was fixed in Neovim itself. See here. Not sure how to take advantage of the fix.

@KELs7
Copy link
Author

KELs7 commented Jul 21, 2024

This is not a problem with NvChad. It's a Neovim issue. Take a look at stickybuff

Oh ok thanks

@KELs7
Copy link
Author

KELs7 commented Jul 22, 2024

I am guessing

vim.bo[opts.buf].winfixbuf = true

somewhere in M.display can fix it.
Can someone test for me? I don't know how to work with nvchad locally. term plugin is a binary in base64 folder.

@siduck
Copy link
Member

siduck commented Jul 22, 2024

@KELs7 to make changes locally you can do this

image
and in your plugins table

{  "NvChad/ui", dev = true }
git clone https://github.com/NvChad/ui/ ~/projects/ui

@KELs7
Copy link
Author

KELs7 commented Jul 22, 2024

@siduck thank you for the direction

@KELs7
Copy link
Author

KELs7 commented Jul 22, 2024

image
Using vim.wo[win].winfixbuf = true fixes it.
placed it below this line

@KELs7
Copy link
Author

KELs7 commented Jul 22, 2024

Probably there should be a way to avoid showing that error message and also having to press continue

@KELs7
Copy link
Author

KELs7 commented Jul 22, 2024

That error is coming from tabufline/module on this line

@siduck
Copy link
Member

siduck commented Jul 22, 2024

@KELs7 thanks for your effort! wait, for a day or two i'll try to do this without winfixbuf

@siduck siduck closed this as completed in 1694282 Jul 24, 2024
@siduck
Copy link
Member

siduck commented Jul 24, 2024

M.term = {
  winopts = { winfixbuf = true },
}

seems like winfixbuf is the only way @KELs7 , just add the above code in your chadrc!

@KELs7
Copy link
Author

KELs7 commented Jul 28, 2024

M.term = {
  winopts = { winfixbuf = true },
}

seems like winfixbuf is the only way @KELs7 , just add the above code in your chadrc!

Thanks! But you forgot to add that you have to remove the dev property from { "NvChad/ui", dev = true } in ~/.config/nvim/init.lua . It was producing errors

@siduck
Copy link
Member

siduck commented Jul 28, 2024

obviously @KELs7 , that change was temporary and only for testing!

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

3 participants