Fix multiline params feature and auto-prefix
- Fix FB/function call parameter detection to prevent incorrect # prefixing - Preserve # prefix when filling multiline params - Add comma after first parameter and closing bracket on last param line - Fix Tab navigation to position cursor after :=/=> operators - Clean up dead code in multiline_params.lua - Add setup functions for multiline params feature in both scl and scl_lsp
This commit is contained in:
@@ -60,6 +60,7 @@ function M.setup(opts)
|
||||
}
|
||||
|
||||
M.setup_syntax(opts)
|
||||
M.setup_multiline_params()
|
||||
M.create_commands()
|
||||
|
||||
if opts.auto_prefix ~= false then
|
||||
@@ -131,6 +132,32 @@ function M.setup_auto_prefix()
|
||||
end
|
||||
end
|
||||
|
||||
function M.setup_multiline_params()
|
||||
local ok, mp = pcall(require, "scl.multiline_params")
|
||||
if not ok then
|
||||
vim.notify("SCL multiline_params module not found", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command("SCLMultilineParams", function()
|
||||
mp.fill_multiline_params()
|
||||
end, {})
|
||||
|
||||
vim.keymap.set("i", "<Space>mp", function()
|
||||
mp.fill_multiline_params()
|
||||
end, { noremap = true, silent = true, desc = "SCL: Fill multiline parameters" })
|
||||
|
||||
vim.keymap.set("i", "<Tab>", function()
|
||||
local ft = vim.bo.filetype
|
||||
if ft == "scl" or ft == "udt" then
|
||||
if mp.jump_to_next_param() then
|
||||
return ""
|
||||
end
|
||||
end
|
||||
return "<Tab>"
|
||||
end, { noremap = true, silent = true, desc = "SCL: Jump to next param or Tab" })
|
||||
end
|
||||
|
||||
function M.prefix_current_word()
|
||||
local ok, auto_prefix = pcall(require, "scl.auto_prefix")
|
||||
if ok then
|
||||
|
||||
Reference in New Issue
Block a user