Skip to content

Commit

Permalink
fix: misc
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Oct 7, 2024
1 parent 876707f commit 5f4db7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/blink/cmp/sources/snippets/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
--- @param extended_filetypes table<string, string[]>
--- @param ignored_filetypes string[]

local utils = require('blink.cmp.utils')
local snippets = {}

--- @param opts blink.cmp.SnippetsOpts
Expand Down Expand Up @@ -32,10 +33,11 @@ function snippets:get_completions(_, callback)
end
end

local copied_items = vim.tbl_map(function(item) return utils.shallow_copy(item) end, self.cache[filetype])
callback({
is_incomplete_forward = false,
is_incomplete_backward = false,
items = self.cache[filetype],
items = copied_items,
})
end

Expand Down
1 change: 1 addition & 0 deletions lua/blink/cmp/trigger/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function trigger.activate_autocmds()
local cursor_col = vim.api.nvim_win_get_cursor(0)[2]
local char_under_cursor = vim.api.nvim_get_current_line():sub(cursor_col, cursor_col)
local is_on_trigger = vim.tbl_contains(sources.get_trigger_characters(), char_under_cursor)
and not vim.tbl_contains(config.show_on_insert_blocked_trigger_characters, char_under_cursor)
local is_on_context_char = char_under_cursor:match(config.keyword_regex) ~= nil

if is_within_bounds or (is_on_trigger and trigger.context ~= nil) then
Expand Down

0 comments on commit 5f4db7a

Please sign in to comment.