Commit Graph

111 Commits

Author SHA1 Message Date
mattn
87eb253ce8 add b:asyncomplete_refresh_always (#298) 2025-10-18 17:42:27 +09:00
David Briscoe
73ac8e4e45 Prevent 'Not allowed to change text here' (#259)
Don't call complete() if startcol would be invalid.

I see a lot of preprocess_complete with `start_col=0` but I see some
without, so I guess those are the firings with valid data.

Not entirely sure what causes this, but it occurs often when doing
completion with omnisharp. I often get this error while typing or
triggering completion. I'd rather nothing happen than error spam, so
silence it.

Example callstack caused from explicit triggering of completion:
    OmniSharp#Complete[10]
    OmniSharp#actions#complete#Get[13]
    <SNR>281_recompute_pum[44]
    <SNR>281_default_preprocessor[34]
    asyncomplete#preprocess_complete[16]
    E578: Not allowed to change text here
2021-08-19 15:43:40 -07:00
Jay Sitter
dffee28005 Obey g:asyncomplete_min_chars (#254) 2021-04-29 16:31:13 -07:00
Jagua
4be3c16b33 Fix error: "E118: Too many arguments for function: copy" (#249)
```text
Error detected while processing function <SNR>244_recompute_pum[44]..<SNR>244_default_preprocessor[18]..<SNR>244_strip_pair_characters:
line    7:
E118: Too many arguments for function: copy
```
2021-01-28 15:35:00 +00:00
Prabir Shrestha
e546095e4a add support for fuzzy matching (#246) 2020-12-22 23:28:06 -08:00
mattn
c5f5808581 Check b:asyncomplete_active_sources exists (#244) 2020-11-27 23:31:51 +09:00
mattn
4fba3b64fa Check b:asyncomplete_active_sources exists (#243) 2020-11-27 23:26:14 +09:00
mattn
87fdbf6414 Check b:asyncomplete_triggers exists (#242) 2020-11-27 23:17:22 +09:00
hhaoao
0b81a60fad Improve the server exit experience due to other crashes. (#241) 2020-11-27 02:32:42 +00:00
mattn
ed75b1c92f Fix vint errors (#238) 2020-11-04 16:35:10 +09:00
mattn
2107094f83 Fix custom filter (#235) 2020-10-22 08:44:04 +09:00
ii41
52a627924c Clear matches and enable closing popup menu (#230)
* Remove "skip popup" related logic

* Fix matches not getting cleared

Before this commit we don't clear the matches when the text
under the cursor is no longer suitable for completion. This
causes e.g. removing everything using <BS> does not close
the completion menu.

* Allow closing popup menu

Closing popup menu calls completion itself, making it
impossible to be successful.

We used to have a "skip popup" logic to fix this. It was
removed 2 commits ago for being too confusing.

To fix this a check is adapted to make sure that completion
is only called when the completion context has changed.
Since closing popup menu does not change the completion
context, it no longer calls completion, and therefore can
succeed.

Previously this check lets us not complete when we move to a
different line we are in insert mode, through for example
<CR> or <BS>, but actually we are not afraid of this. When
we enter a newline, we don't complete anyway since the
refresh pattern is not matched, and when we backspace to a
previous line, and the line happens to end with something
that will trigger a completion, why do we not want to
trigger it?

* Also compare completion base to determine context change

It is possible that in some situation changing the text under the
cursor does not change the position of the cursor, so we also
compare the completion base to determine whether the context has
changed.
2020-10-17 09:57:48 -07:00
Prabir Shrestha
e82ab2e849 Revert "Clear matches (#227)" (#229)
This reverts commit db26d431a8.
2020-10-11 18:48:32 -07:00
ii41
db26d431a8 Clear matches (#227)
* Remove "skip popup" related logic
* Fix matches not getting cleared

Before this commit we don't clear the matches when the text
under the cursor is no longer suitable for completion. This
causes e.g. removing everything using <BS> does not close
the completion menu.
2020-10-11 17:59:53 -07:00
mattn
b65efdced5 Support custom filter (#185) 2020-10-09 18:14:07 +09:00
mattn
20a279b079 Set <nomodeline> for doautocmd (#217) 2020-09-17 22:35:43 +09:00
Prabir Shrestha
bb8a9924b7 use allowlist and blocklist and deprecate the old keys (#204) 2020-06-25 23:46:12 -07:00
mattn
75f25b059f Fix errors while editing with non-named buffer. (#201) 2020-05-18 15:15:30 +09:00
Jay Sitter
91ac1f6e6f Add setting for minimum string length to trigger auto popup (#135)
* Add setting for minimum string length to trigger auto popup

* Use ternary

* Use simplified function

* Fix bug in new return function

* Add documentation for min_chars

* Add buffer override for min_chars
2020-05-10 09:15:27 -07:00
David Briscoe
1f8d8ed26a Only warn about missing timers functionality once (#181)
plugin/asyncomplete.vim sets up an autocmd to invoke
asyncomplete#enable_for_buffer() for every BufEnter. If we don't clear
this autocmd, then it will try to call that function, which will try to
source the autoload file, which outputs the error again.

Clearing that autocmd group stops the cycle and limits the number of
warnings to one.
2020-02-24 19:58:56 -08:00
mattn
312861e9f9 Remove paired suffixes (#183)
* Remove paired suffixes

* Fix indentations

* This hack should work for double-quote or single-quote.
2020-02-19 15:18:01 +09:00
mattn
c3b7078fd4 Fix vint error (#182) 2020-02-15 12:23:01 -08:00
mattn
52f857a4c4 Add b:asyncomplete_refresh_pattern (#179) 2020-02-04 19:49:05 -08:00
ishitaku5522
797394b1c1 Adding get_source_info() and get_source_names() (#154)
* add get_source_info() and get_source_names()

* update document

* remove unnecessary example draft
2019-09-08 09:58:17 -07:00
Donnie West
d5b5492961 Filter based on each source's startcol (#152) 2019-07-21 09:29:53 -07:00
ishitaku5522
bffa8b62dd Fix mismatch between b:asyncomplete_active_sources/triggers and s:servers (#147) 2019-06-10 14:56:23 -07:00
Prabir Shrestha
9b02b42d22 fixed spacing 2019-06-10 14:53:46 -07:00
simeir
3a5b338585 Solve pum flickering and closing when completion triggered by trigger character (#145)
* Solve Inconsistentcy in usage of startcol

the word startcol sometimes refers to the column where the completion starts,
sometimes the first index of completion base. I made all "startcol"
refer to column where completion starts, and renamed all cases where
this word used to refer to index "xxxidx"

* changed refresh pattern

* Fix wrong startcol when force refresh

* force refresh takes care of the scenario where no word presents
2019-06-10 14:51:26 -07:00
ishitaku5522
db0cd8a0c2 Add "asyncomplete#close_popup()" function (New PR for #126) (#134)
* add close_popup function for v2

* update document for asyncomplete#close_popup/cancel_popup

* update _foce_refresh to reset skip completion flag

* disable popup until next word after close popup
2019-04-13 10:44:07 -07:00
Jagua
f4a5b881c8 Fix "Undefined variable..." error in |command-line-window| (#132) 2019-04-02 10:02:09 -07:00
Prabir Shrestha
9abca3ec67 use stridx for default_preprocessor 2019-03-27 10:56:49 -07:00
Prabir
623c744c13 add support for complete_info to ignore built-in completions 2019-03-17 12:04:18 -07:00
Prabir
cad49e5ef1 move augroup silent messages up 2019-03-17 11:32:41 -07:00
Prabir Shrestha
1af7798742 add asyncomplete_silence_messages 2019-03-09 10:45:33 -08:00
Prabir Shrestha
47a1914244 fix unregister_source 2019-03-06 15:51:14 -08:00
Prabir Shrestha
3455b935b6 stop timer on insert_leave 2019-03-03 22:29:47 -08:00
Prabir Shrestha
1eacfe20b6 implement g:asyncomplete_preprocessor 2019-03-03 12:44:04 -08:00
Prabir Shrestha
b30fc76c63 remove unused manager 2019-03-03 12:00:29 -08:00
Prabir Shrestha
9f49b3283b Merge branch 'v2' into popup-delay-v2 2019-03-03 10:54:24 -08:00
Prabir Shrestha
8e019bfe49 added core to all logs 2019-03-03 10:52:12 -08:00
Prabir Shrestha
f122479d44 add check for different lnum 2019-03-03 10:47:23 -08:00
Jay Sitter
bf51ca9881 Add popup delay option 2019-03-03 10:45:22 -05:00
Prabir Shrestha
d3b2d3d52b remove old options and cleanup docs 2019-03-02 20:12:42 -08:00
Prabir Shrestha
d74c075d2f implement g:asyncomplete_auto_popup 2019-03-02 20:06:40 -08:00
Prabir Shrestha
1cd36baa22 fix s:normalize_items 2019-03-02 17:48:58 -08:00
Prabir Shrestha
0922910b7c move filter to different function 2019-03-02 15:59:30 -08:00
Prabir Shrestha
b79e6e42d7 move log before error 2019-03-02 15:06:01 -08:00
Prabir Shrestha
146e643dfd implement notify_event_to_source 2019-03-02 15:00:42 -08:00
Prabir Shrestha
c4c0f34737 implement force_trigger 2019-03-02 14:56:01 -08:00
Prabir Shrestha
e52e70c72c ignore refresh of menu if selected 2019-03-02 05:08:17 -08:00