2024-04-20 08:44:13 -07:00
|
|
|
local t = require('test.testutil')
|
|
|
|
local n = require('test.functional.testnvim')()
|
|
|
|
|
|
|
|
local clear = n.clear
|
|
|
|
local command = n.command
|
2024-04-08 02:03:20 -07:00
|
|
|
local eq = t.eq
|
|
|
|
local pcall_err = t.pcall_err
|
2022-07-19 17:16:02 -07:00
|
|
|
|
|
|
|
describe('gf', function()
|
|
|
|
before_each(clear)
|
|
|
|
|
|
|
|
it('is not allowed when buffer is locked', function()
|
|
|
|
command('au OptionSet diff norm! gf')
|
|
|
|
command([[call setline(1, ['Xfile1', 'line2', 'line3', 'line4'])]])
|
2023-01-15 15:38:50 -07:00
|
|
|
eq(
|
|
|
|
'OptionSet Autocommands for "diff": Vim(normal):E788: Not allowed to edit another buffer now',
|
|
|
|
pcall_err(command, 'diffthis')
|
2024-01-02 18:09:18 -07:00
|
|
|
)
|
2022-07-19 17:16:02 -07:00
|
|
|
end)
|
|
|
|
end)
|