denops.vim: Some problems in Vim8/neovim

  1. The cursor is flickered when use ddc.vim in Vim8. It seems when the popup window is displayed, the cursor will be hidden. I don’t know why.

  2. The mode string in the echoarea is redrawn when the popup window is displayed in both Vim8 and neovim.

Minimal vimrc

if &compatible
  set nocompatible
endif

set runtimepath^=~/work/ddc.vim
set runtimepath^=~/work/ddc-around
set runtimepath^=~/work/ddc-matcher_head
set runtimepath^=~/work/ddc-sorter_rank
set runtimepath+=~/src/denops.vim

filetype plugin indent on
syntax enable

call ddc#custom#patch_global('sources', ['around'])
"call ddc#custom#patch_global('completionMode', 'inline')
"call ddc#custom#patch_global('completionMode', 'manual')
call ddc#custom#patch_global('sourceOptions', {
      \ '_': {
      \   'ignoreCase': v:true,
      \   'matchers': ['matcher_head'],
      \   'sorters': ['sorter_rank'],
      \ },
      \ 'around': {'mark': 'A'},
      \ })
call ddc#enable()

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (21 by maintainers)

Most upvoted comments

📝

This is the debounced version I suggested and solved.

let s:root_dir = fnamemodify(expand('<sfile>'), ':h:h')
let s:complete_timer = v:null

function! completion#enable() abort
  autocmd User DenopsReady call denops#plugin#register('completion',
        \ denops#util#join_path(s:root_dir, 'denops', 'completion', 'app.ts'))
endfunction

function! completion#complete() abort
  " デバウンス
  silent! call timer_stop(s:complete_timer)
  let s:complete_timer = timer_start(10, { -> completion#_complete() })
endfunction

function! completion#_complete() abort
  " 入力モードじゃない可能性もあるので...この辺の条件は知らないです
  if mode() !=# 'i'
    return
  endif
  set completeopt-=longest
  set completeopt+=menuone
  set completeopt-=menu
  set completeopt+=noselect
  if getline('.') =~ '\w\+$' && getline('.') !~# 'date$'
    call complete(1, map(['foo', 'bar', 'baz'], { _, v -> {'word': v, 'equal': v:true}}))
  else
    call complete(1, [])
  endif
endfunction

Really? OK. I will create the minimal example. Please wait.