move_spec.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. local n = require('test.functional.testnvim')()
  2. local Screen = require('test.functional.ui.screen')
  3. local clear = n.clear
  4. local feed = n.feed
  5. local fn = n.fn
  6. before_each(clear)
  7. describe(':move', function()
  8. -- oldtest: Test_move_undo()
  9. it('redraws correctly when undone', function()
  10. local screen = Screen.new(60, 10)
  11. fn.setline(1, { 'First', 'Second', 'Third', 'Fourth' })
  12. feed('gg:move +1<CR>')
  13. screen:expect([[
  14. Second |
  15. ^First |
  16. Third |
  17. Fourth |
  18. {1:~ }|*5
  19. :move +1 |
  20. ]])
  21. -- here the display would show the last few lines scrolled down
  22. feed('u')
  23. feed(':<Esc>')
  24. screen:expect([[
  25. ^First |
  26. Second |
  27. Third |
  28. Fourth |
  29. {1:~ }|*5
  30. |
  31. ]])
  32. end)
  33. end)