Commit Graph

52 Commits

Author SHA1 Message Date
hrsh7th
de69c657eb Fix menu position for horizontal splitting 2022-02-02 19:25:25 +09:00
tzachar
124f1611f1 Statusline view in search mode or command line mode (#729)
* Search mode horizontal view

Enabled by setting `experimental.horizontal_search = true`

* use stylua

* move to a floating window instead of abusing status line

* pass all tests

* rework

1. rename entries view file and memeber to wildmenu_entries_view
2. move config to config.view.entries
3. support both in insert mode and cmdline
4. make separator configurable by config.view.separator

* rearange wildmenu config

Changed config to:
```lua
  view = {
    entries = {name = 'wildmenu', separator = '|' }
  },
```

* allow view.entries to be either a literal string or a table
2022-02-01 16:47:34 +09:00
hrsh7th
098182e2c2 Fix #734 2022-01-15 18:56:29 +09:00
hrsh7th
796f925915 Fix #703 2022-01-07 00:38:42 +09:00
Daniel Steinberg
4a19645374 Use a default zindex of 50 for documentation (#661)
This matches the default zindex for floating windows.
2021-12-21 10:52:43 +09:00
Dmytro Meleshko
9c07c2d1c5 Fix vim.fn.complete being constantly called (#654) 2021-12-20 14:54:16 +09:00
hrsh7th
91b6f503c1 Fix #582 2021-12-14 22:12:00 +09:00
Dmytro Meleshko
727ddee59e Fix rendering of wide characters in the custom completion window (#641) 2021-12-13 13:05:55 +09:00
hrsh7th
7b744e0589 Fix multibyte chars 2021-11-27 18:52:57 +09:00
Lyude
a86017117b Fire change events when selecting different items with native menu completion (#514)
Previously we didn't do this, which resulted in the documentation window
not being shown when switching through different completion items. Fix
this by firing the change event in select_next_item and select_prev_item.
2021-11-27 17:43:40 +09:00
hrsh7th
6fa7681812 Fix #321 2021-11-23 22:34:47 +09:00
hrsh7th
f15be9e3ec Fix #559 2021-11-22 17:49:03 +09:00
hrsh7th
286b9f78d1 Refactor get_active_entry and core.filter (#535)
* Refactor get_active_entry and core.filter

* Refactor source.lua
2021-11-17 22:38:56 +09:00
hrsh7th
1cfe2f7dfd Fix #526 2021-11-15 21:22:44 +09:00
hrsh7th
2de40ccf49 Fix #520 2021-11-15 14:26:50 +09:00
hrsh7th
753f5b7c92 Fix #516 (#517)
* Fix #516

* Fix

* Fix and tests

* fmt lint
2021-11-14 02:47:31 +09:00
hrsh7th
3968bea5e2 Fixes the bug that the cmp.close does not close the menu when using native_menu. 2021-11-09 14:11:51 +09:00
hrsh7th
ac7c5fc00e Fix #473 2021-11-08 21:24:10 +09:00
Ben Smith
40f667997a Add linebreak option to cmp documentation window (#486) 2021-11-08 13:52:02 +09:00
Javier Lopez
9734453d77 fix(ghost_text): generate it using chars instead of bytes (#471)
Previously if the completion entry text had a multibyte character the
ghostly text renderd improperly, for example:

The cursor position is "|"

1. In this case the ghost text was spliting a multibyte character.

entry: comunicación
prev:  comunicacio|<b3>n
now:   comunicacio|n

2. In this case the multibyte character was before meking the index
   wrong, therefore presenting an extra character of the entry as ghost text.

entry: árbol
prev:  arbol|l
now:   arbol|

With this changes the calculation for the bytes to show is done based on
characters avoiding both of the issues above.
2021-11-05 11:49:42 +09:00
hrsh7th
a881adb1d7 Fix native menu bug 2021-11-04 02:45:23 +09:00
hrsh7th
0e1ae900a5 Fix #449 2021-11-02 12:13:18 +09:00
hrsh7th
674d2b1389 Rewrite keymap.lua (#452)
* Move feedkeys related codes to `cmp.utils.feedkeys`

* Improve mapping handling

* Fix test

* fmt
2021-11-01 22:15:28 +09:00
Dmytro Meleshko
baa39271b2 Fix native menu not respecting cmp.PreselectMode.None sometimes (#447) 2021-11-01 12:55:59 +09:00
hrsh7th
cae2e8f48b RFC: cmdline completion (#362)
* manual support dot-repeat

* cmdwin and terminal

* cmdline only

* Fix

* fix

* Improve

* Fix test

* Support macro

* disable cmdline for now

* Simplify

* fmt

* consume once

* Ignore = type

* cmdline

* fmt

* Improve

* update

* fmt

* Support incsearch

* fix

* Add api

* Avoid cmdline completion if the native_menu enabled

* fix for macro

* Improve

* fmt

* Insert-mode only by default

* Update

* avoid conflict

* Improve default mapping

* Fix

* fix

* similar to native

* Update

* Fix README.md

* Improve

* Use <afile>
2021-10-27 12:38:46 +09:00
hrsh7th
5f5e8442f1 Fix #409 2021-10-25 11:19:19 +09:00
Ihor Kalnytskyi
1e7355a5fb Respect completeopt's noselect in custom menu (#402)
From NeoVim's `completeopt` documentation:

> noselect  Do not select a match in the menu, force the user to
>           select one from the menu. Only works in combination with
>           "menu" or "menuone".

When `completeopt = "menu,menuone,noselect"` is used, custom completion
menu does not respect `noselect` and preselects the first item. No
preselection happens in case of native menu.

This patch addresses the bug and ensures that in case of custom menu no
items are preselected if `noselect` is specified in `completeopt`.

Fixes #332
2021-10-24 23:30:59 +09:00
hrsh7th
e699962a49 Fix #389 2021-10-22 22:50:46 +09:00
hrsh7th
a6a98856c3 Remove check code 2021-10-18 13:25:06 +09:00
hrsh7th
6b4e6b9694 Fix #369 2021-10-18 12:02:23 +09:00
hrsh7th
1e913aefd9 Fix #345 2021-10-18 11:47:17 +09:00
hrsh7th
4ecf2a2426 Fix #364 2021-10-17 00:17:24 +09:00
hrsh7th
0f28030aef Improve macro & dot-repeat support (#363)
* manual support dot-repeat

* cmdwin and terminal

* cmdline only

* Fix

* fix

* Improve

* Fix test

* Support macro

* disable cmdline for now

* Simplify

* fmt

* consume once

* Ignore = type

* cmdline

* Remove cmdline features
2021-10-16 23:37:32 +09:00
hrsh7th
f0a6cca5b9 Fix #355 2021-10-16 22:09:01 +09:00
hrsh7th
7d484d8bfd Fix same name property
Fix #354
2021-10-16 12:05:56 +09:00
hrsh7th
f5393d5bd9 Fix #340 2021-10-13 21:14:07 +09:00
hrsh7th
3e062bcc7d Change var name 2021-10-13 21:14:07 +09:00
hrsh7th
49acc84853 Add item fields order
Fixes #337
2021-10-12 20:50:05 +09:00
Xuyuan Pang
2a8dc6208a Added option to set zindex of documentation window (#335) 2021-10-12 13:33:46 +09:00
hrsh7th
fe2b245ea1 Fix #330 2021-10-11 18:38:01 +09:00
hrsh7th
2f2794decd refactor 2021-10-11 18:38:01 +09:00
hrsh7th
2085cc4d35 Fix #294 2021-10-11 03:03:02 +09:00
hrsh7th
d8e6a865e4 Use instead of 2021-10-11 00:43:53 +09:00
hrsh7th
6790f0a853 Fix #320 2021-10-10 23:49:39 +09:00
hrsh7th
0a31d67219 Lazy buffer creation 2021-10-10 13:57:37 +09:00
hrsh7th
b16663f780 Improve 2021-10-10 12:50:35 +09:00
hrsh7th
2ebdccf61a Fix #306
Fix #296
Fix #293
Fix #291
2021-10-10 11:54:30 +09:00
Jongwook Choi
68f7eeb3f0 Make the pum window property respect future changes of &pumblend (#313)
PR #310 added a support for the pumblend property for the custom
floating completion pop-up menu, but the winblend option is set
globally which doesn't respect future changes (e.g., `set pumblend=..`).

Such window options for the pop-up window that might be changed later
would need to be set when the floating window is being opened.
2021-10-10 01:33:36 +09:00
Aquib
20b99bc54b adding the pumblend property to floating pum window (#310)
* adding the pumblend property to floating pum window

* setting pumblend value directly
2021-10-10 00:31:59 +09:00
hrsh7th
883eee5bbc Use <C-h> and support cmdwin 2021-10-10 00:01:15 +09:00