File tree 1 file changed +26
-1
lines changed
1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,20 @@ M.start = function(silent)
51
51
end
52
52
end
53
53
54
+ local normal_commands = {
55
+ " abort" ,
56
+ " clear" ,
57
+ " context-files" ,
58
+ " provider" ,
59
+ " start-inline-edit" ,
60
+ " toggle" ,
61
+ }
62
+
63
+ local visual_commands = {
64
+ " start-inline-edit-selection" ,
65
+ " paste-selection" ,
66
+ }
67
+
54
68
M .bridge = function (channelId )
55
69
vim .api .nvim_create_user_command (
56
70
" Magenta" ,
@@ -60,7 +74,18 @@ M.bridge = function(channelId)
60
74
{
61
75
nargs = " +" ,
62
76
range = true ,
63
- desc = " Execute Magenta command"
77
+ desc = " Execute Magenta command" ,
78
+ complete = function (ArgLead , CmdLine )
79
+ local commands = CmdLine :match (" ^'<,'>" ) and visual_commands or normal_commands
80
+
81
+ if ArgLead == ' ' then
82
+ return commands
83
+ end
84
+ -- Filter based on ArgLead
85
+ return vim .tbl_filter (function (cmd )
86
+ return cmd :find (' ^' .. ArgLead )
87
+ end , commands )
88
+ end
64
89
}
65
90
)
66
91
You can’t perform that action at this time.
0 commit comments