Update init.lua
This commit is contained in:
@@ -18,12 +18,8 @@ end
|
||||
|
||||
-- Create a new Java project
|
||||
function M.create_project()
|
||||
-- Ensure the prompt is a string (to avoid invalid arguments)
|
||||
local prompt = "Enter project name: "
|
||||
|
||||
-- Use vim.fn.input to capture the input
|
||||
local project_name = vim.fn.input(prompt)
|
||||
|
||||
-- Use vim.ui.input for better handling of input
|
||||
vim.ui.input({ prompt = "Enter project name: " }, function(project_name)
|
||||
-- Debugging: Output the input received
|
||||
print("Input received: " .. (project_name or "nil"))
|
||||
|
||||
@@ -67,9 +63,11 @@ public class Main {
|
||||
else
|
||||
print("Error creating Main.java")
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- Create a new Java file
|
||||
function M.create_new_file()
|
||||
vim.ui.input({ prompt = "Enter class name: " }, function(class_name)
|
||||
|
||||
Reference in New Issue
Block a user