yegappan / lsp

Language Server Protocol (LSP) plugin for Vim9
MIT License
485 stars 58 forks source link

Completion menu is in wrong position #199

Open techntools opened 1 year ago

techntools commented 1 year ago

With vim --clean /tmp/hera.vim -S /tmp/hera.vim

Screenshot from 2023-04-02 12-13-25

I used following script:

vim9script
set nowrap

prop_type_add('test', {highlight: 'Error'})
prop_add(4, 0, {
    text_align: 'above',
    text: 'The quick brown fox jumps over the lazy dog',
    type: 'test'
})

func ForOmniFunc(findstart, base)
    if a:findstart
        return charcol('.') - 1
    else
        return ['a', 'b', 'c']
endfunc
set omnifunc=ForOmniFunc

When I am using omnifunc from the plugin and set nowrap:

image

But selection from menu gets inserted correctly.

With set wrap, it is in right position.

image

Solved issue at Vim repo

yegappan commented 1 year ago

Fixed by Vim patch 9.0.1432 (https://github.com/vim/vim/commit/6ac2e4392a9d8b89c8824bf94a9da24a6f07c74f).

techntools commented 1 year ago

I have Vim compiled with that patch. Issue is still there.

techntools commented 1 year ago

omnifunc with that patch works fine without the plugin. But with the plugin's omnifunc, issue is there.