-
Notifications
You must be signed in to change notification settings - Fork 74
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
How to choose target when every build/run #222
Comments
You could use cmake.select_launch_target with a cmake_tools.run callback? vim.keymap.set("n", "<leader>dz", function()
cmake.select_launch_target(function()
vim.cmd("CMakeRun")
end)
end, { desc = "run with target select" }) is that good enough for You? of course the same could be done with selecting build target and debug, or even running the run function manually instead of the vim cmd, the code s Your oyster |
I don't quite understand where it should be located and where the |
wherever in Your config, you can create your own keymap or own vim cmd, the cmake variable is imported like this: |
Thanks a lot, everything worked out. But there is a new problem. I use toggleterm. For some reason, after the first command, if I run any other, I get the error: "A CMake task is already running". Although at the same time, the open terminal window closes.
|
Use the latest commit, it should work now. @loaf4 |
Thanks a lot! It works. |
The problem with the code:
When I try to launch And another question about And now it is impossible to launch :CMakeRun without using select_launch_target . I get a bunch of errors about the wrong window id many times:
|
select launch target does what it says selects LAUNCH target meaning when you debug or run using cmake.select_build_target(function()
vim.cmd("CMakeBuild")
end) and this will let You build all of your evecutables at once or just the one you need right now about Your problem with "You can't close the last tab. This will close Neovim" could You elaborate a bit? because i dont even know how i would go about reporoducing it. |
Could You share your config? Also are you using toggleterm as the runner? Can you try to use terminal as your runner if that is the case and check if anything changes? |
Basically, my config is almost completely default. But I use
And yes, you were right, problems occur only with the use of |
okay, so it seems that executor set to direction="tab" breaks things, i will try to deal with it, but You can just change executor direction for now, i'll post an update here later. |
Okay, thanks very much! |
i think it's the way toggleterm handles checking if its the last tab by |
ohhhhh, i think i understand, it goes something like this: |
But if you want tab to work in executor you can set close_on_exit in executor to false it should also work |
Sorry for the late reply. But I cannot reproduce this error with the same configuration. Edit: Maybe toggleterm fixed this? Can you test again? |
Yeah, I think this is the case. I guess they've already fix this problem. |
Can this issue be closed? |
Hi,
thanks for this project, I like it too much. I think it's more a question than a bug.
After the first build/run, when you have to select a target, the subsequent float window for selecting a target does not appear again. I want the target selection to appear every time after
:CMakeBuild
and:CMakeRun
commands. Maybe I'm stupid, but I don't understand how to activate this option? Thanks!The text was updated successfully, but these errors were encountered: