Commit Graph

454 Commits

Author SHA1 Message Date
tzachar
1558d110d7 Bottom up mode for custom menu (#848)
* Try to fix col adjustment (#843)

* Try to fix col adjuastment

* Improve duplicated text handling

* Bottom up mode for custom entry menu

When in command line mode, the custom entry window opens up to an
unexpected height, depending on the current count of completion items.
The above makes it hard to anticipate where to look at, and makes life a bit
harder.

This patch adds an option to open the custom entries view in a bottom up
mode, and flips the regular behaviour of next/prev entry in this mode.
Setup is as easy as:

```
cmp.setup.cmdline(':', {
  view = {
    entries = {name = 'custom', direction = 'bottom_up' }
  }
}
```

* fix stylua complaints

* sylua barfs

* solve some corner cases

* properly reverse entries table

* make custom view follow cursor

* respect default as top_down

* stylua

* more stylua

Co-authored-by: hrsh7th <hrsh7th@gmail.com>
2022-04-08 22:33:09 +09:00
hrsh7th
801a9f98bb Improve macro handling 2022-04-08 22:04:08 +09:00
hrsh7th
7dbe34e36d Fix snr notation 2022-04-02 01:32:49 +09:00
hrsh7th
b3ca3fde06 Fix recursive mapping problem. Thank you tpope!
Fix #858
Fix #871
2022-04-02 00:32:19 +09:00
hrsh7th
15f08a8faa Avoid misleading suggested configuration 2022-03-31 13:49:25 +09:00
hrsh7th
c1589830bd Prefer above identifier for locality sort 2022-03-31 13:48:35 +09:00
hrsh7th
3a1649297a Improve scopes sorter 2022-03-31 13:35:31 +09:00
hrsh7th
a97d2f46f0 Use get_word instead to sort. 2022-03-31 11:16:53 +09:00
hrsh7th
c1d0cd0fc5 Use cache for locality sort 2022-03-30 21:36:42 +09:00
hrsh7th
a5024f916a Add locality sort (easy version) 2022-03-30 21:16:20 +09:00
hrsh7th
2de24d3e1c Rename locals to scopes 2022-03-30 20:50:36 +09:00
hrsh7th
dc3113a79f Add sort (required nvim-treesitter) 2022-03-30 20:41:32 +09:00
hrsh7th
5e794cdf5b Improve timing 2022-03-30 17:10:07 +09:00
Eric
dd6e4d96f9 use only the first filetype when formatting (#857) 2022-03-28 18:22:45 +09:00
kevinhwang91
2dff6a8b60 fix(misc): kill redundant redraw during incsearch (#485) (#859) 2022-03-28 18:14:26 +09:00
hrsh7th
71d7f46b93 Try to fix col adjustment (#843)
* Try to fix col adjuastment

* Improve duplicated text handling
2022-03-17 15:53:10 +09:00
Nicolas Mattia
c60cb7a100 Make sure config is not nil (#836)
This ensures that the config is at least `{}` and never `nil`.
Otherwise, calling `cmp.setup()` errors out.
2022-03-16 13:42:57 +09:00
hrsh7th
e23de1f2b4 Add cmp.get_entries. Fixes #831 2022-03-15 11:37:24 +09:00
xiaxi
45e93cdf57 Redundent kind of lsp.MarkupKind (#819) 2022-03-01 11:24:09 +09:00
hrsh7th
13d64460cb Fix entry:get_word()'s cache condition 2022-02-15 20:34:21 +09:00
hrsh7th
4f5cc6a9c8 Fix #801
Fix #615
Fix #798
2022-02-15 20:20:57 +09:00
hrsh7th
ba47440a97 Improve common string mapping instruction 2022-02-14 13:26:36 +09:00
hrsh7th
4bc038f72d fmt 2022-02-13 18:53:30 +09:00
hrsh7th
bf78446d59 Refactor wildmenu_entries_view 2022-02-13 18:53:09 +09:00
hrsh7th
a8150a2c7d Improve complete_common_string 2022-02-13 16:47:11 +09:00
hrsh7th
c07350181f Implement matching config.
Fix #796
2022-02-13 16:44:45 +09:00
hrsh7th
33fc65f174 test&lint&fmt 2022-02-13 14:38:31 +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
20152c6afd Fix #789 2022-02-12 21:01:22 +09:00
hrsh7th
26a9184c88 Add filetype config
Use view.entries == 'native' instead of experimental.native_menu
2022-02-11 15:20:24 +09:00
Jonas Strittmatter
ad3c1adbc3 Refactor context module, return false (not {}) in context.in_treesitter_capture (#777) 2022-02-11 14:23:59 +09:00
Daniel Fortes
3a2f1bbc55 Added event_chars property to confirm_done event (#782)
* Added event_chars property to confirm_done event

Currently it seems there is no way for someone listening to the
`confirm_done` event to know exactly what character was used to commit
the completion confirmation.

This commit adds a `event_chars` property to the `confirm_done` event.
Its value is just the `chars` variable form the `core.on_keymap`
function.

* Renamed `commid_chars` to `commit_character`
2022-02-11 14:11:00 +09:00
Jonas Strittmatter
df05fe6ff4 Fix: close the view if cmp.enabled = false and the user types some text (#781)
A scenario where this lead to unintended behaviour previously was the following:

If cmp.enabled was configured such that it disabled cmp when in a comment,
and the user typed '--' in a lua file (this starts a comment), the cmp window
would not close if further text is typed on that line (although cmp should be disabled).
2022-02-11 13:36:54 +09:00
hrsh7th
a7fea2ca9f Decrease THROTTLE_TIME 2022-02-05 14:00:06 +09:00
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
d6838996da improve 2022-01-31 17:04:38 +09:00
hrsh7th
55f04e49dc Improve sync API 2022-01-31 14:30:57 +09:00
hrsh7th
0d23640fb6 Fix #757 2022-01-31 14:27:33 +09:00
hrsh7th
f4bb6ffdb1 Improve keymap (#768)
* Improve keymap

* improve

* rename

* Add tests

* Use nightly for testing

* Enable failing test

* Add manual test case
2022-01-31 14:16:48 +09:00
hrsh7th
d93104244c Wait for filtering completion 2022-01-25 16:27:21 +09:00
hrsh7th
57101a2e26 Re fix #754 2022-01-25 11:51:06 +09:00
hrsh7th
f960d4829e Fix Ci 2022-01-25 10:12:09 +09:00
hrsh7th
2d67b6dd76 Fix #756 2022-01-25 10:06:36 +09:00
hrsh7th
27123b1297 Fix #754 2022-01-24 23:46:47 +09:00
hrsh7th
1797f9e1ac fmt&lint 2022-01-20 17:26:05 +09:00
hrsh7th
7a1e484806 Improve recently used 2022-01-20 17:06:48 +09:00
hrsh7th
8fc8d31cf4 Support import completion 2022-01-18 19:32:51 +09:00
hrsh7th
682818b211 evacuate -> fallback 2022-01-18 19:14:38 +09:00