diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-07-05 17:04:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-05 17:04:17 +0800 |
commit | 8a788e2daa5c62201f2bb278522eddd42f315d41 (patch) | |
tree | e92a4873cffa28ae5f62683191c93ac08538815f /test/functional/terminal/buffer_spec.lua | |
parent | df297e3c2bd743616371db73467a3f08d2b96d9b (diff) | |
parent | aa4e47f704c53ab1d825260d2bf34e2872e3ca89 (diff) | |
download | rneovim-8a788e2daa5c62201f2bb278522eddd42f315d41.tar.gz rneovim-8a788e2daa5c62201f2bb278522eddd42f315d41.tar.bz2 rneovim-8a788e2daa5c62201f2bb278522eddd42f315d41.zip |
Merge pull request #23228 from seandewar/cmdwin-jail
fix(api): use `text_locked()` to check for textlock
Diffstat (limited to 'test/functional/terminal/buffer_spec.lua')
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 4ce354b9a9..bd898ba99e 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -498,3 +498,17 @@ if is_os('win') then end) end) end + +describe('termopen()', function() + before_each(clear) + + it('disallowed when textlocked and in cmdwin buffer', function() + command("autocmd TextYankPost <buffer> ++once call termopen('foo')") + matches("Vim%(call%):E565: Not allowed to change text or change window$", + pcall_err(command, "normal! yy")) + + feed("q:") + eq("Vim:E11: Invalid in command-line window; <CR> executes, CTRL-C quits", + pcall_err(funcs.termopen, "bar")) + end) +end) |