Shougo / neocomplcache.vim

Ultimate auto-completion system for Vim.
http://www.vim.org/scripts/script.php?script_id=2620
1.72k stars 135 forks source link

suggestions are not displaying beyond the cursorline #507

Closed lokesh1729 closed 7 years ago

lokesh1729 commented 7 years ago

Problems summary

Thanks for the wonderful plugin, everything works very well. But, I am facing an issue that when typing after the cursorline, suggestions are not coming. I am attaching a video for the better understanding

Expected

suggestions should be shown

Environment Information

Provide a minimal .vimrc with less than 50 lines (Required!)

I have just copy pasted the settings that you gave in your readme.md


 "Disable AutoComplPop.
let g:acp_enableAtStartup = 0
 "Use neocomplcache.
let g:neocomplcache_enable_at_startup = 1
 "Use smartcase.
let g:neocomplcache_enable_smart_case = 1
"pumvisible() ? "\pumvisible" : "\ Set minimum syntax keyword length.
let g:neocomplcache_min_syntax_length = 3
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'

 "Enable heavy features.
 "Use camel case completion.
let g:neocomplcache_enable_camel_case_completion = 1
 "Use underbar completion.
let g:neocomplcache_enable_underbar_completion = 1

 "Define dictionary.

let g:neocomplcache_dictionary_filetype_lists = {
    \ 'default' : '',
    \ 'vimshell' : $HOME.'/.vimshell_hist',
    \ 'scheme' : $HOME.'/.gosh_completions'
        \ }

 "Define keyword.
if !exists('g:neocomplcache_keyword_patterns')
    let g:neocomplcache_keyword_patterns = {}
endif
let g:neocomplcache_keyword_patterns['default'] = '\h\w*'

" Plugin key-mappings.
inoremap <expr><C-g>     neocomplcache#undo_completion()
inoremap <expr><C-l>     neocomplcache#complete_common_string()

" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
  return neocomplcache#smart_close_popup() . "\<CR>"
  " For no inserting <CR> key.
  "return pumvisible() ? neocomplcache#close_popup() : "\<CR>"
endfunction
" <TAB>: completion.
inoremap <expr><TAB>  pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><C-y>  neocomplcache#close_popup()
inoremap <expr><C-e>  neocomplcache#cancel_popup()
" Close popup by <Space>.
"inoremap <expr><Space> pumvisible() ? neocomplcache#close_popup() : "\<Space>"

" For cursor moving in insert mode(Not recommended)
"inoremap <expr><Left>  neocomplcache#close_popup() . "\<Left>"
"inoremap <expr><Right> neocomplcache#close_popup() . "\<Right>"
"inoremap <expr><Up>    neocomplcache#close_popup() . "\<Up>"
"inoremap <expr><Down>  neocomplcache#close_popup() . "\<Down>"
" Or set this.
"let g:neocomplcache_enable_cursor_hold_i = 1
" Or set this.
"let g:neocomplcache_enable_insert_char_pre = 1

" AutoComplPop like behavior.
"let g:neocomplcache_enable_auto_select = 1

" Shell like behavior(not recommended).
"set completeopt+=longest
"let g:neocomplcache_enable_auto_select = 1
"let g:neocomplcache_disable_auto_complete = 1
"inoremap <expr><TAB>  pumvisible() ? "\<Down>" : "\<C-x>\<C-u>"

" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags

" Enable heavy omni completion.
if !exists('g:neocomplcache_force_omni_patterns')
  let g:neocomplcache_force_omni_patterns = {}
endif
let g:neocomplcache_force_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
let g:neocomplcache_force_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
let g:neocomplcache_force_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'

" For perlomni.vim setting.
" https://github.com/c9s/perlomni.vim
let g:neocomplcache_force_omni_patterns.perl = '\h\w*->\h\w*\|\h\w*::'

The reproduce ways from Vim starting (Required!)

  1. open any python file in vim
  2. start typing a line which is longer than cursorline
  3. suggestions are stopping beyond it

Screen shot (if possible)

uploading a gif ezgif com-video-to-gif

....

Upload the log messages by :redir and :message

wsdjeg commented 7 years ago

I think you should use neocomplete or deoplete.

lokesh1729 commented 7 years ago

ohh... why??? neocomplcache is good no

wsdjeg commented 7 years ago

Shougo is author of neocomplcache, neocomplete and deoplete, he create neocomplete is because neocomplcache is too slow. in neovim I use the latest version of deoplete. it is async completion engein.

lokesh1729 commented 7 years ago

ohh.... which one should I use?? neocomplete or deoplete

wsdjeg commented 7 years ago

If you are use ubuntu, I think you can install vim-gtk, it should support lua, then you can use neocomplete, BTW, if you are a vimmer like Shougo, I think you can try to use neovim, and deoplete is for neovim. I am using deoplete, 😄 , you can have a look at my SpaceVim.

lokesh1729 commented 7 years ago

Ok... I tried using YouCompleteMe, but that's very slow and erroneous for larger projects

wsdjeg commented 7 years ago

ycm???? it is too large, and hard to install, I prefer deoplete.

lokesh1729 commented 7 years ago

same problem with neocomplete too....

wsdjeg commented 7 years ago

I just test in depplete , it works well: 2017-02-01_1357x722

lokesh1729 commented 7 years ago

I have disabled some of the plugins that I suspect causing this issue like python-mode, syntastic and restarted the vim. Now, the cursor line is gone, but now, when I am typing over 80 characters, it's coming to the next line....

wsdjeg commented 7 years ago

please read :h tw, it should be vim's feature.

lokesh1729 commented 7 years ago

I read, in my vimrc, text width is set to 120.

lokesh1729 commented 7 years ago

@Shougo Hi, any fix for this????

Shougo commented 7 years ago

I have disabled some of the plugins that I suspect causing this issue like python-mode, syntastic and restarted the vim. Now, the cursor line is gone, but now, when I am typing over 80 characters, it's coming to the next line....

It is feature. You should check #338. I think formatoptions is set.

:verbose setlocal formatoptions?

lokeshatbigbasket commented 7 years ago

Hi,

This is the output from my vim for :verbose setlocal formatoptions? formatoptions=tcq Last set from ~/.vimrc a flag is not set... and also I have grepped for formatoptions in my entire vim bundle, here's what I found.... I'm pretty new to vim...

/home/lokesh1729/.vim/bundle/delimitMate/doc/delimitMate.txt:vim:tw=78:et:ts=8:sw=2:ft=help:norl:for atoptions+=tcroqn:autoindent: /home/lokesh1729/.vim/bundle/vim-markdown/indent/markdown.vim:setlocal formatoptions+=r /home/lokesh1729/.vim/bundle/vim-markdown/indent/markdown.vim:setlocal formatoptions-=c /home/lokesh1729/.vim/bundle/neocomplete.vim/autoload/neocomplete/handler.vim: \ || (&l:formatoptions =~# '[tca]' && &l:textwidth > 0 /home/lokesh1729/.vim/bundle/tlib_vim/CHANGES.TXT:- tlib#buffer#InsertText(): Respect tabs and (experimental) formatoptions+=or /home/lokesh1729/.vim/bundle/python-mode/doc/pymode.txt: setlocal formatoptions-=t /home/lokesh1729/.vim/bundle/python-mode/ftplugin/python/pymode.vim: setlocal formatoptions-=t

Shougo commented 7 years ago

You have set t option in the vimrc. So neocomplcache is disabled after colorcolumn. It conflicts with neocomplcache behavior. You should learn :help fo-table.