Commit Graph

60 Commits

Author SHA1 Message Date
Jose Vargas
8a1694ff33 Expand docs for select_next_item select_prev_item (#1626) 2023-06-21 22:57:52 +09:00
hrsh7th
559b688cda restore max_item_count 2023-06-09 21:26:42 +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
Stéphane P
3ac8d6cd29 docs: fix adjecent typo (#1577) 2023-05-17 14:21:18 +09:00
jmp
41c6027994 docs: fix typos, add confirm.behavior example cfg (#1576) 2023-05-17 10:53:06 +09:00
MinSeok Kim
c718928219 fix typo (#1551) 2023-05-03 16:05:35 +09:00
hrsh7th
98d5d0583c Add note for cmdline mapping limitation 2023-04-27 00:35:43 +09:00
hrsh7th
2db3d7ca42 Add note for set paste option 2023-04-27 00:32:29 +09:00
Michael Jakl
f55a3e7fe5 Document cmd.ConfirmBehavior options (#1503) 2023-04-24 13:55:44 +09:00
hrsh7th
777450fd0a Improve docs 2023-03-17 13:22:04 +09:00
hrsh7th
7a3b1e76f7 Improve docs 2023-02-24 12:23:36 +09:00
Bradley Jones
d3a2833c11 doc: fix spelling of whether (#1453)
Signed-off-by: Bradley Jones <jones.bradley@me.com>
2023-02-22 00:08:00 +09:00
hrsh7th
aae0c3e4e7 Implement middle fuzzy matching
Fixes #1422
2023-02-11 22:52:28 +09:00
OgaKen
10b1d11252 Docs: Use tree-sitter language injection (#1350)
see:
    https://github.com/nvim-treesitter/nvim-treesitter/pull/3846
2022-12-15 13:36:48 +09:00
pure-bliss
8a9e8a89ee feat: added scrollbar option to window.completition ( #1087) (#1308)
* #1087 added hide_scrollbar option to window.completition

* Renamed hide_scrollbar to scrollbar, changed default value (#1087)

* doc description update (#1087)

* determining info.scrollbar value considering config scrollbar (#1087)

* window.bordered scrollbar default value fix (#1087)
2022-11-18 17:31:06 +09:00
hrsh7th
e820335208 LSP 3.17 (#1306)
* 3.17

* PositionEncodingKind

* Implement PositionEncodingKind

* Remove luarc.json
2022-11-16 01:27:15 +09:00
ADoyle
bdfadc1238 feat: select_next_item and select_prev_item support "count" option. deafults to 1 (#1262)
User can increase count value to select item with pagedown/pageup.

- cmp.select_prev_item({ behavior = behavior, count = 8 })
- cmp.select_next_item({ behavior = behavior, count = 8 })
2022-11-09 19:26:20 +09:00
Austin Ray
cdb77665bb Use default_capabilities() in doc and util (#1254)
Commit 0b6654d3de changed the `README.md`
to use `default_capabilities()` instead of `update_capabilities()`. This
commit replicates that change to `doc/cmp.txt` and `utils/vimrc.vim` for
consistency.
2022-10-22 13:26:32 +09:00
nat-418
e94d348931 Fix undefined new() error in example source (#1237) 2022-10-16 18:29:26 +09:00
NEX
da2d88ec1a ADD: formatting.expandable_indicator to show the expandable indicator (#1207)
* ADD: formatting.expandable_indicator to show the `expandable` indicator

* UPDATA: doc/cmp.txt  lua/cmp/entry.lua  lua/cmp/typed/cmp.lua
2022-10-02 22:39:52 +09:00
hrsh7th
beb1d14c5e Add scrolloff option for completion window. 2022-10-02 19:47:01 +09:00
Jonatan Branting
913eb85998 feat: add filter option to sources (#1067)
* feat: add `source.filter` config

This allows the user to specify a `filter` function for each source,
like this:

```lua
-- don't show entries with kind "Text" from the "nvim_lsp" source

sources = {
{
  name = "nvim_lsp",
  filter = function(entry, ctx)
    local kind = types.lsp.CompletionItemKind[entry:get_kind()]

    if kind == "Text" then
      return true
    end
  },
}
```

By utilizing the `ctx` parameter, the user can also ignore certain
entries in certain contexts.

* fixup! feat: add `source.filter` config

* fixup! feat: add `source.filter` config
2022-09-08 12:48:27 +09:00
hrsh7th
9417f48a99 Restore filetype setting 2022-08-20 19:22:50 +09:00
hrsh7th
b1ebdb0a17 Add FAQ for clangd's command-line arguments. Fixes #999 2022-08-15 01:38:44 +09:00
hrsh7th
76ba56ce96 Decrease waits 2022-07-24 13:14:01 +09:00
Zhuoyun Wei
1cad1815e1 Fix typo (#1047) 2022-06-24 12:36:04 +09:00
tzachar
8cab788976 add events: view_opened and view_closed (#965)
* add events: view_opened and view_closed

* fix typos

* rename view -> menu
2022-06-24 12:35:47 +09:00
Cameron
df6734aa01 Add Completion Window Options (#901)
* Add window.completion.side_padding and window.completion.col_offset

* add col_offset and side_padding options to config/window
2022-06-15 11:49:16 +09:00
MurdeRM3L0DY
0e65333c7f make debounce and throttle time configurable (#1026)
* make debounce and throttle time configurable

* fix documentation
2022-06-15 02:21:55 +09:00
Jonas Strittmatter
15c7bf7c0d Update documentation (#1019)
Co-authored-by: hrsh7th <629908+hrsh7th@users.noreply.github.com>
2022-06-09 16:41:59 +09:00
Benoit de Chezelles
ce643c12f1 Fix doc typo (#1025) 2022-06-08 13:32:34 +09:00
Uefair
bb5cac4dce Help page changes. (#952)
Co-authored-by: alexey <serendipitousdog@protonmail.com>
2022-05-03 01:43:24 +09:00
hrsh7th
baa8646c24 Add confirmation.get_commit_characters documents.
Fix #948
2022-05-01 22:58:26 +09:00
nskhei
74284cffb6 docs: fix sample code for cmp.config.sources (#942) 2022-04-28 14:10:25 +09:00
hrsh7th
433af3dffc Add docs 2022-04-21 21:29:40 +09:00
hrsh7th
2aa7eee28b Improve README.md 2022-04-18 23:50:46 +09:00
hrsh7th
93cf84f7de Remove all default mappings 2022-04-14 00:10:33 +09:00
hrsh7th
fae808a2bc dev (#813)
* feat: completion menu borders (#472)

* feat(custom_entries_view): pass custom border option

* feat(window): calculate offset needed for borders

* fix(window): adjust window height w/ too many results

* fix(window): center scrollbar with borders

* ref(custom_entries_view): use `FloatBorder` for borders

* fix(window): offset at bottom of window

* ref(window): move height adjustment to more logical place

* fix(window): improve popup placement

* fix(window): `border_offset` always `0` first time

* feat(window): support compact scrollbar with border

* fix(window): completion popup on cursorline

* perf(window): simplify offset calculation

String indexing will result in the same thing as if I gated it behind
`type()` calls here.

* docs(window): add `border` to `cmp.WindowStyle`

* docs(window): correct `border_offset_scrollbar`

* perf(window): calulated row -> `screenrow`

This will also be more accurate since it accounts for wrapped lines, as
well as buffers.

* fix(window): edge case with multiple splits

* ref(winhighlight): don't specify defaults by default

`NormalFloat:NormalFloat` isn't needed, since `NormalFloat` defaults to
`NormalFloat`. As for `FloatBorder`, that should be set to `Floatborder`
rather than `NormalFloat` or else you get unintended artifacts on the
edges of borders.

* fix(window): popup covers cursor when scrollbar disappears

* ref(window): calc `border_offset_col` on `set_style`

* perf(window): remove unecessary `col` calculation

Taking it out didn't change anything about the popup behavior.

* feat: add `CmpItemMenuThumb` group

* feat(window): improve scrollbar appearance

* chore(window): remove references to unused property

* docs: document new option `thin_scrollbar`

* ref(plugin): remove background from `thin_scrollbar`

* feat(view): pass `thin_scrollbar` option to window

* feat(window): gate new `thin_scrollbar` behind option

* fix(window): cmdline bugging out

* fix(cmp): docs_view pops up overlapped when using borders

This is related to 1cfe2f7dfd. The
calculation for how the popup position is calculated was changed, and
so it needed to be reworked to include borders in order to be able to
work.

* ref: `thin_scrollbar` flag -> `scrollbar` option

This change allows users to define which character they will use for
their scrollbar.

* fix(window): use `scrollbar` setting for scrollbar character

Thanks @Astrantia for pointing this one out.

* docs(README): add completion appearance options to FAQ

* fix(): account for `border_offset_row` with `has_bottom_space`

* style(custom_entries_view): group offset with `row`/`col`

* fix(window): scrollbar at full view height

Because the `bar_height` variable must be whole number, and must be rounded up
from a percent, there is a change that we will end up with the maximum
height as a number.

For example, `info.height` = 24 and `total` = 25.

* feat(window): allow scrollbar to be disabled

* fix(window): scrollbar size < 1

* ref(cmp): move border logic to `window.info`

* ref!: window highlighting based on borders

BREAKING CHANGE: `documentation.winhighlight` does not determine the
                 highlighting of the `documentation` view— `CmpWindow`
		 or `CmpBorderedWindow` depending on whether it has a
		 border.

* ref!: float appearance opts -> `cmp.setup.window`

`cmp.setup.completion.border` and `.scrollbar` were both moved to
`cmp.setup.window.completion.border` and `.scrollbar`

BREAKING CHANGE: `cmp.setup.documentation` has been moved to
                 `cmp.window.documentation`, as all of the pertaining
		 options were cosmetic.

TODO: document the change

* fix(window): attempt to get scrollbar's border

* fix(cmp): restore `view.menu.hl_group`

* fix(window): wrong scrollbar position

* ref: get default `CmpItemMenu` from border existence

* chore(cmp): remove old PR comments

* fix(window): scrollbar sometimes too big

* fix(window): docs far away with complete menu scrollbar

* perf(docs_view): reuse `border_width` value

* rev(cmp): restore `CmpItemMenu`

* ref(cmp): distinguish between `ScrollBar` and `ScrollThumb`

* fix(plugin): consistently refer to `Thumb` as `Thumb`

* rev(window): `Pmenu`-style scrollbar when no border

* fix(window): docs_view size wrong when first shown

* fix(window): docs_view scrollbar not responding to size

* fix(window): scrollbar sometimes to small, take 2

* fix(window): scrollbar bg not hiding

* ref(docs_view): put docs closer to completion menu

* fix(window): scrollbar position wrong with right border

* ref(config): add default border to documentation

* fix(window): scrollbar too close without border

* ref(plugin): link `CmpWindow` to `Pmenu`

I set `CmpWindow` to `NormalFloat`, because that is what you would
expect a floating window to use for a highlight group. However at
request I changed it to `Pmenu`.

* ref(plugin): link `CmpWindowBorder` to `CmpWindow`

* fix(window): scrollbar following thumb while scrolling

* ref: add more highlight groups

There just weren't enough highlight groups to satisfy the demands of the
project. If you change `CmpWindow` to `Pmenu`, then the `docs_view`
becomes `Pmenu` as well when on `main` it is `NormalFloat`.

* fix(window): scrollbar overlapping `docs_view` by default

* ref: remove `Bordered` highlight variants

* ref(utils): extract whitespace check to func

* feat: `window.completion.zindex` setting

* ref: `maxwidth|height` -> `max_`

* ref: simplify highlight groups

* feat: `window.*.winhighlight` setting

* ref(utils): `is_whitespace_char` -> `is_visible`

As hrsh7th noted, `''` is not a whitespace character. Yet, it is
necessary to group `''` and `' '` together for certain border behaviors
that are based on visibility. Thus I have renamed the function

* feat: specify `window.*.winhighlight` for un/bordered

* fix(custom_entries_view): set `winhighlight` on `open`

* ref: remove `Cmp*Scroll*` variants

There's no way for `window` to know which kind of window it is drawing a
scrollbar on. Simpler to just have one kind of scrollbar

* feat: distinguish between bordered and unbordered

* ref(cmp): `is_visible` -> `is_invisible`

That's what the function was checking for.

* fix(default): mislabeling of `default` and `bordered`

* chore: rebase fixup

* Change default highlight

* Add misc.rep

* Fix left-side docs_view with scrollbar

* Fix scrollbar

* Fix sbar/thumb win
Improve highlights

* Remove scrollbar cutomization for now

* Remove scrollbar option

* Simplify implementation

* Fix doc width

* Fix outdated docs

* Add comments

* Fix configuration schema

* fmt

* Fix for lint

Co-authored-by: Iron-E <36409591+Iron-E@users.noreply.github.com>
Co-authored-by: hrsh7th <>
2022-04-13 23:51:55 +09:00
hrsh7th
e23de1f2b4 Add cmp.get_entries. Fixes #831 2022-03-15 11:37:24 +09:00
hrsh7th
1001683bee Add doc 2022-03-02 12:13:01 +09:00
hrsh7th
ba47440a97 Improve common string mapping instruction 2022-02-14 13:26:36 +09:00
hrsh7th
2d8f40b297 Add docs for integarting copilot.vim 2022-02-13 22:32:22 +09:00
hrsh7th
c07350181f Implement matching config.
Fix #796
2022-02-13 16:44:45 +09:00
hrsh7th
070c5572ad Implement shell like common string completion.
Fix #785
2022-02-13 14:34:28 +09:00
hrsh7th
7e473b99d3 Support multiple filetypes
Fix #786
2022-02-12 21:05:17 +09:00
hrsh7th
26a9184c88 Add filetype config
Use view.entries == 'native' instead of experimental.native_menu
2022-02-11 15:20:24 +09:00
Filipi Zimermann
7cb14b0c0f Fix docs to avoid "E20: Mark not set" error (#753) 2022-01-23 22:23:41 +09:00
Jason Chen
4b5d0a5731 Improve wording on keyword_length documentation (#719) 2022-01-10 21:45:36 +09:00
hrsh7th
3f7b7b258a Add complete_done event and improved the recently_used sorter.
Fix #708
2022-01-08 13:38:55 +09:00