matchparen_spec.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. local helpers = require('test.functional.helpers')(after_each)
  2. local plugin_helpers = require('test.functional.plugin.helpers')
  3. local Screen = require('test.functional.ui.screen')
  4. local command = helpers.command
  5. local meths = helpers.meths
  6. local feed = helpers.feed
  7. local eq = helpers.eq
  8. local reset = plugin_helpers.reset
  9. describe('matchparen', function()
  10. local screen
  11. before_each(function()
  12. reset()
  13. screen = Screen.new(20,5)
  14. screen:attach()
  15. screen:set_default_attr_ids( {
  16. [0] = {bold=true, foreground=255},
  17. [1] = {bold=true},
  18. } )
  19. end)
  20. it('uses correct column after i_<Up>. Vim patch 7.4.1296', function()
  21. command('set noautoindent nosmartindent nocindent laststatus=0')
  22. eq(1, meths.get_var('loaded_matchparen'))
  23. feed('ivoid f_test()<cr>')
  24. feed('{<cr>')
  25. feed('}')
  26. -- critical part: up + cr should result in an empty line inbetween the
  27. -- brackets... if the bug is there, the empty line will be before the '{'
  28. feed('<up>')
  29. feed('<cr>')
  30. screen:expect([[
  31. void f_test() |
  32. { |
  33. ^ |
  34. } |
  35. {1:-- INSERT --} |
  36. ]])
  37. end)
  38. end)