mirror of
https://github.com/lewis6991/gitsigns.nvim
synced 2025-02-25 01:06:53 +00:00
Unglobal the command completion function
This commit is contained in:
parent
ef9da62883
commit
8b2b54de22
6
lua/gitsigns.lua
generated
6
lua/gitsigns.lua
generated
@ -709,7 +709,7 @@ local function add_debug_functions()
|
||||
end
|
||||
|
||||
|
||||
function gitsigns_complete(arglead, line)
|
||||
local function _complete(arglead, line)
|
||||
local n = #vim.split(line, '%s+')
|
||||
|
||||
local matches = {}
|
||||
@ -729,7 +729,7 @@ local function setup_command()
|
||||
vim.cmd(table.concat({
|
||||
'command!',
|
||||
'-nargs=+',
|
||||
'-complete=customlist,v:lua.gitsigns_complete',
|
||||
'-complete=customlist,v:lua.package.loaded.gitsigns._complete',
|
||||
'Gitsigns',
|
||||
'lua require("gitsigns")._run_func(<f-args>)',
|
||||
}, ' '))
|
||||
@ -945,6 +945,8 @@ M = {
|
||||
toggle_linehl = toggle_linehl,
|
||||
toggle_numhl = toggle_numhl,
|
||||
|
||||
_complete = _complete,
|
||||
|
||||
_current_line_blame = _current_line_blame,
|
||||
_current_line_blame_reset = _current_line_blame_reset,
|
||||
toggle_current_line_blame = toggle_current_line_blame,
|
||||
|
@ -709,7 +709,7 @@ local function add_debug_functions()
|
||||
end
|
||||
|
||||
-- Needs to be global so can be accessed from v:lua
|
||||
function gitsigns_complete(arglead: string, line: string): {string}
|
||||
local function _complete(arglead: string, line: string): {string}
|
||||
local n: integer = #vim.split(line, '%s+')
|
||||
|
||||
local matches: {string} = {}
|
||||
@ -729,7 +729,7 @@ local function setup_command()
|
||||
vim.cmd(table.concat({
|
||||
'command!',
|
||||
'-nargs=+',
|
||||
'-complete=customlist,v:lua.gitsigns_complete',
|
||||
'-complete=customlist,v:lua.package.loaded.gitsigns._complete',
|
||||
'Gitsigns',
|
||||
'lua require("gitsigns")._run_func(<f-args>)'
|
||||
}, ' '))
|
||||
@ -945,6 +945,8 @@ M = {
|
||||
toggle_linehl = toggle_linehl,
|
||||
toggle_numhl = toggle_numhl,
|
||||
|
||||
_complete = _complete,
|
||||
|
||||
_current_line_blame = _current_line_blame,
|
||||
_current_line_blame_reset = _current_line_blame_reset,
|
||||
toggle_current_line_blame = toggle_current_line_blame,
|
||||
|
Loading…
Reference in New Issue
Block a user