fork download
  1. function! s:SCaller(...)
  2. try
  3. throw 'abc'
  4. catch /^abc$/
  5. if a:0
  6. let prefunc = a:1
  7. " echo v:throwpoint
  8. return matchstr(v:throwpoint, '^.*\zs<SNR>\d\+_.*\ze\.\.'.prefunc.'.*'.'')
  9. else
  10. return matchstr(v:throwpoint, '^function \zs.\{-}\ze\.\.')
  11. endif
  12. endtry
  13. endfunction
  14.  
  15.  
  16. function! g:call_funcname()
  17. return s:SCaller("g:call_funcname")
  18. endfunction
  19.  
  20. function! g:SID_function_prefix()
  21. return matchstr(s:SCaller("g:SID"), '^\zs<SNR>\d\+_\ze.*$')
  22. endfunction
  23.  
  24. function! g:SID()
  25. return matchstr(s:SCaller("g:SID"), '^<SNR>\zs\d\+\ze.*$')
  26. endfunction
  27.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty