Skip to content

Commit 9dbf6e2

Browse files
committed
Squashed 'vendor/plugins/nvim-cmp/' changes from b5311ab3..d78fb3b6
d78fb3b6 feat: max_height for completion window (#2202) REVERT: b5311ab3 fix missing required fields in formatting config (#2040) REVERT: 684b3cf5 Format with stylua REVERT: 30d25932 fix: handle winborder in neovim-0.11 (#2150) REVERT: 059e8949 fix: ref-fix backward compatibility REVERT: 3fce8d97 improve backward compatibility REVERT: c4c784a6 don't use deprecated functions REVERT: 1e1900b0 Preserve 'buflisted' state when applying LSP text edits (#2141) REVERT: c2737070 Fix typos (#2135) REVERT: 5a116824 Format with stylua REVERT: 1deeb87b fix(utils): Only call callback if type(callback) == "function" (#2038) REVERT: 12509903 fix: Outdated completion item with mini.snippets (#2126) REVERT: 8c82d0bd fix: enable sort_text comparator by default (#2122) REVERT: 2c35020d fixup! fix: remove deprecated use of vim.tbl_add_reverse_lookup (#1931) (#1991) REVERT: 5a9ad0d8 Fix completion menu showing over the cmd win (#1904) REVERT: 28ab7f7d use only the specified field's width for the window width REVERT: 4c1ca826 Mark vimscript block as "vim" (#2121) REVERT: b555203c fix: make <M-`> work again (#2107) REVERT: 8c447245 fix: typo in view.lua (#2103) REVERT: 98e8b9d5 expose latest response for creating compat layer REVERT: 3403e2e9 Format with stylua REVERT: 1d572527 add `cmp.get_registered_sources` and `CmpRegisterSource` /`CmpUnregisterSource` autocmd. REVERT: ca4d3330 fix: some symbols can't be mapped correctly (#2081) REVERT: ed31156a use vim.loop if vim.uv is not defined REVERT: 746896cb use `vim.uv.hrtime` instead of `os.clock` REVERT: be7bd4c5 fix: scrollbar thumb ui issue (#2068) REVERT: 2d7e6da1 Format with stylua REVERT: 6fade6db fix: make <C-'> work again (#2093) REVERT: 40a03dc2 fix: make <c-,> and <c-:> work again (#2092) REVERT: f17d9b43 support cpying self-referenced table (#2076) REVERT: 7d405106 fix: make <c-;> work again (#2073) REVERT: 29fb4854 feat: allow more completion highlight control (#1972) REVERT: 88661b7c Format with stylua REVERT: 19bd8c7c fix: use \<* notation for keymap.normalize (#2069) REVERT: 5d0651c9 fix: don't blow up when `nvim_buf_get_lines()` returns Blobs (#2050) REVERT: 2c93d5e7 perf: use builtin for key normalization (#1935) REVERT: 82bd4b59 Avoid calling del_extmark on non existing buffer (#2053) REVERT: cc683345 Format with stylua REVERT: 07f3f005 add performance.filtering_context_budget fixes #2060 REVERT: c183f45f Format with stylua REVERT: 1a1d7ecb perf: improve for source providing huge list of items (#1980) REVERT: ae644feb Add newer fallback method for tree-sitter scopes (#2006) REVERT: d818fd06 fix(view): check in get_selected_index (#1993) REVERT: e1757aea feat(view): add api get_selected_index (#1986) REVERT: 7e348da6 fix(feedkeys): resolve issue with some copilot completions (#1981) REVERT: a110e12d enable ghost_text for multi-line completions (#1886) REVERT: 5260e5e8 use nvim_get_option_value instead of nvim{,_buf,_win}_get_option REVERT: abacd4cb Move to non deprecated function calls (#1930) REVERT: 31a2939e fix: remove deprecated use of vim.tbl_add_reverse_lookup (#1931) REVERT: 24122371 fix: `cmp.close()` when `autocompletion = false` (#1921) REVERT: 1d88772d fix: unexpected behavior when `autocomplete = false` (#1920) REVERT: cd2cf0c1 Docs: fix README.md by adding setup for cmp-git (#1914) REVERT: 8f3c5414 perf: don't eagerly load vim.snippet (#1896) REVERT: ce16de56 support snippet item in ghost_text REVERT: 72403621 support snippet item in ghost_text REVERT: 2fb2a3cf docs: update and fix `view` documentation (#1868) REVERT: b9fd19fa fix #1649 REVERT: 7aa3f719 feat: add option for view to follow cursor (#1727) REVERT: 97dc716f feat: make winblend configurable (#1861) REVERT: c34fa793 re-improve resolve behavior REVERT: 6ed1c934 follow VSCode resolve logic (#1857) REVERT: 630cdf7d fix #1858 REVERT: be50b239 Format with stylua REVERT: b7b2c126 - fix ci - fix #1780 REVERT: b356f2c8 Allow window.documentation.max_{width, height} to be set to 0 (#1394) REVERT: 43b460a2 Favor existing values in completion_item over resovled_completion_item (#1725) REVERT: 13451e7e docs: fix invalid WindowConfig schema, should match to the docs (#1779) REVERT: 66f0a031 feat: default to `vim.snippet` for snippet expansion if available (#1820) REVERT: 763c720d fix(ghost_text): make sure to the delete the mark for the same buffer (#1826) REVERT: 53d80d4d fix: small windows no longer constantly throw errors (#1824) REVERT: 6460f979 Add option for symbol matching logic. (#1515) REVERT: a1b4ef08 feat: avoid global variable use (#1813) REVERT: 04e0ca37 fix: one more item than max_item_count is displayed (#1811) REVERT: 538e37ba feat(ci): update luarocks-tag-release to latest version (#1776) REVERT: 41d7633e feat: sort source entries before slicing when using max_item_count (#1765) REVERT: 5e1fa025 Fix: Buffer is not 'modifiable' (#1677) REVERT: 55734c8b feat: match default border color to standard neovim float border hl (#1689) REVERT: a70bdcfe Fixed typos in cmp.txt file (#1730) REVERT: c01a0384 Mark non-required setup fields as optional (#1723) REVERT: 36eb3a69 add test-case placeholders REVERT: 82ba05c7 Fix fuzzy matcher adding invalid matches (#909) (#1420) REVERT: 0b751f6b fix(ghost_text): ephemeral-like inline ghost-text workaround (#1688) REVERT: 51260c02 fix: remove usages from vim.lsp.util.parse_snippet (#1734) REVERT: d3a30562 ci: fix broken tests (#1729) REVERT: 5dce1b77 Format with stylua REVERT: 026ef944 docs: Add comments and type annotations for sorting comparators (#1687) REVERT: 51f1e11a fix(ghost_text): `ephemeral` causes a false positive of no inline support (#1645) REVERT: 969c5aff perf(core): simplify and improve `find_line_suffix()` (#1675) REVERT: 992fa0dd Format with stylua REVERT: 1c03ebc7 feat: add toggle_doc functionality (#1647) REVERT: 3b9f2806 add context check for invalid detection REVERT: 6c84bc75 implement is_invalid detection REVERT: c4e491a8 perf: fix `nvim_replace_termcodes` being called on every `CursorMoved` (#1650) REVERT: 2743dd98 improve pattern handling REVERT: e1f1b407 Format with stylua REVERT: 9e49ed3f fix confirm resolve REVERT: 8a1694ff Expand docs for select_next_item select_prev_item (#1626) REVERT: fa492591 fix type of the config.autocomplete to accept false (#1624) REVERT: b8c2a62b Update ghost_text type to allow true (#1616) REVERT: 69e7d280 Format with stylua REVERT: 48c0bc7e fix: huge single line performance (#1433) (#1615) REVERT: 09ff53ff Format with stylua REVERT: 559b688c restore max_item_count REVERT: 6f118169 fix(async): properly trigger callbacks when canceling and fix delays in `throttle.sync` (#1611) REVERT: b5a636d4 Improve types related to mapping definitions (#1604) REVERT: a2198e3d fix: handle godot LSP better (#1592) REVERT: fc0f694a Updating documentation as cmp_git source as been moved to git (#1603) REVERT: b43bfaf3 fix(entry): fix matches highlight information fixes #1426 REVERT: 3874e09e fix(entry): remove offset + 1 for tailwindcss REVERT: 1088b374 Add extmark inline feature detection REVERT: 15e8a636 Restore schedule_wrap REVERT: a0225043 fix entry highlight in complete-menu (#1593) REVERT: 8a3d2dd7 Remove max_item_count from source configuration REVERT: abb5c751 feat: cmp async (#1583) REVERT: 950d0e3a ghost text inline (#1588) REVERT: 799392ac Fix demo video in README.md (#1585) REVERT: 3ac8d6cd docs: fix adjecent typo (#1577) REVERT: 41c60279 docs: fix typos, add confirm.behavior example cfg (#1576) REVERT: 768548bf perf(source): only filter up to 200 entries and dont use the cache (#1574) REVERT: d1537711 fix(ghost_text): safely apply virtual_text highlight (#1563) REVERT: 935b4069 Improve misc.merge REVERT: 5a80cd4e Fix #897 REVERT: 1cad30fc Added a modified=false to documentation buffer, so it can be removed without E89 errors (#1557) REVERT: 0e120a63 Fix #1556 REVERT: 8b76965e fix 1533, add regression test (#1558) REVERT: 0f47dcaf Add `buftype=nofile` for entries_win and docs_win - reddit user mention this... REVERT: 8d2f1905 Fix #1550 REVERT: bd168a2f Format with stylua REVERT: 83395420 Add test for #1552 Close #1552 REVERT: 9b0bc5f9 Revert #1534 temporaly REVERT: c7189282 fix typo (#1551) REVERT: c3f7c54f ci: add release workflow to publish new tags to LuaRocks (#1431) REVERT: 0cb4b8a6 Format with stylua REVERT: 5547295b fix: #1533 (#1534) REVERT: 524cc0ba fix(cmdline): properly compute string length (#1544) REVERT: 5dcbc91d Try to fix #1458 (#1548) REVERT: 11102d3d Squashed commit of the following: REVERT: 98d5d058 Add note for cmdline mapping limitation REVERT: 2db3d7ca Add note for `set paste` option REVERT: e28fb7a7 fix: Use vim.treesitter.get_node_text() to avoid deprecation warning (#1499) REVERT: f55a3e7f Document cmd.ConfirmBehavior options (#1503) REVERT: 78bb79b1 fix(rockspec): add doc folder (#1481) REVERT: 777450fd Improve docs REVERT: feed47fd fix: annotate complete option as optional (#1475) REVERT: 01f697a6 fix: in lua if(0) evaluates to true, so check vim.fn.has == 1 (#1465) REVERT: 227306a3 fix: de-duplicate completion correctly (#1466) REVERT: 339186c9 fix CI (#1462) REVERT: 7a3b1e76 Improve docs REVERT: 42615630 Fix #1443 REVERT: 7cd39409 Fix #1443 REVERT: ba7a5347 fix: better check for if setcmdline() is available (#1456) REVERT: d3a2833c doc: fix spelling of whether (#1453) REVERT: 8202df95 fix: prevent autocmd outbursts by using setcmdline instead of feedkey (#1446) REVERT: 0c6a89af Improve perf REVERT: ea9eaff5 Maybe improve cmdline redraw REVERT: 208d69f2 README.md: don't set 'completeopt' (#1442) REVERT: c4128bcd Fix CI REVERT: a926412e Fix fuzzy matching option check and matched position REVERT: 1b2e843a Add cmp.mapping.preset.* change policy REVERT: 6635b7ae Fix fuzzy match without no partial match REVERT: aae0c3e4 Implement middle fuzzy matching Fixes #1422 REVERT: 53f49c51 feat(mapping): add all native mappings (#1430) REVERT: cfafe0a1 Improved: ALL option settings do not fire the `OptionSet` event (#1417) REVERT: e7e2ef70 Setting local window options does not trigger the "OptionSet" event (#1415) REVERT: 11a95792 Disable sort_text by default REVERT: 4748ea5a Fix locality sorting REVERT: c49ad26e keymap.lua: Fix duplicate keymap detection (#1379) REVERT: e55033fc Fix #1322 REVERT: a9c701fa Round up width/height for windows (#1373) REVERT: d09b0c39 convert encoding of range instead of start / end (#1364) REVERT: 8868cf9a Delete FUNDING.yml REVERT: 8bbaeda7 fix(api): consider multibyte characters in get_screen_cursor (cmdline) (#1352) REVERT: 10b1d112 Docs: Use tree-sitter language injection (#1350) REVERT: 93f385c1 Fix #1327 REVERT: bb95d975 Fix #1329 REVERT: 4c05626c Improve a bit REVERT: 431f0459 Refactor a bit REVERT: 0a9ccdf1 Fix #1321 Fix #1315 REVERT: 31a145c8 Fix #1249 REVERT: 8a9e8a89 feat: added scrollbar option to window.completition ( #1087) (#1308) REVERT: a188be85 Add a rule to install stylua and use the local one for other rules (#1307) REVERT: e8203352 LSP 3.17 (#1306) REVERT: aee40113 fix: type annotation for enabled field in ConfigSchema (#1299) REVERT: c53dd36a Fix parantheses bug and use string.rep (#1297) REVERT: 69c85860 chore: run formatting (#1295) REVERT: c37ea789 Update docs_view.lua (#1292) REVERT: ec86960d fix: "count" option inserting characters (#1293) REVERT: 11839571 Fix #1276 REVERT: 16ec8c6b fix(custom_entries_view): offset is also the number of bytes (#1288) REVERT: bdfadc12 feat: select_next_item and select_prev_item support "count" option. deafults to 1 (#1262) REVERT: c8d4afda fix(custom_entries_view): consider multibyte characters (#1287) REVERT: 9bb8ee6e fix(custom_entries_view): remove off-by-one error with bottom_up selection order (#1261) REVERT: cdb77665 Use `default_capabilities()` in doc and util (#1254) REVERT: e94d3489 Fix undefined new() error in example source (#1237) REVERT: 0b6654d3 Update README to use the new default_capabilities (#1243) REVERT: 3347dd3c Fix #1217 REVERT: 69476c9e ci REVERT: bf1b1126 Remove ansiblels test REVERT: 714ccb74 fix compatibility with nvim < 0.8 (#1227) REVERT: 53bd5749 Fix #1213 REVERT: 99ef8543 fix(context): compatibility with nvim<0.8 (#1224) REVERT: 0ad2450f fix(context): `in_treesitter_capture` (#1211) REVERT: 0e436ee2 fix(entry/get_replace_range): workaround for end char matching cursor position (#1177) REVERT: b0dff0ec Update type annotations for setup.cmdline (#1194) REVERT: da2d88ec ADD: formatting.expandable_indicator to show the `expandable` indicator (#1207) REVERT: 203aa26f Fix for cmdheight=0 Fixes #1196 Fixes hrsh7th/cmp-cmdline#64 REVERT: beb1d14c Add scrolloff option for completion window. REVERT: 2427d06b Format by stylua (#1195) REVERT: 83c09769 `setup.cmdline`: support using a table (#1193) REVERT: 4dd7ab6c fix(rockspec): fixed format + ran formatter (#1174) REVERT: d2bc377b Update README.md to add missing do (#1188) REVERT: dd4173fc Optimize performance more REVERT: e1f31778 Optimize performance REVERT: 17a55b3d `README.md`: use buffer source for `/` and `?` (#1186) REVERT: 913eb859 feat: add `filter` option to sources (#1067) REVERT: b16e5bcf Restore rockspec REVERT: 33fbb2c3 Fix grammar mistake: "setup" -> "set up" (#1155) REVERT: 6b3dbc83 fix(timer): close timers before Neovim exits (#1166) REVERT: b5885696 Add incsearch_redraw_keys settings (#1162) REVERT: 058100d8 Fix #1149 (temporary fix) REVERT: 347fabf9 Fix #1146 REVERT: 82876863 Re-fix #1144 REVERT: 995a2a9f Fix #1144 REVERT: 3cc0c182 Fix #1142 REVERT: 7e67df51 Fix #1135 REVERT: db261b4e Fix onetime configuration handling REVERT: 27bc575d fix(entry/get_replace_range): handle TextEdit.range (#1140) REVERT: 49c4050e Refactor a bit REVERT: 9417f48a Restore filetype setting REVERT: 1307917f Fix #1139 REVERT: b1ebdb0a Add FAQ for clangd's command-line arguments. Fixes #999 REVERT: 8ce0832a The default highlight groups shouldn't be default=true. Fixes #972 REVERT: 85235684 Fix #1102 REVERT: 983453e3 Use `cmp.config.sources` (#1105) REVERT: 706371f1 add check for nil on documentation.value (#1091) REVERT: 76ba56ce Decrease waits REVERT: bf5593df Improve typings REVERT: 89df2cb2 Fix native_entries_view.info width and col calculations (#1075) REVERT: 33588ca2 fix: #1030 (#1062) REVERT: 1568d769 Fix type comment for cmp.ContextReason (#1045) REVERT: ad31a2b0 (feat) Custom item kinds (#1003) REVERT: c4dcb124 Fix border width calculation REVERT: 9897465a Fix stylua integration (#1054) REVERT: 1cad1815 Fix typo (#1047) REVERT: 8cab7889 add events: view_opened and view_closed (#965) REVERT: df6734aa Add Completion Window Options (#901) REVERT: 0e65333c make debounce and throttle time configurable (#1026) REVERT: 15c7bf7c Update documentation (#1019) REVERT: ce643c12 Fix doc typo (#1025) REVERT: 033a817c fix: only scroll docs if docs view is visible (#1011) REVERT: 6e1e3865 Update bug_report.yml REVERT: cd694b89 Fix #989 REVERT: 16040525 Reuse scratch buffer for keymap normalization (#991) REVERT: 23e182d6 fix(types)(cmp): missing `filetype` type (#990) REVERT: 9a0c639a Fix #987 REVERT: 0318a3cb Improve the codes for sumneko friendly REVERT: 6527e5f3 fix: use scratch buffer and lhs for keymap.normalize() (#986) REVERT: a226b6a4 Fix #973 REVERT: f81bfee1 Fix #964 Fix #963 Fix #966 REVERT: c6126cca Fix #962 REVERT: e64421ef Fix #960 REVERT: 5054c144 dev (#956) REVERT: bba6fb67 Fixed typo (#928) REVERT: 101f4aa7 fix: don't show non-working configuration in deprecation suggestion (#946) REVERT: bb5cac4d Help page changes. (#952) REVERT: baa8646c Add confirmation.get_commit_characters documents. Fix #948 REVERT: f841fa6c Reduce flicker REVERT: 74284cff docs: fix sample code for `cmp.config.sources` (#942) REVERT: 433af3df Add docs REVERT: f51dc68e fix: Fix stylua errors and install_stylua script (#923) REVERT: f9f6d8dc Fix scopes comparator REVERT: 07132dc5 fix: use vim.treesitter.query instead of deprecated nvim-treesitter.ts_utils (#919) REVERT: 2aa7eee2 Improve README.md REVERT: b5433f90 docs!: improve the instructions to follow breaking changes (#231) (#904) REVERT: d3e74ec3 Remove print REVERT: 77d88ba0 Revert #873 fixes for Fix #899 REVERT: ec8e87ce Revert #886 and refactor (#900) REVERT: 7e07dd50 Fix #893 REVERT: dbc72290 Fix #894 REVERT: 0c1f37c5 Fix mapping normalization order REVERT: f4b3dda7 Improve cmdline preset REVERT: 93cf84f7 Remove all default mappings REVERT: 4f1358e6 Add deprecation notice REVERT: fae808a2 dev (#813) REVERT: f5734795 make completion popup windows have bufhidden=wipe (#886) REVERT: 3192a0c5 Fix #875 REVERT: 1558d110 Bottom up mode for custom menu (#848) REVERT: 7903e867 Change URL of FAQ in bug_report (#867) REVERT: 82738dc1 Update bug_report.yml REVERT: f66f7e48 Update bug_report.yml REVERT: 3fa777ac Update issue template REVERT: 801a9f98 Improve macro handling REVERT: 27970d8a Update bug_report.yml REVERT: 7dbe34e3 Fix snr notation REVERT: b3ca3fde Fix recursive mapping problem. Thank you tpope! Fix #858 Fix #871 REVERT: 15f08a8f Avoid misleading suggested configuration REVERT: c1589830 Prefer above identifier for locality sort REVERT: 3a164929 Improve scopes sorter REVERT: a97d2f46 Use `get_word` instead to sort. REVERT: c1d0cd0f Use cache for locality sort REVERT: a5024f91 Add locality sort (easy version) REVERT: 2de24d3e Rename locals to scopes REVERT: dc3113a7 Add sort (required nvim-treesitter) REVERT: 5e794cdf Improve timing REVERT: dd6e4d96 use only the first filetype when formatting (#857) REVERT: 2dff6a8b fix(misc): kill redundant redraw during incsearch (#485) (#859) REVERT: 272cbdca Update readme: add a link to a list of cmp sources (#853) REVERT: 71d7f46b Try to fix col adjustment (#843) REVERT: c60cb7a1 Make sure config is not nil (#836) REVERT: e23de1f2 Add `cmp.get_entries`. Fixes #831 REVERT: 1001683b Add doc REVERT: 45e93cdf Redundent kind of lsp.MarkupKind (#819) REVERT: 13d64460 Fix entry:get_word()'s cache condition REVERT: 4f5cc6a9 Fix #801 Fix #615 Fix #798 REVERT: ba47440a Improve common string mapping instruction REVERT: 2d8f40b2 Add docs for integarting copilot.vim REVERT: 4bc038f7 fmt REVERT: bf78446d Refactor wildmenu_entries_view REVERT: a8150a2c Improve complete_common_string REVERT: c0735018 Implement matching config. Fix #796 REVERT: 33fc65f1 test&lint&fmt REVERT: 070c5572 Implement shell like common string completion. Fix #785 REVERT: 7e473b99 Support multiple filetypes Fix #786 REVERT: 20152c6a Fix #789 REVERT: 26a9184c Add filetype config Use view.entries == 'native' instead of experimental.native_menu REVERT: ad3c1adb Refactor context module, return false (not {}) in context.in_treesitter_capture (#777) REVERT: 3a2f1bbc Added `event_chars` property to `confirm_done event` (#782) REVERT: df05fe6f Fix: close the view if cmp.enabled = false and the user types some text (#781) REVERT: a7fea2ca Decrease THROTTLE_TIME REVERT: de69c657 Fix menu position for horizontal splitting REVERT: 124f1611 Statusline view in search mode or command line mode (#729) REVERT: d6838996 improve REVERT: 55f04e49 Improve sync API REVERT: 0d23640f Fix #757 REVERT: f4bb6ffd Improve keymap (#768) REVERT: d9310424 Wait for filtering completion REVERT: 57101a2e Re fix #754 REVERT: f960d482 Fix Ci REVERT: 2d67b6dd Fix #756 REVERT: 27123b12 Fix #754 REVERT: 7cb14b0c Fix docs to avoid "E20: Mark not set" error (#753) REVERT: 1797f9e1 fmt&lint REVERT: 7a1e4848 Improve recently used REVERT: 8fc8d31c Support import completion REVERT: 682818b2 evacuate -> fallback REVERT: 4c0a6512 Fix cmdline mapping again REVERT: cea9c2a0 fix cmdline mapping REVERT: c23d810a Fix #746 REVERT: a54064d9 Add comments REVERT: 440897ef Fix #741 REVERT: 49d94e0e Fix keymap.t timing REVERT: 703e915b Improve keymapping handling REVERT: 243d5f4a Fix expression resolving timing REVERT: ec972710 Solve expression manually REVERT: 2ed0cdab Revert expr mapping handling REVERT: 76d92fca Fix cmdline completion redraw REVERT: 9f3440e7 Add comments REVERT: 008de7eb Avoid expr mapping message (#738) REVERT: 098182e2 Fix #734 REVERT: bce1b2d7 Fix expr keymap handling REVERT: 614e00de Use utf-16 at this time REVERT: f7988559 Fix offset encoding enum REVERT: 474e716e Speficy offset encoding REVERT: ce0a3581 Improve word creation REVERT: 5ddf3732 Fix #721 REVERT: 96c392de Improve tests REVERT: d6aaea47 Improve keymap handling (#720) REVERT: ef5bdb43 Improve redraw in search mode REVERT: 21456a10 fmt/test REVERT: dff06958 Fix #716 REVERT: e0cfbbba Re-fix flickering REVERT: 89643cc2 Fix hlsearch Fix hrsh7th/cmp-cmdline#29 (comment) REVERT: 4b5d0a57 Improve wording on keyword_length documentation (#719) REVERT: 9f6d2b42 Default CmpItemKind%name% to CmpItemKind (#712) REVERT: 3f7b7b25 Add `complete_done` event and improved the recently_used sorter. Fix #708 REVERT: a4f83fd8 Fix #589 REVERT: 5533c352 Fix #699 Fix #705 Fix #698 REVERT: 796f9259 Fix #703 REVERT: 1b94aaca Correct the description of functions (#697) REVERT: eca04af4 handle `nil` value accessing `CompletionItemKind` (#690) REVERT: d0f2ce46 Fix #615 REVERT: 5cf5576c Fix #683 REVERT: 966dfdc4 add function to check if in comment (#676) REVERT: b9edce72 Add the snippet indicator for items with Snippet kind (#677) REVERT: ae708ef3 Change cmp#ready to CmpReady and document autocmds better (#669) REVERT: 4a196453 Use a default zindex of 50 for documentation (#661) REVERT: 9c07c2d1 Fix vim.fn.complete being constantly called (#654) REVERT: b11f8bbe Improve README.md REVERT: 4efecf7f Correct vim doc reference for getcmdtype() (#650) REVERT: da4c071f Fix #648 REVERT: 91b6f503 Fix #582 REVERT: 79ea2b7b Fix #603 REVERT: 47d7cfc0 Fix #640 REVERT: b9035459 Fix #646 Resolve all properties by default REVERT: 49de0582 Fix #637 REVERT: 8ffaeffa Update issue template REVERT: 793b4454 Update issue template REVERT: 3d74fa77 Update issue template REVERT: 727ddee5 Fix rendering of wide characters in the custom completion window (#641) REVERT: af07ff9b docs: clarify behavior of `select` in confirm mapping (#621) REVERT: fab968f7 Readme: improve readability of lua code block in setup section (#622) REVERT: edc2a503 Fix #610 REVERT: d12ba90d feat: add issue template (#604) REVERT: 10f5883c Fix docs REVERT: 7960dad5 fmt REVERT: c2652f0a Implement #349 REVERT: d17d41bd Fix #595 REVERT: a61c36a6 fmt REVERT: f2f9a332 Use vim.lsp.util.apply_text_edits instead of vim-vital-vs REVERT: ed000eb3 fix: default highlights overriding existing highlights (#591) REVERT: 092fb66b Fix duplicate doc tags (#586) REVERT: 593a6345 Implement kind highlights (#584) REVERT: 7b744e05 Fix multibyte chars REVERT: a8601711 Fire change events when selecting different items with native menu completion (#514) REVERT: 9d48dd0d Add documents (#460) REVERT: bf3b2d45 Fix README.md REVERT: 2e4270d0 Improve incomplete handling REVERT: ac476e05 Remove misc.readonly Fix #571 REVERT: 6fa76818 Fix #321 REVERT: 1944b463 Allow to take the full SourceConfig from source API (#561) REVERT: ea10d5bd Normalize keymapping configuration Fix #475 Fix #570 Fix #533 REVERT: 9b5d64d9 Fix #567 REVERT: 876dd1a4 Fix #563 REVERT: f15be9e3 Fix #559 REVERT: 1c7f73aa Improve first display REVERT: c2a9e0cc Fix possible nil argument to string.byte (#550) REVERT: f2e7685c Add some wiki info in README (#549) REVERT: 56ad7c91 Rename type as cmdtype REVERT: 83a328c8 Improve completion reset handling REVERT: 27d4c21e Fix document about scrolling docs backwards (#538) REVERT: 286b9f78 Refactor get_active_entry and core.filter (#535) REVERT: 17d57f96 Add reason to complete function (#529) REVERT: 4d800fbc Fix cmdline screen cursor REVERT: 3e5ee9c7 Don't feed <C-f> manually but check auto-indentation REVERT: 1cfe2f7d Fix #526 REVERT: 2de40ccf Fix #520 REVERT: 05f4f858 cosmetic changes REVERT: 0f743f75 fmt REVERT: 3a2afb3c Add cmdline expansion test REVERT: c194a3db Add tests REVERT: 753f5b7c Fix #516 (#517) REVERT: e61f7c5a Fix #513 REVERT: f0f0065f Fixed typo in README.md (#515) REVERT: af06bd4b Link to menu appearance page in wiki (#493) REVERT: b3ee713d Fix cmdline confirmation bug REVERT: 60710622 Fix #504 REVERT: faaf1c96 Handle block visual/select modes, refactor mode handling (#498) REVERT: ca638685 Remove unused methods REVERT: a62375e4 Improve regex handling REVERT: c7a1b9f7 Handle InsertEnter and CmdlineEnter seperately REVERT: 97e4229b Remove triggering insert enter event REVERT: 823c73c1 Improve avoiding InsertEnter's invalid mode detection REVERT: 3968bea5 Fixes the bug that the `cmp.close` does not close the menu when using native_menu. REVERT: a0053885 Use key sequence to avoid the invalid mode detection REVERT: 453a62f8 Add textwidth tests REVERT: 2fca4574 Re-fix autoindent with tests REVERT: 31377358 Fix #494 REVERT: ac7c5fc0 Fix #473 REVERT: f831dbc1 strict mapping handling REVERT: 1628c934 Fix tests REVERT: ec788beb Fix #480 REVERT: 1a79d7e5 Fix #481 REVERT: 40f66799 Add linebreak option to cmp documentation window (#486) REVERT: 1774ff0f Fix cmdline confirmation REVERT: d0231d06 Improve async.step REVERT: d9e4ac59 Save undopoint REVERT: e1f880b7 Use apply_text_edits to avoid making the unexpected indentation by '<CR>' REVERT: 9734453d fix(ghost_text): generate it using chars instead of bytes (#471) REVERT: bf31b71f Escape <Bar> when setting indentkeys (#474) REVERT: 01fcf869 Fix expansion bug REVERT: 8c08bdf7 Allow the callback invoking multiple times if it's the recent one REVERT: 68a37a66 Support session REVERT: a881adb1 Fix native menu bug REVERT: dc6b458f tmp fix for serveral bugs REVERT: 2a58b8f9 Fix #421 REVERT: c67ed9d8 Fix #463 REVERT: 3b4d3cea Fix and improve README.md (#462) REVERT: b4622ed7 Fix REVERT: 7bc2738e Support isIncomplete only response REVERT: bf0dd907 Fix #458 REVERT: 0e1ae900 Fix #449 REVERT: b4e761e3 Fix #456 REVERT: 017d3abc Organize keymap implementation (#454) REVERT: 1c33887a Fix keymap bug REVERT: b7f79a19 Fix #443 REVERT: 674d2b13 Rewrite keymap.lua (#452) REVERT: e8cb695b Fix #436 REVERT: baa39271 Fix native menu not respecting cmp.PreselectMode.None sometimes (#447) REVERT: b10bb327 misc.merge: ensure that `misc.none` is never returned (#441) REVERT: 437074a3 README: clarify that a snippet plugin is required (#439) REVERT: ab7f3685 Add mappings for visual mode (#438) REVERT: 669803b9 Normalize mapping key before use May be fixes #431 REVERT: 3945dc5d Add basic recently_used comparator REVERT: a6412e59 Fix #423 REVERT: 732f67de Fix #427 REVERT: 6696c6a0 Fix #423 REVERT: 52d9411c Re-fix native tab mapping REVERT: c01de2bd Fix #425 REVERT: 1c498a54 Add `cmp.event:on()` (#418) REVERT: d113902e Improve cmdline handling REVERT: 58d08130 Fix #420 REVERT: 881ca573 Re-support script mapping REVERT: 455817bb Update README.md REVERT: a5891638 fmt REVERT: cae2e8f4 RFC: cmdline completion (#362) REVERT: b5899f05 Fix #414 REVERT: 32e22e64 fix an error when calling cmp#unregister_source from Vimscript (#413) REVERT: 538bfacc Update issue templates REVERT: ea6dde80 Add tests for #226 REVERT: 880137f5 Fix #226 REVERT: f1da3add Add `cmp.config.disable` for opt-out default setting REVERT: 5f5e8442 Fix #409 REVERT: 1e7355a5 Respect completeopt's `noselect` in custom menu (#402) REVERT: b185e303 Improve group handling REVERT: 921ee264 Add default mapping as the same as native mapping. REVERT: e699962a Fix #389 REVERT: 533f17c5 group -> group_index REVERT: 530834e8 Fix group index bug REVERT: 8a10870c Update README.md REVERT: 93eb8cef fmt REVERT: d26148f4 clarify setup.buffer (#392) REVERT: 0d4275e6 Fix REVERT: bf2b2386 Fix REVERT: 452ce162 Add `cmp.selected_entry`/`cmp.get_active_entry` REVERT: e4a2cec1 Implement source group. Fixes #391 REVERT: b546f50f Expose get_selected_entry() from view module to main cmp module fixes #385 (#386) REVERT: 8f92f570 Fix #376 REVERT: 8d1af008 Colored only kind REVERT: 2e026628 Fix <C-c> REVERT: 6dcf9409 Change default highlight as user requested REVERT: 26e73f31 Fix #372 REVERT: 775a3716 Fix #375 REVERT: c5796958 Fix #374 REVERT: bad20dea Improve dot-register and undo-point (Hm... undopoint may be improved more) REVERT: 289d0929 Remove meaningless code REVERT: a6a98856 Remove check code REVERT: 6b4e6b96 Fix #369 REVERT: 1e913aef Fix #345 REVERT: 4ecf2a24 Fix #364 REVERT: 0f28030a Improve macro & dot-repeat support (#363) REVERT: f0a6cca5 Fix #355 REVERT: ebe040b1 Fix #279 REVERT: 5fe7dc1e Fix #348 Fix #254 REVERT: 7d484d8b Fix same name property Fix #354 REVERT: 0dcc2eb5 Remove C-c mapping REVERT: f5393d5b Fix #340 REVERT: 3e062bcc Change var name REVERT: c658cc52 Fix #343 (#347) REVERT: 49acc848 Add item fields order Fixes #337 REVERT: 2a8dc620 Added option to set zindex of documentation window (#335) REVERT: cfc211e3 Improve REVERT: 7a36a313 No requires lazyredraw REVERT: 30ed4e43 Use `<C-g>` correctly REVERT: fe2b245e Fix #330 REVERT: 2f2794de refactor REVERT: 071c08fc Update README.md REVERT: b61d78dc Update README.md REVERT: 2085cc4d Fix #294 REVERT: d8e6a865 Use instead of REVERT: 67d43ddd Fix incorrect highlight REVERT: 6790f0a8 Fix #320 REVERT: b9b5296f Fix typos in README.md (#319) REVERT: 5a2b5ded Advertise REVERT: 20aa77b4 format&lint REVERT: f4c33ac7 Remove abbr formatting REVERT: 0a31d672 Lazy buffer creation REVERT: d901dae3 Fix #296 REVERT: b16663f7 Improve REVERT: 370e6ff0 Use nvim_win_hide instead o nvim_win_close for supporting custom menu on cmdwin REVERT: babb8023 Add `cmp.visible` REVERT: ae42ce7b More fallback Fix #286 REVERT: 3a51a8ec Fix #294 REVERT: 2ebdccf6 Fix #306 Fix #296 Fix #293 Fix #291 REVERT: 68f7eeb3 Make the pum window property respect future changes of &pumblend (#313) REVERT: 20b99bc5 adding the pumblend property to floating pum window (#310) REVERT: 2bf24050 Remove experimental.cusom_menu (#311) REVERT: 883eee5b Use <C-h> and support cmdwin REVERT: 339fe917 Don't completion by CursorMoved event REVERT: 12a24c0e Check whether option exists (#301) REVERT: 6ca23ea4 Force cursorlineopt=line for selection highlighting in floating window (#295) REVERT: ada9ddef Use floating window for completion menus (#224) REVERT: 5bed2dc9 Fix cache problem #272 REVERT: a39f72a4 document new lspkind integration with nvim-cmp (#275) REVERT: af70f40d Add is_insert_mode utility REVERT: a63a1a23 Fix #262 REVERT: f56e6b5e Fix #226 REVERT: cc21a619 Fix timing problem for some of the snippet engine Fixes #236 REVERT: 7c97261b Add cmp#ready autocmd REVERT: d9a82c76 Fix #239 REVERT: 0a8ca50d Fix #233 REVERT: 07f84fe8 Fix #232 REVERT: 132f8c25 Fix #227 REVERT: 7e2f7701 FIx: Typo (#229) REVERT: 0b45cee3 Fix: bad function usage in README for UltiSnips (#228) REVERT: fdd38098 Fix expr recursive mapping REVERT: 13e8b613 Fix keymap bug REVERT: 7c887633 Fix #220 REVERT: b99d7292 Fix #219 REVERT: 7bfa33a8 Improve performance (maybe) REVERT: 86c2b1bb Format REVERT: 77297a0a Remove virt_text_win_col REVERT: 97a639a0 Fix #217 REVERT: 329f0b78 fix: README typo (#215) REVERT: a2545692 README.md simpilification REVERT: b47a703a RFC: `CmpStatus` command (#210) REVERT: 620eea94 Fix feeding autoindent keys REVERT: 12ed912c Add the ability to specify source priority manually REVERT: ca77ec6d Change default `format.deprecated` value REVERT: c2e77362 Fix #204 REVERT: 1cd57740 Fix typo (#199) REVERT: e62303ab Prettier REVERT: f90093bb Add concepts REVERT: a7359d76 Format/Lint REVERT: 13d4989c Rework #195 (#196) REVERT: 2c92fef0 Advertise a bit REVERT: 445179dc Fix #191 REVERT: a2123566 Fix macro again REVERT: 6fa1e70b Fix macro REVERT: 44ffee0e Add Vim script API docs REVERT: 03f121fa Improve vim source REVERT: 6173796b Support Vim script plugins REVERT: 65b759cd Slight complexity reduction (#195) REVERT: dc0bbfe1 Improve resolve confirm REVERT: 71b9ebd0 Hijack agressively REVERT: f7b4277c Format REVERT: f3af9e2e Refactor keymap REVERT: af73e87f We should adopt InsertLeave event REVERT: e46ae3b6 Add keymap tests REVERT: 9c460395 InsertMode is required REVERT: a78894a0 Implement enabled=false configuration REVERT: 1cec1ecb Fix #188 REVERT: a58712bf fix StyLua command (#190) REVERT: 8fb4ee10 Support macro with commit characters REVERT: 613328c3 Expose built-in comparators REVERT: 6f48e265 Update README.md REVERT: a5068806 Fix #185 REVERT: bfda45f0 format REVERT: 1130da0a Support <C-r>= and <Cmd> REVERT: ff55c1bb Improve key handling REVERT: ae54dcdc Reduce use of VimL (#168) REVERT: 29679d49 Remove waiting source for filtering REVERT: 201fa804 Add `combine` hl_mode to ghost_text virtual text (#182) REVERT: a6c7e2e4 Fix float document not displaying (#171) REVERT: cc28d6fa Update example mapping REVERT: f49685d3 Fix #177 REVERT: 8f559af0 Support vim-endwise REVERT: fa031530 Add THROTTLE_TIME constant REVERT: 5551dfab Improve completion invoking REVERT: c44ae32b fix typo (#170) REVERT: 1481552c true as table REVERT: b6b15d5f Add experimental.ghost_text.hl_group REVERT: abed04a6 Improve performance and buf fixes REVERT: e5eed11d Fix dup REVERT: 24753844 Revert "Remove manual dup filter" (#147) REVERT: 972ff273 Don't save macro REVERT: b832719c Implement config.confirmation.get_commit_characters REVERT: 675a72e2 Check configuration REVERT: 62a6a6c0 Don't use nvim_set_decoration_provider for now REVERT: 157390d2 Invoke redraw if pum is beeing visible REVERT: 889109cb Implement source specific options REVERT: 45b96b21 Fix format REVERT: dffe375b Use virtcol for virt_text_win_col REVERT: e599f082 Remove manual dup filter REVERT: e867bf23 Experimental: Ghost text (#119) REVERT: 6cc8b822 Refactor a bit REVERT: 4fbe8c2e Fix CI REVERT: 2b48c15c Reduce flicker if not macro recording REVERT: 4f142794 Support macro REVERT: 1ae7b5e2 fix some README grammar (#136) REVERT: cf70aafd Remove hacky code (Fixes #132) REVERT: 98124321 Fix #129 (experimental) REVERT: a8f62d23 fixed typo in README (#128) REVERT: 2b82bc1a Add document for `completeopt+=longuest` REVERT: f32b80c0 Fix #120 REVERT: a383a1b2 fixed supertab example (#117) REVERT: 3a612d42 Fix snippet expansion REVERT: 25a4d9c0 Fix multiple setup.buffer REVERT: b9ef85d4 Add Programatic API documents REVERT: 684d8625 We treat false as empty table if the default value is table REVERT: b29356a1 Update README.md REVERT: 4f6b3d02 fixed typo in README (#112) REVERT: 63d3199c Add slow down reason REVERT: a339421f Fix merge bug REVERT: 99de62c1 Improve README.md REVERT: d4d4db18 Add minimal vimrc REVERT: 4219a583 Improve menu:get_selected_entry REVERT: 24406f99 Fix typo in README (#104) REVERT: bc50c49a Revert abbreviation support REVERT: 7572522a Fix snippet expansion REVERT: 5827dc90 Support abbreviation REVERT: ce431bc6 Fix snippet expansion REVERT: 1851fad7 Fix failing tests REVERT: 405581e7 Fix invalid temporary text REVERT: 61984efa Improve scheduling REVERT: 63d6c224 Add warning for source creators REVERT: 179c241e Update to the latest LSP spec REVERT: a46cfc21 README: Allow to use Tab for indentation (#38) REVERT: 6b957092 Update README.md REVERT: 359b5760 Fix #89 REVERT: b9c494a5 Add documentation for mapping fallbacks REVERT: a6cfb29a Update README to help clarify config and source usage (#92) REVERT: 6e63fda5 Fix example source implementation REVERT: c2fefe00 Fix preselect REVERT: c627f44f Update README.md REVERT: 600c6c9c Fix multibyte character problem REVERT: f5c07725 Fix documents bug REVERT: ec3f8aed Add `completion.get_trigger_characters` as configurable option REVERT: 698c3c4b Add FAQ for formatting.format (#79) REVERT: 39ef1467 fix: grammar mistake in README (#72) REVERT: d1f7f4f6 Add mapping example to README (#70) REVERT: 6bc0ddb5 Add `preselect` configuration option REVERT: 5df82330 Fix #68 REVERT: 9bf7dbd8 Change completion.autocomplete default value REVERT: 79601cb3 Add cmp.mapping.abort REVERT: 61eb3e0f 🤦 fix stylua glob typo (#62) REVERT: 3a571a69 Update README.md REVERT: d1b32f24 Add SourceBaseApiParams to get_trigger_characters API REVERT: f7bb6f1c Add SourceBaseApiParams REVERT: 46e5d165 Fix missing escape character in code example (#59) REVERT: fe964405 install stylua without cargo (#54) REVERT: 3862af14 Fix #52 REVERT: 0d97bfc8 Update status REVERT: 3454538a Add all available configuration options REVERT: bcd6adc9 Update README.md REVERT: 2f0f5f3a Add formatting.deprecated option REVERT: fc31a7e8 Update mapping docs REVERT: c0fcdd9c Improve API stability REVERT: cbb80af6 Fix is_available call REVERT: 7873adf9 Fix #47 REVERT: ed4f2fc4 Reset if empty response was returned on waiting status. REVERT: 5edcf14f Update default_behavior REVERT: faf3fec7 Update README.md REVERT: f3a54918 Fix dup assignment REVERT: 8ad9cf0c Remove unused core arguments in LuaSnip example (#42) REVERT: f12fd73f The action can be function or table...(I want to normalize it...Hm...) REVERT: 24158a72 Fix duplicate setup REVERT: 38612b4a Fix hrsh7th/cmp-buffer#2 REVERT: dbed9f4f Fix entry offset calculation REVERT: 29ad7159 Update README.md REVERT: d56bf1d5 Fix #29, #21 REVERT: e4deb014 Fix #26 REVERT: 14118756 Improve debug information REVERT: 75b368ab Add source.get_debug_name API REVERT: d3143130 Improve menu customize API REVERT: 7cd0e35a Add FAQ REVERT: b65237e3 Advertise a bit REVERT: 4907b0e5 Fix #17 REVERT: 03b05583 Add `local cmp = require('cmp')` (#25) REVERT: 8e5f09de Fix #23 REVERT: 5cc6c61a Fix key checking REVERT: 036bf1af Improve keyword_pattern handling REVERT: ac881561 Fix arguments REVERT: 2a69c1a6 Fix #19 REVERT: b8e93385 fix: {next,prev}_item mapping (#18) REVERT: 95c70dab Fix close mapping REVERT: 255f7173 Fix documentation bug REVERT: 17b0171e Add cmp.EventConfig REVERT: 22f8ce1b Improve mappings REVERT: 04af63f7 Add cmp.mapping helper for README.md REVERT: c2f87292 Update mapping configuration REVERT: 4c9462c2 Fix merge bug REVERT: ab616ffe Add source:is_available API REVERT: 52009273 README: change first conf header (#13) REVERT: 769d0f8d Update documentations for config (#12) REVERT: 56692f42 Add more documentation for source creation section REVERT: 5447f424 Add documents. REVERT: f352761d Improve pre-commit hook REVERT: 59a6ee57 Add test REVERT: 22ec3ad4 Check buftype is prompt Improve incomplete handling REVERT: 35d04be4 Improve keymap handling REVERT: b41afe2f Update README.md REVERT: 08797d96 Fix word insersion (it should be re-checked) REVERT: 29301b17 Add undo point before expand snippet REVERT: d5a2c74c Fix close mapping function REVERT: a11ddccb Support documentation window scrolling REVERT: 42172064 Fix documentation window closing bug REVERT: 008b5af5 Update README.md REVERT: d7ecc096 Fix #3 REVERT: f0cf3477 Update README.md REVERT: cb67fe90 Fix fuzzy match bug REVERT: efed4337 Improve scoring REVERT: 0cc4e1e1 Improve keyword completion handling REVERT: 7931bcfa Improve offset handling REVERT: 39c8abae Improve source reset handling REVERT: 7e097da0 Improve expansion and dot-repeatable REVERT: ef27b622 Remove VS.LSP.CompletionItem REVERT: 48cbe302 Improve triggerCharacter handling on triggerOnly reason REVERT: f8caf564 Improve patching implementation REVERT: 399cee4e Change configuration schema REVERT: cf61d0de Fix regression of commit characters REVERT: 56d22edb Improve matching and sorting on specific cases REVERT: 570b00e6 Support overlap text REVERT: ed70a7e0 Allow completion on backspace REVERT: e62a03c5 Add trigger character check after confirmation REVERT: d23d3533 dev (#1) REVERT: b32a6e7e Create FUNDING.yml REVERT: df01f957 Initial commit git-subtree-dir: vendor/plugins/nvim-cmp git-subtree-split: d78fb3b64eedb701c9939f97361c06483af575e0
1 parent c628743 commit 9dbf6e2

15 files changed

Lines changed: 124 additions & 19 deletions

File tree

.github/workflows/integration.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
luaVersion: "luajit-openresty"
2929

3030
- name: Setup luarocks
31-
uses: leafo/gh-actions-luarocks@v4
31+
uses: leafo/gh-actions-luarocks@v6
3232

3333
- name: Setup tools
3434
shell: bash

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v3
1515
- name: LuaRocks Upload
16-
uses: nvim-neorocks/luarocks-tag-release@v5
16+
uses: nvim-neorocks/luarocks-tag-release@v7
1717
env:
1818
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
1919
with:

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ lua <<EOF
112112
{ name = 'buffer' },
113113
})
114114
})
115-
require("cmp_git").setup() ]]--
115+
require("cmp_git").setup() ]]--
116116
117117
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
118118
cmp.setup.cmdline({ '/', '?' }, {
@@ -136,9 +136,10 @@ lua <<EOF
136136
-- Set up lspconfig.
137137
local capabilities = require('cmp_nvim_lsp').default_capabilities()
138138
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
139-
require('lspconfig')['<YOUR_LSP_SERVER>'].setup {
139+
vim.lsp.config('<YOUR_LSP_SERVER>', {
140140
capabilities = capabilities
141-
}
141+
})
142+
vim.lsp.enable('<YOUR_LSP_SERVER>')
142143
EOF
143144
```
144145

doc/cmp.txt

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,10 @@ A recommended configuration can be found below.
140140

141141
-- Setup lspconfig.
142142
local capabilities = require('cmp_nvim_lsp').default_capabilities()
143-
require('lspconfig')[%YOUR_LSP_SERVER%].setup {
143+
vim.lsp.config(%YOUR_LSP_SERVER%, {
144144
capabilities = capabilities
145-
}
145+
})
146+
vim.lsp.enable(%YOUR_LSP_SERVER%)
146147
EOF
147148
<
148149
==============================================================================
@@ -411,13 +412,26 @@ Highlight *cmp-highlight*
411412
*CmpItemKind*
412413
Highlight group for the kind of the field.
413414

414-
NOTE: `kind` is a symbol after each completion option.
415+
NOTE: `kind` is a symbol after each completion option.
416+
417+
*CmpItemKindIcon
418+
Highlight group for the icons used for each `lsp.CompletionItemKind`.
415419

416420
*CmpItemKind%KIND_NAME%*
417421
Highlight group for the kind of the field for a specific `lsp.CompletionItemKind`.
418422
If you only want to overwrite the `method` kind's highlight group, you can do this:
419423
>vim
420424
highlight CmpItemKindMethod guibg=NONE guifg=Orange
425+
426+
*CmpItemKind%KIND_NAME%Icon
427+
Highlight group for the icon shown for a specific `lsp.CompletionItemKind`.
428+
Can be overriden the same way as shown above OR with a custom function
429+
in your format table (e.g.):
430+
431+
local function set_colors(str)
432+
local color = vim.api.nvim_get_hl(args...)
433+
vim.api.nvim_set_hl(args...)
434+
end
421435
<
422436
*CmpItemMenu*
423437
The menu field's highlight group.
@@ -561,7 +575,7 @@ formatting.format~
561575
The function used to customize the appearance of the completion menu. See
562576
|complete-items|. This value can also be used to modify the `dup` property.
563577
NOTE: The `vim.CompletedItem` can contain the special properties
564-
`abbr_hl_group`, `kind_hl_group` and `menu_hl_group`.
578+
`abbr_hl_group`, `icon_hl_group`, `kind_hl_group` and `menu_hl_group`.
565579

566580
*cmp-config.matching.disallow_fuzzy_matching*
567581
matching.disallow_fuzzy_matching~
@@ -773,6 +787,13 @@ window.completion.scrollbar~
773787
`boolean`
774788
Whether the scrollbar should be enabled if there are more items that fit
775789

790+
*cmp-config.window.completion.max_height*
791+
window.completion.max_height~
792+
`number | nil`
793+
The completion window's max height, can be set to 0 to use all available
794+
space. To use `vim.o.pumheight` set this to `nil`.
795+
See |'pumheight'|.
796+
776797
*cmp-config.window.documentation.max_width*
777798
window.documentation.max_width~
778799
`number`

lua/cmp/config/default.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
local compare = require('cmp.config.compare')
22
local types = require('cmp.types')
3+
local window = require('cmp.config.window')
34

45
local WIDE_HEIGHT = 40
56

@@ -48,7 +49,7 @@ return function()
4849

4950
formatting = {
5051
expandable_indicator = true,
51-
fields = { 'abbr', 'kind', 'menu' },
52+
fields = { 'abbr', 'icon', 'kind', 'menu' },
5253
format = function(_, vim_item)
5354
return vim_item
5455
end,
@@ -107,7 +108,7 @@ return function()
107108

108109
window = {
109110
completion = {
110-
border = { '', '', '', '', '', '', '', '' },
111+
border = window.get_border(),
111112
winhighlight = 'Normal:Pmenu,FloatBorder:Pmenu,CursorLine:PmenuSel,Search:None',
112113
winblend = vim.o.pumblend,
113114
scrolloff = 0,
@@ -118,7 +119,7 @@ return function()
118119
documentation = {
119120
max_height = math.floor(WIDE_HEIGHT * (WIDE_HEIGHT / vim.o.lines)),
120121
max_width = math.floor((WIDE_HEIGHT * 2) * (vim.o.columns / (WIDE_HEIGHT * 2 * 16 / 9))),
121-
border = { '', '', '', ' ', '', '', '', ' ' },
122+
border = window.get_border(),
122123
winhighlight = 'FloatBorder:NormalFloat',
123124
winblend = vim.o.pumblend,
124125
},

lua/cmp/config/window.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,21 @@ window.bordered = function(opts)
1010
col_offset = opts.col_offset or 0,
1111
side_padding = opts.side_padding or 1,
1212
scrollbar = opts.scrollbar == nil and true or opts.scrollbar,
13+
max_height = opts.max_height or nil,
1314
}
1415
end
1516

17+
window.get_border = function()
18+
-- On neovim 0.11+, use the vim.o.winborder option by default
19+
local has_winborder, winborder = pcall(function()
20+
return vim.o.winborder
21+
end)
22+
if has_winborder and winborder ~= '' then
23+
return winborder
24+
end
25+
26+
-- On lower versions return the default
27+
return 'none'
28+
end
29+
1630
return window

lua/cmp/entry.lua

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ local snippet = require('cmp.utils.snippet')
66
local config = require('cmp.config')
77
local types = require('cmp.types')
88
local matcher = require('cmp.matcher')
9+
local ok, lspkind = pcall(require, 'lspkind')
10+
11+
local function get_icon(kind)
12+
if ok then
13+
local icon = lspkind.symbol_map[kind]
14+
return icon
15+
end
16+
17+
return ''
18+
end
919

1020
---@class cmp.Entry
1121
---@field public id integer
@@ -260,7 +270,7 @@ end
260270
---Return view information.
261271
---@param suggest_offset integer
262272
---@param entries_buf integer The buffer this entry will be rendered into.
263-
---@return { abbr: { text: string, bytes: integer, width: integer, hl_group: string|table }, kind: { text: string, bytes: integer, width: integer, hl_group: string|table }, menu: { text: string, bytes: integer, width: integer, hl_group: string|table } }
273+
---@return { abbr: { text: string, bytes: integer, width: integer, hl_group: string|table }, icon: { text: string, bytes: integer, width: integer, hl_group: string|table }, kind: { text: string, bytes: integer, width: integer, hl_group: string|table }, menu: { text: string, bytes: integer, width: integer, hl_group: string|table } }
264274
entry.get_view = function(self, suggest_offset, entries_buf)
265275
local item = self:get_vim_item(suggest_offset)
266276
return self.cache:ensure('get_view:' .. tostring(entries_buf), entry._get_view, self, item, entries_buf)
@@ -278,6 +288,11 @@ entry._get_view = function(self, item, entries_buf)
278288
view.abbr.bytes = #view.abbr.text
279289
view.abbr.width = vim.fn.strdisplaywidth(view.abbr.text)
280290
view.abbr.hl_group = item.abbr_hl_group or (self:is_deprecated() and 'CmpItemAbbrDeprecated' or 'CmpItemAbbr')
291+
view.icon = {}
292+
view.icon.text = item.icon or get_icon(types.lsp.CompletionItemKind[self:get_kind()])
293+
view.icon.bytes = #view.icon.text
294+
view.icon.width = vim.fn.strdisplaywidth(view.icon.text)
295+
view.icon.hl_group = item.icon_hl_group or (('CmpItemKind' .. (types.lsp.CompletionItemKind[self:get_kind()] or '') .. 'Icon') or 'CmpItemKind')
281296
view.kind = {}
282297
view.kind.text = item.kind or ''
283298
view.kind.bytes = #view.kind.text
@@ -352,6 +367,8 @@ entry._get_vim_item = function(self, suggest_offset)
352367
local vim_item = {
353368
word = word,
354369
abbr = abbr,
370+
icon = cmp_opts.icon or get_icon(types.lsp.CompletionItemKind[self:get_kind()]),
371+
icon_hl_group = cmp_opts.icon_hl_group,
355372
kind = cmp_opts.kind_text or types.lsp.CompletionItemKind[self:get_kind()] or types.lsp.CompletionItemKind[1],
356373
kind_hl_group = cmp_opts.kind_hl_group,
357374
menu = menu,
@@ -362,6 +379,7 @@ entry._get_vim_item = function(self, suggest_offset)
362379
end
363380
vim_item.word = str.oneline(vim_item.word or '')
364381
vim_item.abbr = str.oneline(vim_item.abbr or '')
382+
vim_item.icon = str.oneline(vim_item.icon or '')
365383
vim_item.kind = str.oneline(vim_item.kind or '')
366384
vim_item.menu = str.oneline(vim_item.menu or '')
367385
vim_item.equal = 1

lua/cmp/types/cmp.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ cmp.PreselectMode = {
3232
None = 'none',
3333
}
3434

35-
---@alias cmp.ItemField 'abbr' | 'kind' | 'menu'
35+
---@alias cmp.ItemField 'abbr' | 'icon' | 'kind' | 'menu'
3636
cmp.ItemField = {
3737
Abbr = 'abbr',
38+
Icon = 'icon',
3839
Kind = 'kind',
3940
Menu = 'menu',
4041
}
@@ -130,6 +131,7 @@ cmp.ItemField = {
130131
---@field public col_offset? integer|nil
131132
---@field public side_padding? integer|nil
132133
---@field public scrollbar? boolean|true
134+
---@field public max_height? integer|nil
133135

134136
---@class cmp.DocumentationWindowOptions: cmp.WindowOptions
135137
---@field public max_height? integer|nil

lua/cmp/types/lsp.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ end
259259
---@field public description? string
260260

261261
---@class lsp.internal.CmpCompletionExtension
262+
---@field public icon string
263+
---@field public icon_hl_group string
262264
---@field public kind_text string
263265
---@field public kind_hl_group string
264266

lua/cmp/types/vim.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
---@class vim.CompletedItem
22
---@field public word string
33
---@field public abbr string|nil
4+
---@field public icon string|nil
45
---@field public kind string|nil
56
---@field public menu string|nil
67
---@field public equal 1|nil
78
---@field public empty 1|nil
89
---@field public dup 1|nil
910
---@field public id any
1011
---@field public abbr_hl_group string|table|nil
12+
---@field public icon_hl_group string|table|nil
1113
---@field public kind_hl_group string|table|nil
1214
---@field public menu_hl_group string|table|nil
1315

0 commit comments

Comments
 (0)