debug.vim 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. " MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
  2. " vim: et ts=2 sts=2 sw=2
  3. scriptencoding utf-8
  4. function! airline#debug#profile1()
  5. profile start airline-profile-switch.log
  6. profile func *
  7. profile file *
  8. split
  9. for i in range(1, 1000)
  10. wincmd w
  11. redrawstatus
  12. endfor
  13. profile pause
  14. noautocmd qall!
  15. endfunction
  16. function! airline#debug#profile2()
  17. profile start airline-profile-cursor.log
  18. profile func *
  19. profile file *
  20. edit blank
  21. call setline(1, 'all your base are belong to us')
  22. call setline(2, 'all your base are belong to us')
  23. let positions = [[1,2], [2,2], [1,2], [1,1]]
  24. for i in range(1, 1000)
  25. for pos in positions
  26. call cursor(pos[0], pos[1])
  27. redrawstatus
  28. endfor
  29. endfor
  30. profile pause
  31. noautocmd qall!
  32. endfunction
  33. function! airline#debug#profile3()
  34. profile start airline-profile-mode.log
  35. profile func *
  36. profile file *
  37. for i in range(1000)
  38. startinsert
  39. redrawstatus
  40. stopinsert
  41. redrawstatus
  42. endfor
  43. profile pause
  44. noautocmd qall!
  45. endfunction