Skip to content

Commit

Permalink
fix: keep filename consistency with compiled outfile and prompt.
Browse files Browse the repository at this point in the history
  • Loading branch information
ayamir committed Nov 18, 2024
1 parent 70f9677 commit 572f6fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions lua/keymap/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ _G._async_compile_and_debug = function()
compile_cmd = string.format("gcc -g %s -o %s", file_path, out_name)
elseif file_ext == "go" then
compile_cmd = string.format("go build -o %s %s", out_name, file_path)
elseif file_ext == "java" then
compile_cmd = string.format("javac %s", file_path)
elseif file_ext == "rs" then
compile_cmd = string.format("rustc %s -o %s", file_path, out_name)
else
require("dap").continue()
return
Expand Down
6 changes: 5 additions & 1 deletion lua/modules/utils/dap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ function M.input_args()
end

function M.input_exec_path()
return vim.fn.input('Path to executable (default to "a.out"): ', vim.fn.expand("%:p:h") .. "/a.out", "file")
return vim.fn.input(
'Path to executable (default to "filename.out"): ',
vim.fn.expand("%:p:h") .. "/" .. vim.fn.expand("%:t:r") .. ".out",
"file"
)
end

function M.input_file_path()
Expand Down

0 comments on commit 572f6fa

Please sign in to comment.