Closed i-terzic closed 8 months ago
Will give this a look and try to fix.
https://github.com/ej-shafran/compile-mode.nvim/assets/91913247/177348b7-d07d-4fba-85e9-2314ddee265e
I hope this video illustrates the issue fine. :)
Just checking - are you using the same_window_errors
config option? Maybe check it out and see if it's what you're looking for?
Sort of, is there an (automatic) option to use/open the respective buffer below the compilation output to keep the info of the compilations errors open? When running :Compile
and :NextError
e.g. while Netrw
is open the info of the errors is lost. I guess it will be more of a convenience feature, than a bug. I would expect the temporary buffer to stay at the top and open, and :NextError
to open the respecive buffer/location below.
I think retaning the focus on the buffer in which you run the command in combination with same_window_errors
should fix the issue right there. Maybe adding that as a configuration option for that will improve the convenience (in my opinion). What do you think of that idea?
I see... So what you're looking for would be like the behavior of
:Compile
with your command:NextError
thereSuch that the top window shows the compilation buffer, and the bottom window shows the location of the error?
Actually, i'm looking for the option that the compilation buffer will stay open when i run :NextError
, so if there are multiple compilation errors, i don't loose sight of whats the issue there. Since the buffer is opened vertically on top, i would expect :NextError
to open the repective malicious code in the window below and keep the compilation buffer open at the same time.
Well, with same_window_errors
, :NextError
opens the error in the buffer which the cursor is currently on.
How about trying:
autocmd FileType compilation wincmd w
or
vim.api.nvim_create_autocmd("FileType", {
pattern = "compilation",
command = "wincmd w",
})
To not switch focus to the compilation buffer once its created? Try it and see if it fits what you're looking for?
Thats exactly what i was looking for. Thank you for the support!
Describe the bug The respectable error causing code is opened in different buffers. Switching between top and bottom in my case.
To Reproduce Steps to reproduce the behavior:
:Recompile
or:Compile
Note: There should be more than 2 compilation warnings/errors:NextError
multiple timesExpected behavior The errors should be opened in the same window/buffer and not jump arround from top to bottom and so on. Also i would expect the compilation errors (the temporary buffer) to stay open for further error information.
Screenshots If applicable, add screenshots to help explain your problem.
Neovim Version Include the result of
nvim -v
:compile-mode.nvim Version Specify what version of
compile-mode.nvim
you are using.Additional context Add any other context about the problem here.
I use
make
andcc
for compiling the code. Also i am running neovim inside WSL.C code for testing: