Skip to content

Commit

Permalink
Fix input prompt not having whitespace (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
fthycl authored Jun 1, 2024
1 parent 2e114c8 commit 7a73b5b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/tasks/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function tasks.set_module_param(module_type, param_name)
if not param then
if vim.tbl_contains(module.params, param_name) then
-- Contains a string without a value, request for input
vim.ui.input({ prompt = string.format('Set "%s" for module "%s"', param_name, module_name), default = current_value }, function(input)
vim.ui.input({ prompt = string.format('Set "%s" for module "%s": ', param_name, module_name), default = current_value }, function(input)
project_config[module_name][param_name] = input
project_config:write()
end)
Expand Down
2 changes: 1 addition & 1 deletion lua/tasks/module/cmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ local function get_reply_dir(build_dir) return build_dir / '.cmake' / 'api' / 'v
---@return table
local function get_target_info(codemodel_target, reply_dir) return vim.json.decode((reply_dir / codemodel_target['jsonFile']):read()) end

--- Creates query files that to acess information about targets after CMake configuration.
--- Creates query files to access information about targets after CMake configuration.
---@param build_dir table
---@return boolean: Returns `true` on success.
local function make_query_files(build_dir)
Expand Down
6 changes: 6 additions & 0 deletions lua/tasks/runner.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local config = require('tasks.config')
local Job = require('plenary.job')
local utils = require('tasks.utils')
local runner = {}

local last_job
Expand Down Expand Up @@ -134,6 +135,11 @@ function runner.chain_commands(task_name, commands, module_config, addition_args
return
end

if vim.fn.executable(command.cmd) == 0 then
utils.notify(string.format('Command "%s" is not executable', command.cmd), vim.log.levels.ERROR)
return
end

local quickfix_output = not command.ignore_stdout or not command.ignore_stderr
local job = Job:new({
command = command.cmd,
Expand Down

0 comments on commit 7a73b5b

Please sign in to comment.