diff options
author | G-flat <63449095+G-flat@users.noreply.github.com> | 2020-10-05 15:15:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-05 15:15:10 +0800 |
commit | b0769729c805ef33d47f383fd8b2ab18da5fa33c (patch) | |
tree | ee66236c5172c1b65b8a6415f756a78d6db29ac5 /test/functional/api/highlight_spec.lua | |
parent | 1d08dfab5b057b51aed98450afd3ad1c888870ff (diff) | |
parent | f7aeac7263c792e1503f9169abed20b6f5b9da99 (diff) | |
download | rneovim-b0769729c805ef33d47f383fd8b2ab18da5fa33c.tar.gz rneovim-b0769729c805ef33d47f383fd8b2ab18da5fa33c.tar.bz2 rneovim-b0769729c805ef33d47f383fd8b2ab18da5fa33c.zip |
Merge pull request #1 from neovim/master
rebase
Diffstat (limited to 'test/functional/api/highlight_spec.lua')
-rw-r--r-- | test/functional/api/highlight_spec.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua index a9d4c72d31..daf20c006c 100644 --- a/test/functional/api/highlight_spec.lua +++ b/test/functional/api/highlight_spec.lua @@ -7,6 +7,7 @@ local meths = helpers.meths local funcs = helpers.funcs local pcall_err = helpers.pcall_err local ok = helpers.ok +local assert_alive = helpers.assert_alive describe('API: highlight',function() local expected_rgb = { @@ -145,4 +146,15 @@ describe('API: highlight',function() eq({foreground=tonumber("0x888888"), background=tonumber("0x888888")}, meths.get_hl_by_name("Shrubbery", true)) end) + + it("nvim_buf_add_highlight to other buffer doesn't crash if undo is disabled #12873", function() + command('vsplit file') + local err, _ = pcall(meths.buf_set_option, 1, 'undofile', false) + eq(true, err) + err, _ = pcall(meths.buf_set_option, 1, 'undolevels', -1) + eq(true, err) + err, _ = pcall(meths.buf_add_highlight, 1, -1, 'Question', 0, 0, -1) + eq(true, err) + assert_alive() + end) end) |