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