feat: make 'preinsert' work with 'autocomplete'#18213
feat: make 'preinsert' work with 'autocomplete'#18213girishji wants to merge 4 commits intovim:masterfrom
Conversation
|
I think you overlooked. It was already there. I just noticed it was undefined, so I linked it to the |
|
Thanks, but this seems to break a few screen-dump tests |
Thanks, just noticed this. The failures are caused by the highlight group I am not sure if it would make sense to have a separate highlight group for preinsert. For now, I reverted the changes. @habamax I think |
This change extends Insert mode autocompletion so that 'preinsert' also works when 'autocomplete' is enabled. Try: `:set ac cot=preinsert` See `:help 'cot'` for more details.
Added a new highlight group since preinsert is a different function than what hl-ComplMatchIns serves.
|
Added a new highlight group |
M src/edit.c M src/insexpand.c
M runtime/doc/insert.txt
|
thanks |
|
Thanks |
|
@lifepillar, there is new
|
…sert
Problem: complete: preinsert does not work well with preinsert
Solution: Make "preinsert" completeopt value work with autocompletion
(Girish Palya)
This change extends Insert mode autocompletion so that 'preinsert' also
works when 'autocomplete' is enabled.
Try: `:set ac cot=preinsert`
See `:help 'cot'` for more details.
closes: vim/vim#18213
vim/vim@fa6fd41
Co-authored-by: Girish Palya <girishji@gmail.com>
…sert
Problem: complete: preinsert does not work well with preinsert
Solution: Make "preinsert" completeopt value work with autocompletion
(Girish Palya)
This change extends Insert mode autocompletion so that 'preinsert' also
works when 'autocomplete' is enabled.
Try: `:set ac cot=preinsert`
See `:help 'cot'` for more details.
closes: vim/vim#18213
vim/vim@fa6fd41
Co-authored-by: Girish Palya <girishji@gmail.com>
…sert
Problem: complete: preinsert does not work well with preinsert
Solution: Make "preinsert" completeopt value work with autocompletion
(Girish Palya)
This change extends Insert mode autocompletion so that 'preinsert' also
works when 'autocomplete' is enabled.
Try: `:set ac cot=preinsert`
See `:help 'cot'` for more details.
closes: vim/vim#18213
vim/vim@fa6fd41
Co-authored-by: Girish Palya <girishji@gmail.com>
…complete' (#35692) Problem: complete: preinsert does not work well with preinsert Solution: Make "preinsert" completeopt value work with autocompletion (Girish Palya) This change extends Insert mode autocompletion so that 'preinsert' also works when 'autocomplete' is enabled. Try: `:set ac cot=preinsert` See `:help 'cot'` for more details. closes: vim/vim#18213 vim/vim@fa6fd41 Co-authored-by: Girish Palya <girishji@gmail.com>
Why is the new hl group named |
|
It should be |
|
I wasn’t aware there was a convention. I chose what felt the most intuitive and readable. When I first saw |
|
There seems to be no convention. I personally like PreInsert more. |
|
@chrisbra do you go to neovim github questioning what neovim does? The message could have been a tiny bit more polite. |
Broken by vim#18213 Fixed now. M src/insexpand.c M src/testdir/test_ins_complete.vim
When `"preinsert"` is included in `'completeopt'`, only the `hl-PreInsert` highlight group should be applied, whether autocompletion is active or not. Previously, `hl-ComplMatchIns` was used when autocompletion was not enabled. Related to vim#18213.
agree.
Well, we only have a single highlight group for completion: |
|
The doc is incorrect: This highlight group applies to the unmatched portion of the completion (the suffix). Consider renaming it to something like |
|
So this comes from patch 6a38aff (v9.1.0936). We could consider renaming it. But I think this is too late already |
|
According to the document you have recently authored, it is not too late :) FWIW, it is not in any of built-in colorschemes. |
|
yep I know. in that case what would be a good naming convention? Something that would also apply for PreInsert? |
Should we have a prefix for the group of 2 (as of now) highlight groups?
|
…tchIns
Problem: completion: preinserted text highlighed using ComplMatchIns
Solution: Use highlighting group PreInsert and update the documentation
(Girish Palya).
When "preinsert" is included in 'completeopt', only the PreInsert
highlight group should be applied, whether autocompletion is active or not.
Previously, ComplMatchIns was used when autocompletion was not enabled.
Related to #18213.
closes: #18254
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This comment was marked as off-topic.
This comment was marked as off-topic.
…plMatchIns
Problem: completion: preinserted text highlighed using ComplMatchIns
Solution: Use highlighting group PreInsert and update the documentation
(Girish Palya).
When "preinsert" is included in 'completeopt', only the PreInsert
highlight group should be applied, whether autocompletion is active or not.
Previously, ComplMatchIns was used when autocompletion was not enabled.
Related to vim/vim#18213.
closes: vim/vim#18254
vim/vim@2525c56
Co-authored-by: Girish Palya <girishji@gmail.com>
…plMatchIns
Problem: completion: preinserted text highlighed using ComplMatchIns
Solution: Use highlighting group PreInsert and update the documentation
(Girish Palya).
When "preinsert" is included in 'completeopt', only the PreInsert
highlight group should be applied, whether autocompletion is active or not.
Previously, ComplMatchIns was used when autocompletion was not enabled.
Related to vim/vim#18213.
closes: vim/vim#18254
vim/vim@2525c56
Co-authored-by: Girish Palya <girishji@gmail.com>
…complete' (neovim#35692) Problem: complete: preinsert does not work well with preinsert Solution: Make "preinsert" completeopt value work with autocompletion (Girish Palya) This change extends Insert mode autocompletion so that 'preinsert' also works when 'autocomplete' is enabled. Try: `:set ac cot=preinsert` See `:help 'cot'` for more details. closes: vim/vim#18213 vim/vim@fa6fd41 Co-authored-by: Girish Palya <girishji@gmail.com>
…plMatchIns
Problem: completion: preinserted text highlighed using ComplMatchIns
Solution: Use highlighting group PreInsert and update the documentation
(Girish Palya).
When "preinsert" is included in 'completeopt', only the PreInsert
highlight group should be applied, whether autocompletion is active or not.
Previously, ComplMatchIns was used when autocompletion was not enabled.
Related to vim/vim#18213.
closes: vim/vim#18254
vim/vim@2525c56
Co-authored-by: Girish Palya <girishji@gmail.com>


This change extends Insert mode autocompletion so that "preinsert" behavior of 'completeopt' also
works when 'autocomplete' is enabled. The behavior is slightly different.
Try:
:set autocomplete completeopt=preinsert. It's quite useful.See
:help 'cot'for more details.Also, added example setup for
autocomplete. See:h ins-autocompletion-example.