File tree Expand file tree Collapse file tree 1 file changed +21
-8
lines changed
Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -227,15 +227,28 @@ mod.handlers = {
227227 PanelSolutionsDone = panel .handlers .PanelSolutionsDone ,
228228 statusNotification = status .handlers .statusNotification ,
229229 --- @param result copilot_open_url_data
230- [" copilot/openURL" ] = function (_ , result )
231- vim .api .nvim_echo ({
232- { " copilot/openURL" },
233- { vim .inspect ({ _ , result }) },
234- { " \n " , " NONE" },
235- }, true , {})
236- error (" not implemented: copilot.api.handlers['copilot/openURL']" )
237- end ,
230+ [" copilot/openURL" ] = function (_ , result )
231+ local success , _ = pcall (vim .ui .open , result .target )
232+ if not success then
233+ if vim .ui .open ~= nil then
234+ vim .api .nvim_echo ({
235+ { " copilot/openURL" },
236+ { vim .inspect ({ _ , result }) },
237+ { " \n " , " NONE" },
238+ }, true , {})
239+ error (" Unsupported OS: vim.ui.open exists but failed to execute." )
240+ else
241+ vim .api .nvim_echo ({
242+ { " copilot/openURL" },
243+ { vim .inspect ({ _ , result }) },
244+ { " \n " , " NONE" },
245+ }, true , {})
246+ error (" Unsupported Version: vim.ui.open requires Neovim > 0.10" )
247+ end
248+ end
249+ end
238250}
251+
239252mod .panel = panel
240253mod .status = status
241254
You can’t perform that action at this time.
0 commit comments