Commit Graph

781 Commits

Author SHA1 Message Date
Jongwook Choi
13451e7ee4 docs: fix invalid WindowConfig schema, should match to the docs (#1779)
Problem: `cmp.WindowConfig` was defined twice.

Solution: Introduce
  `cmp.CompletionWindowOptions` and `cmp.DocumentationWindowOptions`.
Make fields of these two class consistent with |cmp-config.window.*|
2024-03-22 03:05:55 +09:00
Micah Halter
66f0a031d9 feat: default to vim.snippet for snippet expansion if available (#1820) 2024-03-22 03:04:54 +09:00
Sam
763c720d51 fix(ghost_text): make sure to the delete the mark for the same buffer (#1826) 2024-03-22 03:03:11 +09:00
hankertrix
53d80d4d0c fix: small windows no longer constantly throw errors (#1824)
The entries_win:open function will fail when either the width or
the height of the window is less than 1, which will result in the
nvim_win_set_cursor being passed a nil value for self.entries_win.win
instead of a number, which causes an error to constantly appear when
the window is small. Hence, a guard clause to check for whether
self.entries_win.win is nil is added to stop the error from occurring.

Also fixed the rarer 'height' must be a positive Integer error caused
by the window.update function, within the clause to draw the scrollbar
background. This error happens on small windows when pressing and
holding down the backspace key to delete a lot of characters at once.
The nvim_open_win function call to create the scrollbar
background throws the error when self.style.height is 0. Hence, an
additional check is added alongside the info.scrollable check which also
skips drawing the scrollbar thumb as it is not needed when the height is
0 and will result in a weird scrollbar thumb floating some distance
away from the text when holding down backspace to delete a lot of
characters.
2024-03-22 03:02:15 +09:00
Kyle Butt
6460f979b9 Add option for symbol matching logic. (#1515)
The no_symbol_match makes command line completion a lot less useful. It
disables any matches for file names with symbols in them. This prevents
completing things like ":b foo/bar" to ":b foo/bar.txt" or ":b foo_" to
":b baz/foo_bar.txt". Add an option `disallow_symbol_nonprefix_matching`
that prevents a match if it contains a symbol and isn't a prefix match.
Make that option the default. Add the option to documentation and tests.
Add to the examples for command line setup disabling the option.
2024-03-22 03:00:36 +09:00
Josef Litoš
a1b4ef08c2 feat: avoid global variable use (#1813) 2024-03-22 02:56:07 +09:00
Yu Zhang
04e0ca376d fix: one more item than max_item_count is displayed (#1811) 2024-02-02 15:59:47 +09:00
Alejandro
538e37ba87 feat(ci): update luarocks-tag-release to latest version (#1776) 2023-12-14 17:06:53 +09:00
Mehdi
41d7633e41 feat: sort source entries before slicing when using max_item_count (#1765)
* feat: sort source entries beforce slicing when using max_item_count

* feat: optimize filtering by max_item_count after sort

* fix: useless check if max_item_counts map is initialized

* fix: directly use entry source object when checking max_item_count
2023-12-10 20:37:02 +09:00
GyouzaRu
5e1fa02553 Fix: Buffer is not 'modifiable' (#1677) 2023-12-10 20:22:00 +09:00
Riley Bruins
55734c8b70 feat: match default border color to standard neovim float border hl (#1689) 2023-12-10 20:20:48 +09:00
SandeshPyakurel
a70bdcfe61 Fixed typos in cmp.txt file (#1730) 2023-12-10 20:19:20 +09:00
Adam Price
c01a038469 Mark non-required setup fields as optional (#1723)
... to correct "Missing required fields" messages from lua_ls
2023-12-10 20:14:50 +09:00
hrsh7th
36eb3a6917 add test-case placeholders 2023-12-10 19:59:39 +09:00
Dan Salvato
82ba05c784 Fix fuzzy matcher adding invalid matches (#909) (#1420) 2023-12-10 19:57:59 +09:00
PlankCipher
0b751f6bee fix(ghost_text): ephemeral-like inline ghost-text workaround (#1688)
Refs:
  - https://github.com/hrsh7th/nvim-cmp/pull/1645
  - https://github.com/neovim/neovim/issues/24797
2023-11-06 17:58:22 +09:00
Maria José Solano
51260c02a8 fix: remove usages from vim.lsp.util.parse_snippet (#1734) 2023-10-25 10:54:30 +09:00
jmp
d3a3056204 ci: fix broken tests (#1729)
feedkeys_spec.lua:
In the "backspace test spec, the backspace
setting is given an integer, but only accepts
strings. Here, I assume that 0 was intended to
set backspace to a nil value, which can be done
with the empty string. I also corrected the name
of the test spec.

core_spec.lua:
In the "textedit" test spec, the actual and
expected outputs as well as the actual and
expected end characters did not match.
2023-10-18 15:37:12 +09:00
hrsh7th
5dce1b778b Format with stylua 2023-08-26 15:31:42 +00:00
Jongwook Choi
026ef9445e docs: Add comments and type annotations for sorting comparators (#1687) 2023-08-27 00:31:28 +09:00
PlankCipher
51f1e11a89 fix(ghost_text): ephemeral causes a false positive of no inline support (#1645) 2023-08-12 11:55:52 +09:00
Tyler Miller
969c5affa5 perf(core): simplify and improve find_line_suffix() (#1675)
Call `string.match()` once instead of calling `string.sub()` and
`string.find()` multiple times in a loop.
2023-08-12 11:52:37 +09:00
hrsh7th
992fa0dd47 Format with stylua 2023-08-12 02:51:03 +00:00
Maria José Solano
1c03ebc7dc feat: add toggle_doc functionality (#1647)
* feat: Add toggle_doc functionality

fix: Update docs view on entry change

* Replace toggle logic by open/close

* add docs and pinned flags

* add faq for disabling docs

* chore(git): ignore .DS_Store

---------

Co-authored-by: hrsh7th <629908+hrsh7th@users.noreply.github.com>
2023-08-12 11:50:49 +09:00
hrsh7th
3b9f28061a add context check for invalid detection 2023-08-10 16:55:01 +09:00
hrsh7th
6c84bc75c6 implement is_invalid detection 2023-08-10 16:52:10 +09:00
sandersantema
c4e491a87e perf: fix nvim_replace_termcodes being called on every CursorMoved (#1650) 2023-07-10 13:57:29 +09:00
hrsh7th
2743dd989e improve pattern handling 2023-06-30 21:49:25 +09:00
hrsh7th
e1f1b40790 Format with stylua 2023-06-23 04:29:59 +00:00
hrsh7th
9e49ed3fee fix confirm resolve 2023-06-23 13:29:35 +09:00
Jose Vargas
8a1694ff33 Expand docs for select_next_item select_prev_item (#1626) 2023-06-21 22:57:52 +09:00
kyoh86
fa492591fe fix type of the config.autocomplete to accept false (#1624) 2023-06-19 11:32:54 +09:00
tj-moody
b8c2a62b3b Update ghost_text type to allow true (#1616) 2023-06-11 13:21:19 +09:00
hrsh7th
69e7d280cb Format with stylua 2023-06-10 15:13:53 +00:00
fengwk
48c0bc7e73 fix: huge single line performance (#1433) (#1615) 2023-06-11 00:13:36 +09:00
hrsh7th
09ff53ff57 Format with stylua 2023-06-09 12:27:08 +00:00
hrsh7th
559b688cda restore max_item_count 2023-06-09 21:26:42 +09:00
Folke Lemaitre
6f118169af fix(async): properly trigger callbacks when canceling and fix delays in throttle.sync (#1611) 2023-06-09 19:08:28 +09:00
Noah Friedman
b5a636d46c Improve types related to mapping definitions (#1604) 2023-06-09 02:07:07 +09:00
EJ
a2198e3d61 fix: handle godot LSP better (#1592) 2023-06-09 02:06:37 +09:00
Corentin Hervaud
fc0f694af1 Updating documentation as cmp_git source as been moved to git (#1603) 2023-05-30 16:25:55 +09:00
hrsh7th
b43bfaf322 fix(entry): fix matches highlight information
fixes #1426
2023-05-28 22:47:11 +09:00
hrsh7th
3874e09e80 fix(entry): remove offset + 1 for tailwindcss 2023-05-28 22:33:20 +09:00
hrsh7th
1088b3743b Add extmark inline feature detection 2023-05-27 23:06:46 +09:00
hrsh7th
15e8a636df Restore schedule_wrap 2023-05-27 23:02:35 +09:00
Hawtian Wang
a0225043ab fix entry highlight in complete-menu (#1593) 2023-05-26 15:16:03 +09:00
hrsh7th
8a3d2dd764 Remove max_item_count from source configuration 2023-05-26 02:47:45 +09:00
Folke Lemaitre
abb5c7519d feat: cmp async (#1583) 2023-05-26 02:46:53 +09:00
Anshuman Medhi
950d0e3a93 ghost text inline (#1588) 2023-05-26 00:02:26 +09:00
David Goldstein
799392ac8d Fix demo video in README.md (#1585) 2023-05-25 22:44:18 +09:00