How to debug `Error while processing function` in` vim` and `nvim`?

TL DR

How to find exactly where the error started vimor nvim(which file?) When I am interested in fixing the actual problem, and not just removing the bad plugin? Anything better than straceguesswork to find the source of the error?

Problem

I often add a plugin to my configurator vimor nvimget errors on hooks (opening a buffer, closing, writing):

"test.py" [New] 0L, 0C written
Error detected while processing function 343[12]..272:
line    8:
E716: Key not present in Dictionary: _exec
E116: Invalid arguments for function get(a:args, 'exec', a:1['_exec'])
E15: Invalid expression: get(a:args, 'exec', a:1['_exec'])

The problem is that I have no idea where they come from, only get the line number of an unknown file, and I know that this is not my configuration file vim/ nvim.

+4
source share
1

- , anonymous-functions ( , ).

:

let d = {}
function! d.whatever() abort
   throw "blah"
endfunction

, . , :

let d = {}
function s:whatever() abort
   throw "blah"
endfunction
let d.whatever = function('s:whatever') " a workaround is required for older versions of vim
" At least this way I'll get a `<SNR>42_whatever` in the exception throwpoint, and thus a scriptname.

. , , AFAIK, , , , :

  • 12 :function {343},
  • :function {272}, 8.

( :verbose, ) , , grep , .

+7

Source: https://habr.com/ru/post/1656746/


All Articles