gf_spec.lua 561 B

123456789101112131415161718192021
  1. local t = require('test.testutil')
  2. local n = require('test.functional.testnvim')()
  3. local clear = n.clear
  4. local command = n.command
  5. local eq = t.eq
  6. local pcall_err = t.pcall_err
  7. describe('gf', function()
  8. before_each(clear)
  9. it('is not allowed when buffer is locked', function()
  10. command('au OptionSet diff norm! gf')
  11. command([[call setline(1, ['Xfile1', 'line2', 'line3', 'line4'])]])
  12. eq(
  13. 'OptionSet Autocommands for "diff": Vim(normal):E788: Not allowed to edit another buffer now',
  14. pcall_err(command, 'diffthis')
  15. )
  16. end)
  17. end)