File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ function trigger.activate()
80
80
end
81
81
end ,
82
82
on_insert_leave = function () trigger .hide () end ,
83
- on_complete_changed = function () end ,
83
+ on_complete_changed = function () require ( ' blink.cmp.signature.window ' ). update_position () end ,
84
84
})
85
85
86
86
if config .show_on_accept then
Original file line number Diff line number Diff line change @@ -130,6 +130,14 @@ function signature.update_position()
130
130
direction_priority = menu_win_is_up and { ' s' } or { ' n' }
131
131
end
132
132
133
+ -- same for popupmenu, we want to place the signature window on the opposite side
134
+ local popupmenu_pos = vim .fn .pum_getpos ()
135
+ if popupmenu_pos .row ~= nil then
136
+ local cursor_screen_row = vim .fn .winline ()
137
+ local popupmenu_is_up = popupmenu_pos .row - cursor_screen_row < 0
138
+ direction_priority = popupmenu_is_up and { ' s' } or { ' n' }
139
+ end
140
+
133
141
local pos = win :get_vertical_direction_and_height (direction_priority , config .max_height )
134
142
135
143
-- couldn't find anywhere to place the window
You can’t perform that action at this time.
0 commit comments