021_control_wi_spec.lua 993 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. -- Tests for [ CTRL-I with a count and CTRL-W CTRL-I with a count
  2. local n = require('test.functional.testnvim')()
  3. local clear, feed, insert = n.clear, n.feed, n.insert
  4. local feed_command, expect = n.feed_command, n.expect
  5. describe('CTRL-W CTRL-I', function()
  6. setup(clear)
  7. it('is working', function()
  8. insert([[
  9. #include test21.in
  10. /* test text test tex start here
  11. some text
  12. test text
  13. start OK if found this line
  14. start found wrong line
  15. test text]])
  16. -- Search for the second occurrence of start and append to register
  17. feed_command('/start')
  18. feed('2[<C-i>')
  19. feed_command('yank A')
  20. -- Same as above but using different keystrokes.
  21. feed('?start<cr>')
  22. feed('2<C-w><Tab>')
  23. feed_command('yank A')
  24. -- Clean buffer and put register
  25. feed('ggdG"ap')
  26. feed_command('1d')
  27. -- The buffer should now contain:
  28. expect([[
  29. start OK if found this line
  30. start OK if found this line]])
  31. end)
  32. end)