Commit Graph

547 Commits

Author SHA1 Message Date
Lyude
a9c701fa7e Round up width/height for windows (#1373)
Ever since neovim introduced the nvim_ui_pum_set_bounds() call, GUI clients
have gained the ability to inform neovim of the current bounds of an
external popup menu provided by ext_popupmenu.

Since external popup menus are allowed to be any size in pixels which may
or may not line up cleanly on the grid, nvim allows for fractional
coordinates to be reported. This also will mean that in the event of this,
we'll end up with a cmp.WindowStyle with a float value for width/height -
which is incompatible with vim.api.nvim_open_win() and will cause us to hit
errors with GUI clients using this API call.

So, fix this by simply rounding up the width/height.
2022-12-27 13:11:42 +09:00
Marcus Caisey
d09b0c396a convert encoding of range instead of start / end (#1364) 2022-12-23 16:43:55 +09:00
NAKAI Tsuyoshi
8bbaeda725 fix(api): consider multibyte characters in get_screen_cursor (cmdline) (#1352)
* fix(api): consider multibyte characters in get_screen_cursor (cmdline)

* style: format with stylua

* test: tell luacheck that it is intended unreachable code
2022-12-15 20:27:02 +09:00
hrsh7th
93f385c176 Fix #1327 2022-11-28 00:24:10 +09:00
hrsh7th
bb95d975ff Fix #1329 2022-11-27 13:11:01 +09:00
hrsh7th
4c05626ccd Improve a bit 2022-11-25 03:20:07 +09:00
hrsh7th
431f045968 Refactor a bit 2022-11-25 01:57:19 +09:00
hrsh7th
0a9ccdf122 Fix #1321
Fix #1315
2022-11-25 01:46:04 +09:00
hrsh7th
31a145c866 Fix #1249 2022-11-24 01:22:34 +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
Zhizhen He
a188be8559 Add a rule to install stylua and use the local one for other rules (#1307) 2022-11-16 14:22:24 +09:00
hrsh7th
e820335208 LSP 3.17 (#1306)
* 3.17

* PositionEncodingKind

* Implement PositionEncodingKind

* Remove luarc.json
2022-11-16 01:27:15 +09:00
figsoda
aee40113c2 fix: type annotation for enabled field in ConfigSchema (#1299) 2022-11-13 13:58:01 +09:00
Zahid
c53dd36adc Fix parantheses bug and use string.rep (#1297) 2022-11-12 11:16:12 +09:00
stnley
69c85860d7 chore: run formatting (#1295)
Co-authored-by: stnley <michael@stnley.io>
2022-11-11 21:44:36 +09:00
gegoune
c37ea78941 Update docs_view.lua (#1292)
Although I have `showbreak` set for normal editing I would rather not see that in documentation. RFC.

Setting to `NONE` as per `:h showbreak`:

```
	A window-local value overrules a global value.  If the global value is
	set and you want no value in the current window use NONE:  
		:setlocal showbreak=NONE
```
2022-11-11 11:27:19 +09:00
stnley
ec86960d79 fix: "count" option inserting characters (#1293)
* fix: "count" option inserting characters

Closes #1291

* Remove loop

Co-authored-by: stnley <michael@stnley.io>
2022-11-11 10:53:29 +09:00
hrsh7th
11839571ab Fix #1276 2022-11-10 21:58:39 +09:00
NAKAI Tsuyoshi
16ec8c6b12 fix(custom_entries_view): offset is also the number of bytes (#1288) 2022-11-10 09:26:26 +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
NAKAI Tsuyoshi
c8d4afdad6 fix(custom_entries_view): consider multibyte characters (#1287) 2022-11-09 19:25:26 +09:00
sanka047
9bb8ee6e2d fix(custom_entries_view): remove off-by-one error with bottom_up selection order (#1261)
Closes #1260
2022-10-29 10:04:41 +09:00
hrsh7th
3347dd3c59 Fix #1217 2022-10-15 15:20:35 +09:00
hrsh7th
69476c9e06 ci 2022-10-15 15:16:27 +09:00
hrsh7th
bf1b112615 Remove ansiblels test 2022-10-15 15:11:07 +09:00
figsoda
714ccb7483 fix compatibility with nvim < 0.8 (#1227) 2022-10-12 00:35:19 +09:00
hrsh7th
53bd574901 Fix #1213 2022-10-11 11:44:23 +09:00
AF
99ef854322 fix(context): compatibility with nvim<0.8 (#1224)
`get_captures_at_position` has been renamed to `get_captures_at_pos`: neovim/neovim#20331.
Fallback to `get_captures_at_position` in case `get_captures_at_pos` is `nil`.
2022-10-11 09:16:58 +09:00
AF
0ad2450ff6 fix(context): in_treesitter_capture (#1211)
* fix(context): `in_treesitter_capture`

`in_treesitter_capture` used to compare a node:type() with what should
be a capture, returning always a falsy value.
The example https://github.com/hrsh7th/nvim-cmp/wiki/Advanced-techniques#disabling-completion-in-certain-contexts-such-as-comments
did not work as expected, being in_treesitter_capture("comment") always
not true.
Now it works as expected.

* feat(context): `in...capture`, `in...group` table

`in_treesitter_capture` and `in_syntax_group` can take a list of string
as argument.

* refactor(context): in...capture use vim.treesitter

Use vim.treesitter.get_captures_at_cursor()

* fix(context): get_captures_at_cursor -> ..._at_pos

get_captures_at_cursor() sometimes fails. Do it explicitly with
get_captures_at_pos(buf, row, col)

* refactor(context): vim.fn -> vim.api

Get row and col using vim.api and not vim.fn in in_syntax_group, as done
in in_treesitter_capture
2022-10-10 17:06:41 +09:00
lvimuser
0e436ee23a fix(entry/get_replace_range): workaround for end char matching cursor position (#1177)
fixes #1156
2022-10-07 18:04:07 +09:00
yuys13
b0dff0ec4f Update type annotations for setup.cmdline (#1194) 2022-10-02 23:24:50 +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
203aa26fc2 Fix for cmdheight=0
Fixes #1196
Fixes hrsh7th/cmp-cmdline#64
2022-10-02 20:22:13 +09:00
hrsh7th
beb1d14c5e Add scrolloff option for completion window. 2022-10-02 19:47:01 +09:00
yuys13
2427d06b65 Format by stylua (#1195) 2022-09-27 12:27:31 +09:00
Amar Al-Zubaidi
83c097699d setup.cmdline: support using a table (#1193) 2022-09-26 11:51:01 +09:00
hrsh7th
dd4173fcee Optimize performance more 2022-09-25 21:56:35 +09:00
hrsh7th
e1f31778a8 Optimize performance 2022-09-25 21:24:27 +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
Lewis Russell
6b3dbc8377 fix(timer): close timers before Neovim exits (#1166) 2022-09-02 11:29:13 +09:00
yuki yano
b5885696b1 Add incsearch_redraw_keys settings (#1162) 2022-08-31 12:42:43 +09:00
hrsh7th
058100d813 Fix #1149 (temporary fix) 2022-08-23 15:21:32 +09:00
hrsh7th
347fabf906 Fix #1146 2022-08-23 14:52:04 +09:00
hrsh7th
828768631b Re-fix #1144 2022-08-21 02:11:49 +09:00
hrsh7th
995a2a9f65 Fix #1144 2022-08-21 01:56:04 +09:00
hrsh7th
3cc0c182ec Fix #1142 2022-08-20 21:58:53 +09:00
hrsh7th
7e67df513a Fix #1135 2022-08-20 20:42:43 +09:00
hrsh7th
db261b4e2b Fix onetime configuration handling 2022-08-20 20:27:48 +09:00
lvimuser
27bc575d1e fix(entry/get_replace_range): handle TextEdit.range (#1140)
fixes cmp.mapping.confirm when ConfirmBehavior is set to Replace
2022-08-20 19:52:35 +09:00
hrsh7th
49c4050e24 Refactor a bit 2022-08-20 19:23:05 +09:00