diff options
author | zeertzjq <zeertzjq@outlook.com> | 2021-12-10 18:09:55 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2021-12-10 18:09:55 +0800 |
commit | 40ed2b51cb02cf1d50c67aaf4638da9ca134d59f (patch) | |
tree | 51b8bbdb04dbbf043b6ce4fd095ea97587a1697d /test/functional | |
parent | 26eb6051528186270b924c7c806a3f434c233530 (diff) | |
download | rneovim-40ed2b51cb02cf1d50c67aaf4638da9ca134d59f.tar.gz rneovim-40ed2b51cb02cf1d50c67aaf4638da9ca134d59f.tar.bz2 rneovim-40ed2b51cb02cf1d50c67aaf4638da9ca134d59f.zip |
fix(tui): end streamed paste correctly when key buffer is empty
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 6b9586b4de..02a140b88d 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -765,6 +765,44 @@ describe('TUI', function() ]]) end) + it('paste: streamed paste with isolated "stop paste" code', function() + child_session:request('nvim_exec_lua', [[ + _G.paste_phases = {} + vim.paste = (function(overridden) + return function(lines, phase) + table.insert(_G.paste_phases, phase) + overridden(lines, phase) + end + end)(vim.paste) + ]], {}) + feed_data('i') + feed_data('\027[200~pasted') -- phase 1 + screen:expect([[ + pasted{1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] [+] }| + {3:-- INSERT --} | + {3:-- TERMINAL --} | + ]]) + feed_data(' from terminal') -- phase 2 + screen:expect([[ + pasted from terminal{1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] [+] }| + {3:-- INSERT --} | + {3:-- TERMINAL --} | + ]]) + -- Send isolated "stop paste" sequence. + feed_data('\027[201~') -- phase 3 + screen:expect_unchanged() + local _, rv = child_session:request('nvim_exec_lua', [[return _G.paste_phases]], {}) + eq({1, 2, 3}, rv) + end) + it('allows termguicolors to be set at runtime', function() screen:set_option('rgb', true) screen:set_default_attr_ids({ |