Civitasv/cmake-tools.nvim

Option to modify :CMakeRun behavior to send the full command but not the newline

Closed this issue · 5 comments

minego commented

Describe the problem or limitation you are having
The :CMakeRun command automatically executes the current target, without giving a chance to add arguments, etc.

Describe the solution you'd like
I'd like to have an option to modify the behavior of :CMakeRun to NOT append the \n (or \r on windows), so that when I run :CMakeRun (with the auto insert option on) I am left in a terminal with the command entered, so I can then type command line arguments or hit enter to run.

I started work on a branch to add this as a PR. It seems that adding an option that can be checked in terminal.send_data_to_terminal to prevent adding the \n or \r but it seems that doing it at that layer may cause side effects since that seems to be used by other parts of the plugin.

I'll continue working on it, but I am not sure when I'll have time.

You can use CMakeQuickRun or CMakeTargetSettings to set args for specific target.

minego commented

You can use CMakeQuickRun or CMakeTargetSettings to set args for specific target.

I am aware of that, and that works well but even when using that I'd like an option to review the command before hitting enter to run it. I understand that most people won't want this so I don't expect it to be the default.

minego commented

#185

This PR does what I was hoping for, and I'm really happy with the workflow when using it.

Fair enough. That's a feasible solution.

Fixed by #185.