ml_get errors displayed when deleting text from a insert complete function

12 views
Skip to first unread message

Yegappan Lakshmanan

unread,
Apr 20, 2020, 9:26:07 PM4/20/20
to vim_dev
Hi,

I am getting E315: ml_get internal errors when running the following function:

func Test()
  func CompleteFunc(findstart, base)
    if a:findstart == 1
      return col('.') - 1
    endif
    normal dd
    return ['a', 'b']
  endfunc
  new
  set completefunc=CompleteFunc
  call setline(1, ['', 'abcd', ''])
  2d
  exe "normal 2G$a\<C-X>\<C-U>"
endfunc
call Test()

- Yegappan

Bram Moolenaar

unread,
Apr 21, 2020, 4:02:03 PM4/21/20
to vim...@googlegroups.com, Yegappan Lakshmanan
Best would be to forbid changing the text while evaluating
'completefunc'. I vaguely remember that this would break some plugin,
but I can't remember why. If that does happen, we could forbid deleting
and inserting text lines, there should be no reason for that during
completion. But that would require introducing a new mechanism.

--
It doesn't really matter what you are able to do if you don't do it.
(Bram Moolenaar)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages