@@ -36,37 +36,71 @@ end, {
36
36
end ,
37
37
})
38
38
39
- vim .api .nvim_create_user_command (" AiderHealth" , function ()
40
- require (" nvim_aider.api" ).health_check ()
41
- end , { desc = " Run nvim-aider health check" })
39
+ -- Track which deprecation warnings have been shown
40
+ local deprecated_shown = {}
42
41
43
- vim .api .nvim_create_user_command (" AiderTerminalToggle" , function ()
44
- require (" nvim_aider.api" ).toggle_terminal ()
45
- end , { desc = " Toggle Aider terminal" })
42
+ -- Create a wrapper function for deprecated commands
43
+ local function create_deprecated_handler (cmd , replacement , handler )
44
+ return function (opts )
45
+ if not deprecated_shown [cmd ] then
46
+ vim .notify (
47
+ (" `%s` is deprecated and will be removed in future versions - use `%s` instead" ):format (cmd , replacement ),
48
+ vim .log .levels .WARN ,
49
+ { title = " nvim-aider" }
50
+ )
51
+ deprecated_shown [cmd ] = true
52
+ end
53
+ handler (opts )
54
+ end
55
+ end
46
56
47
- vim .api .nvim_create_user_command (" AiderTerminalSend" , function (args )
48
- require (" nvim_aider.api" ).send_to_terminal (args .args )
49
- end , { nargs = " ?" , range = true , desc = " Send text to Aider terminal" })
57
+ vim .api .nvim_create_user_command (
58
+ " AiderHealth" ,
59
+ create_deprecated_handler (" AiderHealth" , " Aider health" , function ()
60
+ require (" nvim_aider.api" ).health_check ()
61
+ end ),
62
+ { desc = " Run nvim-aider health check" }
63
+ )
50
64
51
- vim .api .nvim_create_user_command (" AiderQuickSendCommand" , function ()
52
- require (" nvim_aider.api" ).open_command_picker ()
53
- end , { desc = " Send Aider slash command to Aider terminal" })
65
+ vim .api .nvim_create_user_command (
66
+ " AiderTerminalToggle" ,
67
+ create_deprecated_handler (" AiderTerminalToggle" , " Aider toggle" , function ()
68
+ require (" nvim_aider.api" ).toggle_terminal ()
69
+ end ),
70
+ { desc = " Toggle Aider terminal" }
71
+ )
54
72
55
- vim .api .nvim_create_user_command (" AiderQuickSendBuffer" , function ()
56
- require (" nvim_aider.api" ).send_buffer_with_prompt ()
57
- end , { desc = " Send buffer to Aider terminal" })
73
+ vim .api .nvim_create_user_command (
74
+ " AiderTerminalSend" ,
75
+ create_deprecated_handler (" AiderTerminalSend" , " Aider send" , function (args )
76
+ require (" nvim_aider.api" ).send_to_terminal (args .args )
77
+ end ),
78
+ { nargs = " ?" , range = true , desc = " Send text to Aider terminal" }
79
+ )
58
80
59
- vim .api .nvim_create_user_command (" AiderQuickAddFile" , function ()
60
- require (" nvim_aider.api" ).add_current_file ()
61
- end , { desc = " Add current file to Aider session" })
81
+ vim .api .nvim_create_user_command (
82
+ " AiderQuickSendCommand" ,
83
+ create_deprecated_handler (" AiderQuickSendCommand" , " Aider command" , function ()
84
+ require (" nvim_aider.api" ).open_command_picker ()
85
+ end ),
86
+ { desc = " Send Aider slash command to Aider terminal" }
87
+ )
62
88
63
- vim .api .nvim_create_user_command (" AiderQuickDropFile" , function ()
64
- require (" nvim_aider.api" ).drop_current_file ()
65
- end , { desc = " Remove current file from Aider session" })
89
+ vim .api .nvim_create_user_command (
90
+ " AiderQuickSendBuffer" ,
91
+ create_deprecated_handler (" AiderQuickSendBuffer" , " Aider buffer" , function ()
92
+ require (" nvim_aider.api" ).send_buffer_with_prompt ()
93
+ end ),
94
+ { desc = " Send buffer to Aider terminal" }
95
+ )
66
96
67
- vim .api .nvim_create_user_command (" AiderQuickReadOnlyFile" , function ()
68
- require (" nvim_aider.api" ).add_read_only_file ()
69
- end , { desc = " Add current file as read-only to Aider session" })
97
+ vim .api .nvim_create_user_command (
98
+ " AiderQuickAddFile" ,
99
+ create_deprecated_handler (" AiderQuickAddFile" , " Aider add" , function ()
100
+ require (" nvim_aider.api" ).add_current_file ()
101
+ end ),
102
+ { desc = " Add current file to Aider session" }
103
+ )
70
104
71
105
-- Add nvim-tree integration commands if available
72
106
local ok , _ = pcall (require , " nvim-tree" )
0 commit comments