Hi,

Is this a bug with complete, or am I doing something wrong?

ino <f5> <c-r>=CompleteItems()<cr>

fun! CompleteItems()
        let word = matchstr(getline('.'), '\w\+\%'.col('.').'c')
        let matches = []
        for item in ['foo', 'bar', 'baz', 'foobar']
                if word == '' || item =~ '^'.word
                        let matches += [item]
                endif
        endfor
        call complete(col('.') - len(word), matches)
        return ''
endf

After loading this into Vim via ~/.vimrc or elsewhere, open a new
buffer and type:
foobarbaz
foo<f5><bs>
Whole line completion mode is entered, which I do not want. How do I fix this?

Thanks!

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui