aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/gf_spec.lua
blob: 87abf22a4317f07c3761ae57570219b0bc2d10dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local t = require('test.testutil')
local n = require('test.functional.testnvim')()

local describe, it, before_each = t.describe, t.it, t.before_each
local clear = n.clear
local command = n.command
local eq = t.eq
local pcall_err = t.pcall_err

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'])]])
    eq(
      'OptionSet Autocommands for "diff": Vim(normal):E788: Not allowed to edit another buffer now',
      pcall_err(command, 'diffthis')
    )
  end)
end)