diff --git a/lua/mkdnflow/cmp.lua b/lua/mkdnflow/cmp.lua index 44781ec..2a1343f 100644 --- a/lua/mkdnflow/cmp.lua +++ b/lua/mkdnflow/cmp.lua @@ -110,6 +110,11 @@ source.new = function() end function source:complete(params, callback) + -- Only provide suggestions if the current word in the context starts with the trigger character '@' + if not params.context.cursor_before_line or not params.context.cursor_before_line:match('%W@%w*$') then + callback({}) + return + end local items = get_files_items() if bib_paths then -- For bib files, there are three lists (tables) in mkdnflow where we might find the paths for a bib file