Skip to content

Commit be3e3ab

Browse files
fix: wrap nvim-cmp register_source in pcall
## Details Issue: #298 Unsure how exactly this can happen but apparently using `pcall(require, 'cmp')` on its own is not enough to check that the user has `nvim-cmp` installed with all associated methods. Fix is easy enough and wraps the `register_source` call in a pcall.
1 parent f0eb589 commit be3e3ab

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

doc/render-markdown.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For 0.10.0 Last change: 2025 January 14
1+
*render-markdown.txt* For 0.10.0 Last change: 2025 January 15
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*

lua/render-markdown/health.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local state = require('render-markdown.state')
55
local M = {}
66

77
---@private
8-
M.version = '7.8.7'
8+
M.version = '7.8.8'
99

1010
function M.check()
1111
M.start('version')

lua/render-markdown/integ/cmp.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function M.setup()
3535
if not has_cmp then
3636
return
3737
end
38-
cmp.register_source(Source:get_debug_name(), Source)
38+
pcall(cmp.register_source, Source:get_debug_name(), Source)
3939
end
4040

4141
return M

0 commit comments

Comments
 (0)