help_spec.lua 796 B

1234567891011121314151617181920212223242526272829
  1. local helpers = require('test.functional.helpers')(after_each)
  2. local clear = helpers.clear
  3. local command = helpers.command
  4. local eq = helpers.eq
  5. local funcs = helpers.funcs
  6. describe(':help', function()
  7. before_each(clear)
  8. it('window closed makes cursor return to a valid win/buf #9773', function()
  9. helpers.add_builddir_to_rtp()
  10. command('help help')
  11. eq(1001, funcs.win_getid())
  12. command('quit')
  13. eq(1000, funcs.win_getid())
  14. command('autocmd WinNew * wincmd p')
  15. command('help help')
  16. -- Window 1002 is opened, but the autocmd switches back to 1000 and
  17. -- creates the help buffer there instead.
  18. eq(1000, funcs.win_getid())
  19. command('quit')
  20. -- Before #9773, Nvim would crash on quitting the help window.
  21. eq(1002, funcs.win_getid())
  22. end)
  23. end)