Skip to content

Conversation

@girishji
Copy link
Contributor

@girishji girishji commented Oct 14, 2025

Useful for defining custom key mappings.

complete_info():

+                  preinserted_text
+                               The actual text that is pre-inserted.

M  src/insexpand.c
M  src/testdir/test_ins_complete.vim
M  runtime/doc/builtin.txt
@zeertzjq
Copy link
Member

Doesn't this make the preinserted() function (which was added less than 3 weeks ago) redundant?

@girishji
Copy link
Contributor Author

We have pumvisible() and pum_visible (in complete_info()). It's ok to have redundant ways of getting the same info.

M  src/testdir/test_popup.vim
M  src/testdir/test_vim9_builtin.vim
M  runtime/doc/builtin.txt
M  src/insexpand.c
M  src/testdir/test_ins_complete.vim
M  src/testdir/test_popup.vim
M  src/testdir/test_vim9_builtin.vim
@girishji
Copy link
Contributor Author

girishji commented Oct 14, 2025

Removed preinserted field. Users can check for empty string in preinserted_text or use preinserted()

@chrisbra
Copy link
Member

thanks

@chrisbra
Copy link
Member

The documentation was changed for cmdcomplete_info(), but it should go to complete_info(). I'll change it

@chrisbra chrisbra closed this in ef5bf58 Oct 26, 2025
@girishji
Copy link
Contributor Author

Sorry about the documentation mixup. thanks.

@girishji girishji deleted the preins2 branch October 26, 2025 19:33
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Oct 27, 2025
Problem:  pre-inserted text not exposed in complete_info()
Solution: Add the pre-inserted text to the complete_info() Vim script
          function (Girish Palya)

closes: vim/vim#18571

Feat: expose preinserted text in complete_info()

vim/vim@ef5bf58

Co-authored-by: Girish Palya <girishji@gmail.com>
zeertzjq added a commit to neovim/neovim that referenced this pull request Oct 27, 2025
…36342)

Problem:  pre-inserted text not exposed in complete_info()
Solution: Add the pre-inserted text to the complete_info() Vim script
          function (Girish Palya)

closes: vim/vim#18571

Feat: expose preinserted text in complete_info()

vim/vim@ef5bf58

Co-authored-by: Girish Palya <girishji@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants