diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-08-28 13:05:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-28 13:05:18 +0200 |
commit | 1ad13e07d2d9a01fbadd59a84af601b2ab0d8c73 (patch) | |
tree | b1a54630aa597beb929aa7db697a4f219a65bf23 /test/functional/api/buffer_spec.lua | |
parent | 3a876bd41b235065663c38b0d9f3bdc8868eebc4 (diff) | |
parent | 132bbd1cbd490a65bc186c4a9f449c6d2f0a7666 (diff) | |
download | rneovim-1ad13e07d2d9a01fbadd59a84af601b2ab0d8c73.tar.gz rneovim-1ad13e07d2d9a01fbadd59a84af601b2ab0d8c73.tar.bz2 rneovim-1ad13e07d2d9a01fbadd59a84af601b2ab0d8c73.zip |
Merge pull request #24913 from bfredl/lastline
fix(api): handle clearing out last line of non-current buffer
Diffstat (limited to 'test/functional/api/buffer_spec.lua')
-rw-r--r-- | test/functional/api/buffer_spec.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/api/buffer_spec.lua b/test/functional/api/buffer_spec.lua index 0afe619b03..73a8749682 100644 --- a/test/functional/api/buffer_spec.lua +++ b/test/functional/api/buffer_spec.lua @@ -279,6 +279,18 @@ describe('api/buf', function() ]]} end) end) + + it('handles clearing out non-current buffer #24911', function() + local buf = meths.get_current_buf() + meths.buf_set_lines(buf, 0, -1, true, {"aaa", "bbb", "ccc"}) + command("new") + + meths.buf_set_lines(0, 0, -1, true, {"xxx", "yyy", "zzz"}) + + meths.buf_set_lines(buf, 0, -1, true, {}) + eq({"xxx", "yyy", "zzz"}, meths.buf_get_lines(0, 0, -1, true)) + eq({''}, meths.buf_get_lines(buf, 0, -1, true)) + end) end) describe('deprecated: {get,set,del}_line', function() |