Commit Graph

238 Commits

Author SHA1 Message Date
hrsh7th
1c33887afb Fix keymap bug 2021-11-02 02:06:34 +09:00
hrsh7th
b7f79a19c6 Fix #443 2021-11-02 01:52:51 +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
hrsh7th
e8cb695b0b Fix #436 2021-11-01 14:00:59 +09:00
Dmytro Meleshko
baa39271b2 Fix native menu not respecting cmp.PreselectMode.None sometimes (#447) 2021-11-01 12:55:59 +09:00
Charly Delay
b10bb327f3 misc.merge: ensure that misc.none is never returned (#441)
Before this change:

1. `misc.merge({a = misc.none}, {a = nil})` returned `{a = misc.none}`
2. `misc.merge({a = nil}, {a = misc.none})` returned `{a = misc.none}`

(1) can cause error if a non-existing mapping is set to `config.disable`
(which is an alias for `misc.none`).

(2) does not cause any issue to date, but is inconsistent with the
expected behavior of `misc.merge(…)`.

After this change:

1. `misc.merge({a = misc.none}, {a = nil})` returns `{a = nil}`
2. `misc.merge({a = nil}, {a = misc.none})` returns `{a = nil}`

Fixes #440.
2021-10-30 19:05:20 +09:00
anstadnik
ab7f368547 Add mappings for visual mode (#438) 2021-10-30 13:55:26 +09:00
hrsh7th
669803b9ff Normalize mapping key before use
May be fixes #431
2021-10-29 22:44:41 +09:00
hrsh7th
3945dc5d00 Add basic recently_used comparator 2021-10-29 18:46:51 +09:00
hrsh7th
a6412e590c Fix #423 2021-10-29 13:50:00 +09:00
hrsh7th
732f67dead Fix #427 2021-10-29 13:09:41 +09:00
hrsh7th
6696c6a088 Fix #423 2021-10-28 20:08:08 +09:00
hrsh7th
52d9411cf2 Re-fix native tab mapping 2021-10-28 18:49:12 +09:00
hrsh7th
c01de2bd19 Fix #425 2021-10-28 16:48:02 +09:00
hrsh7th
1c498a5497 Add cmp.event:on() (#418) 2021-10-28 11:02:19 +09:00
hrsh7th
58d081300b Fix #420 2021-10-28 01:59:50 +09:00
hrsh7th
881ca573db Re-support script mapping 2021-10-28 00:50:50 +09:00
hrsh7th
a58916386b fmt 2021-10-27 12:39:26 +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
b5899f05c5 Fix #414 2021-10-26 23:37:11 +09:00
hrsh7th
ea6dde8081 Add tests for #226 2021-10-25 23:11:59 +09:00
hrsh7th
880137f5e8 Fix #226 2021-10-25 23:00:22 +09:00
hrsh7th
f1da3adddc Add cmp.config.disable for opt-out default setting 2021-10-25 22:50:38 +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
b185e303bd Improve group handling 2021-10-23 00:38:55 +09:00
hrsh7th
921ee264fd Add default mapping as the same as native mapping. 2021-10-23 00:19:43 +09:00
hrsh7th
e699962a49 Fix #389 2021-10-22 22:50:46 +09:00
hrsh7th
533f17c569 group -> group_index 2021-10-22 19:52:48 +09:00
hrsh7th
530834e8c0 Fix group index bug 2021-10-22 19:50:28 +09:00
hrsh7th
93eb8cef78 fmt 2021-10-22 18:30:45 +09:00
hrsh7th
0d4275e62d Fix 2021-10-22 18:26:50 +09:00
hrsh7th
bf2b23863a Fix 2021-10-22 18:26:23 +09:00
hrsh7th
e4a2cec153 Implement source group.
Fixes #391
2021-10-22 18:24:03 +09:00
Alex Tylor
b546f50f09 Expose get_selected_entry() from view module to main cmp module fixes #385 (#386)
* Expose get_selected_entry() from view module to main cmp module fixes #385

* add get_active_entry() also

* fix linting

* remove unused vars

Co-authored-by: alex.tylor <atylor@gmail.com>
2021-10-22 17:47:55 +09:00
hrsh7th
26e73f3140 Fix #372 2021-10-19 14:55:14 +09:00
hrsh7th
775a371660 Fix #375 2021-10-19 14:47:41 +09:00
hrsh7th
c57969580d Fix #374 2021-10-19 14:38:10 +09:00
hrsh7th
bad20dea88 Improve dot-register and undo-point (Hm... undopoint may be improved more) 2021-10-19 00:39:45 +09:00
hrsh7th
289d0929be Remove meaningless code 2021-10-19 00:22:25 +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
ebe040b1a9 Fix #279 2021-10-16 13:27:36 +09:00
hrsh7th
5fe7dc1eea Fix #348
Fix #254
2021-10-16 12:16:37 +09:00
hrsh7th
7d484d8bfd Fix same name property
Fix #354
2021-10-16 12:05:56 +09:00
hrsh7th
0dcc2eb5d3 Remove C-c mapping 2021-10-16 11:55:47 +09:00