Vim freezes when using auto-complete with dictionary as well as current file

放肆的年华 提交于 2020-01-05 02:28:48

问题


As was discussed here: Vim auto complete, both with current file and dictionary, I am trying to use both dictionary and current file in determining suggestions during auto-complete. In my vimrc I have the following two lines for auto-complete:

set complete=k,.
set dictionary+=pathfile-to-dictionary

But then when I press the auto-complete button I get error:

match in file the-dictionary-pathfile

And the system completely freezes with that error, i have to close the console and start over to get back to where I was. I've tried changing right settings to the dictionary file to 777 and I have tried putting dictionary file in home directory. Same error.

I have also noticed that the error pops up whenever I have a word both in dictionary and in current file and then try to auto-complete that very word. So it's probably some sort of collision between those two.

How can I use both dictionary and current file for word completion?


回答1:


I apologize: I asked for more information without trying to reproduce the problem. I think you are right about having the same words, or at least possible matches, in both places.

It does look like a bug. I find that <C-C> once or twice gets me out; I do not have to do anything drastic.

I find that the problem goes away if I reverse the order:

:set complete=.,k



回答2:


That's a bug, because Vim starts an endless loop. I made a patch and sent it to the vim-dev mailinglist.



来源:https://stackoverflow.com/questions/20968671/vim-freezes-when-using-auto-complete-with-dictionary-as-well-as-current-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!