diff options
| author | Aotrix <[email protected]> | 2026-06-28 20:36:47 +0200 |
|---|---|---|
| committer | Aotrix <[email protected]> | 2026-06-28 20:36:47 +0200 |
| commit | 17a6ac77b6c346794f987efd74e48d5c13b20802 (patch) | |
| tree | 5dc2b290e1f48589e8aa37d1afb7b61da1cc449c | |
| parent | 69cd256e1a47864e029c8f67e2ec889562affddc (diff) | |
refactor build.lua
| -rw-r--r-- | lua/aotrix/build.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lua/aotrix/build.lua b/lua/aotrix/build.lua index 31f00e3..2e7d210 100644 --- a/lua/aotrix/build.lua +++ b/lua/aotrix/build.lua @@ -103,15 +103,15 @@ local selectCommand = function(listOfCommands, callback) end) end -vim.api.nvim_create_user_command("AddCommand", function() +local addCommand = function() local created_command = personalCommands.createCommand(COMMANDS) addCommandToJsonFile(created_command, PERSONAL_COMMAND_JSON_PATH, vim.fn.getcwd()) CURRENT_COMMAND = created_command.command executeCommandInTerminal(CURRENT_COMMAND) -end, {}) +end -vim.api.nvim_create_user_command("DeleteCommand", function() +local deleteCommand = function() local previous_command = CURRENT_COMMAND selectCommand(COMMANDS, function(choice) local index = 0 @@ -126,7 +126,11 @@ vim.api.nvim_create_user_command("DeleteCommand", function() end CURRENT_COMMAND = previous_command end) -end, {}) +end + +vim.api.nvim_create_user_command("AddCommand", addCommand, {}) + +vim.api.nvim_create_user_command("DeleteCommand", deleteCommand, {}) local executeCommand = function(listOfCommands) if (CURRENT_COMMAND == nil) then |
