diff --git a/lua/blink/cmp/windows/documentation.lua b/lua/blink/cmp/windows/documentation.lua index 49338343..ace0c664 100644 --- a/lua/blink/cmp/windows/documentation.lua +++ b/lua/blink/cmp/windows/documentation.lua @@ -111,7 +111,7 @@ function docs.update_position() or config.direction_priority.autocomplete_south -- remove the direction priority of the signature window if it's open - if signature.win:is_open() then + if signature.win and signature.win:is_open() then direction_priority = vim.tbl_filter( function(dir) return dir ~= (autocomplete_win_is_up and 's' or 'n') end, direction_priority diff --git a/lua/blink/cmp/windows/lib/docs.lua b/lua/blink/cmp/windows/lib/docs.lua index 8ac94817..7deaa843 100644 --- a/lua/blink/cmp/windows/lib/docs.lua +++ b/lua/blink/cmp/windows/lib/docs.lua @@ -17,6 +17,13 @@ function docs.render_detail_and_documentation(bufnr, detail, documentation, max_ end end + -- don't show the detail if it's part of the documentation + local detail_str = table.concat(detail_lines, '\n') + local doc_str = table.concat(doc_lines, '\n') + if doc_str:find(detail_str, 1, true) then + detail_lines = {} + end + local combined_lines = vim.list_extend({}, detail_lines) -- add a blank line for the --- separator if #detail_lines > 0 and #doc_lines > 0 then table.insert(combined_lines, '') end