File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,12 @@ local function accept(item)
43
43
-- todo: since we apply the additional text edits after, auto imported functions will not
44
44
-- get auto brackets. If we apply them before, we have to modify the textEdit to compensate
45
45
brackets_lib .add_brackets_via_semantic_token (vim .bo .filetype , item , function ()
46
+ require (' blink.cmp.trigger.completion' ).show_if_on_trigger_character ()
46
47
require (' blink.cmp.trigger.signature' ).show_if_on_trigger_character ()
47
48
text_edits_lib .apply_additional_text_edits (item )
48
49
end )
49
50
else
51
+ require (' blink.cmp.trigger.completion' ).show_if_on_trigger_character ()
50
52
require (' blink.cmp.trigger.signature' ).show_if_on_trigger_character ()
51
53
text_edits_lib .apply_additional_text_edits (item )
52
54
end
Original file line number Diff line number Diff line change @@ -152,6 +152,14 @@ function trigger.suppress_events_for_callback(cb)
152
152
and is_insert_mode
153
153
end
154
154
155
+ function trigger .show_if_on_trigger_character ()
156
+ local cursor_col = vim .api .nvim_win_get_cursor (0 )[2 ]
157
+ local char_under_cursor = vim .api .nvim_get_current_line ():sub (cursor_col , cursor_col )
158
+ local is_on_trigger = vim .tbl_contains (sources .get_trigger_characters (), char_under_cursor )
159
+ if is_on_trigger then trigger .show ({ trigger_character = char_under_cursor }) end
160
+ return is_on_trigger
161
+ end
162
+
155
163
--- @param opts { trigger_character ?: string , send_upstream ?: boolean , force ?: boolean } | nil
156
164
function trigger .show (opts )
157
165
opts = opts or {}
You can’t perform that action at this time.
0 commit comments