robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

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