visual_mode_spec.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. -- Test visual line mode selection redraw after scrolling
  2. local helpers = require('test.functional.helpers')(after_each)
  3. local Screen = require('test.functional.ui.screen')
  4. local call = helpers.call
  5. local clear = helpers.clear
  6. local feed = helpers.feed
  7. local feed_command = helpers.feed_command
  8. local funcs = helpers.funcs
  9. local meths = helpers.meths
  10. local eq = helpers.eq
  11. describe('visual line mode', function()
  12. local screen
  13. it('redraws properly after scrolling with matchparen loaded and scrolloff=1', function()
  14. clear{args={'-u', 'NORC'}}
  15. screen = Screen.new(30, 7)
  16. screen:attach()
  17. screen:set_default_attr_ids({
  18. [1] = {bold = true},
  19. [2] = {background = Screen.colors.LightGrey},
  20. })
  21. eq(1, meths.get_var('loaded_matchparen'))
  22. feed_command('set scrolloff=1')
  23. funcs.setline(1, {'a', 'b', 'c', 'd', 'e', '', '{', '}', '{', 'f', 'g', '}'})
  24. call('cursor', 5, 1)
  25. feed('V<c-d><c-d>')
  26. screen:expect([[
  27. {2:{} |
  28. {2:}} |
  29. {2:{} |
  30. {2:f} |
  31. ^g |
  32. } |
  33. {1:-- VISUAL LINE --} |
  34. ]])
  35. end)
  36. end)