feat: change the loop so it asks first if you want to paste a file
This commit is contained in:
@@ -46,6 +46,12 @@ function M.run_chatgpt_command()
|
|||||||
vim.fn.input("") -- wait for user to press Enter
|
vim.fn.input("") -- wait for user to press Enter
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
|
local another = vim.fn.input("Do you want to paste another file? (y/n): ")
|
||||||
|
if another:lower() ~= "y" then
|
||||||
|
handler.finish()
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
-- Ask user for filepath
|
-- Ask user for filepath
|
||||||
local filepath = ""
|
local filepath = ""
|
||||||
while true do
|
while true do
|
||||||
@@ -77,12 +83,6 @@ function M.run_chatgpt_command()
|
|||||||
|
|
||||||
handler.write_file(filepath, filecontent)
|
handler.write_file(filepath, filecontent)
|
||||||
print("Wrote file: " .. filepath)
|
print("Wrote file: " .. filepath)
|
||||||
|
|
||||||
local another = vim.fn.input("Do you want to paste another file? (y/n): ")
|
|
||||||
if another:lower() ~= "y" then
|
|
||||||
handler.finish()
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user