From 2f133e087af58b0435f418c89630eb257c2fe10d Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Tue, 24 Oct 2023 17:49:55 -0400 Subject: [PATCH] nvim: mkdir debugger input folder --- src/.config/nvim/vimspector.vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/.config/nvim/vimspector.vim b/src/.config/nvim/vimspector.vim index 439fff6..fc133a4 100644 --- a/src/.config/nvim/vimspector.vim +++ b/src/.config/nvim/vimspector.vim @@ -28,9 +28,12 @@ nnoremap de :call vimspector#Reset() " write clipboard into input file function WriteInput() - let inputfile=$HOME .. "/.cache/termdebug/input/" .. expand("%:r") - echo "Input written to '" .. inputfile .. "'." + let inputfolder=$HOME .. "/.cache/termdebug/input/" .. expand("%:h") + silent exec "!mkdir -p " .. inputfolder + let inputfile=inputfolder .. "/" .. expand("%:t:r") call writefile(getreg('+', 1, 1), inputfile) + " for some reason this line causes a Press Enter to continue + "echo "Input written to '" .. inputfile .. "'." endfunction nnoremap rw :call WriteInput()