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

Fix input prompt not having whitespace #24

Merged
merged 1 commit into from
Jun 1, 2024
Merged

Conversation

fthycl
Copy link
Contributor

@fthycl fthycl commented Jun 1, 2024

When running set_module_param, this PR changes the prompt from

Set "cmd" for module "cmake"cmake (no space, hard to read)

to

Set "cmd" for module "cmake": cmake.

It also returns early if the current cmd is not executable to avoid unnecessarily long error messages printed by plenary.job.

@@ -134,6 +134,14 @@ function runner.chain_commands(task_name, commands, module_config, addition_args
return
end

if vim.fn.executable(command.cmd) == 0 then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also check if command.cmd == nil here?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to have a nil here?..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hit that case while playing with the code, but it could be some temporary bug I introduced myself. I think this would only be possible if a module failed to define its command.

lua/tasks/runner.lua Outdated Show resolved Hide resolved
lua/tasks/runner.lua Outdated Show resolved Hide resolved
@fthycl fthycl requested a review from Shatur June 1, 2024 13:28
@Shatur Shatur merged commit 7a73b5b into Shatur:master Jun 1, 2024
2 checks passed
@fthycl fthycl deleted the fix-input branch June 1, 2024 16:19
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

Successfully merging this pull request may close these issues.

2 participants