mode_normal_spec.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. -- Normal mode tests.
  2. local t = require('test.testutil')
  3. local n = require('test.functional.testnvim')()
  4. local Screen = require('test.functional.ui.screen')
  5. local clear = n.clear
  6. local feed = n.feed
  7. local fn = n.fn
  8. local command = n.command
  9. local eq = t.eq
  10. local api = n.api
  11. describe('Normal mode', function()
  12. before_each(clear)
  13. it('setting &winhighlight or &winblend does not change curswant #27470', function()
  14. fn.setline(1, { 'long long lone line', 'short line' })
  15. feed('ggfi')
  16. local pos = fn.getcurpos()
  17. feed('j')
  18. command('setlocal winblend=10 winhighlight=Visual:Search')
  19. feed('k')
  20. eq(pos, fn.getcurpos())
  21. end)
  22. it('&showcmd does not crash with :startinsert #28419', function()
  23. local screen = Screen.new(60, 17)
  24. fn.termopen(
  25. { n.nvim_prog, '--clean', '--cmd', 'startinsert' },
  26. { env = { VIMRUNTIME = os.getenv('VIMRUNTIME') } }
  27. )
  28. screen:expect({
  29. grid = [[
  30. ^ |
  31. ~ |*13
  32. [No Name] 0,1 All|
  33. -- INSERT -- |
  34. |
  35. ]],
  36. attr_ids = {},
  37. })
  38. end)
  39. it('replacing with ZWJ emoji sequences', function()
  40. local screen = Screen.new(30, 8)
  41. api.nvim_buf_set_lines(0, 0, -1, true, { 'abcdefg' })
  42. feed('05r🧑‍🌾') -- ZWJ
  43. screen:expect([[
  44. 🧑‍🌾🧑‍🌾🧑‍🌾🧑‍🌾^🧑‍🌾fg |
  45. {1:~ }|*6
  46. |
  47. ]])
  48. feed('2r🏳️‍⚧️') -- ZWJ and variant selectors
  49. screen:expect([[
  50. 🧑‍🌾🧑‍🌾🧑‍🌾🧑‍🌾🏳️‍⚧️^🏳️‍⚧️g |
  51. {1:~ }|*6
  52. |
  53. ]])
  54. end)
  55. end)