+44
-0
lines changedFilter options
+44
-0
lines changed Original file line number Diff line number Diff line change
@@ -114,6 +114,12 @@ static void tinput_done_event(void **argv)
114
114
static void tinput_wait_enqueue(void **argv)
115
115
{
116
116
TermInput *input = argv[0];
117
+
if (rbuffer_size(input->key_buffer) == 0 && input->paste == 3) {
118
+
const String keys = { .data = "", .size = 0 };
119
+
String copy = copy_string(keys);
120
+
multiqueue_put(main_loop.events, tinput_paste_event, 3,
121
+
copy.data, copy.size, (intptr_t)input->paste);
122
+
}
117
123
RBUFFER_UNTIL_EMPTY(input->key_buffer, buf, len) {
118
124
const String keys = { .data = buf, .size = len };
119
125
if (input->paste) {
Original file line number Diff line number Diff line change
@@ -765,6 +765,44 @@ describe('TUI', function()
765
765
]])
766
766
end)
767
767
768
+
it('paste: streamed paste with isolated "stop paste" code', function()
769
+
child_session:request('nvim_exec_lua', [[
770
+
_G.paste_phases = {}
771
+
vim.paste = (function(overridden)
772
+
return function(lines, phase)
773
+
table.insert(_G.paste_phases, phase)
774
+
overridden(lines, phase)
775
+
end
776
+
end)(vim.paste)
777
+
]], {})
778
+
feed_data('i')
779
+
feed_data('\027[200~pasted') -- phase 1
780
+
screen:expect([[
781
+
pasted{1: } |
782
+
{4:~ }|
783
+
{4:~ }|
784
+
{4:~ }|
785
+
{5:[No Name] [+] }|
786
+
{3:-- INSERT --} |
787
+
{3:-- TERMINAL --} |
788
+
]])
789
+
feed_data(' from terminal') -- phase 2
790
+
screen:expect([[
791
+
pasted from terminal{1: } |
792
+
{4:~ }|
793
+
{4:~ }|
794
+
{4:~ }|
795
+
{5:[No Name] [+] }|
796
+
{3:-- INSERT --} |
797
+
{3:-- TERMINAL --} |
798
+
]])
799
+
-- Send isolated "stop paste" sequence.
800
+
feed_data('\027[201~') -- phase 3
801
+
screen:expect_unchanged()
802
+
local _, rv = child_session:request('nvim_exec_lua', [[return _G.paste_phases]], {})
803
+
eq({1, 2, 3}, rv)
804
+
end)
805
+
768
806
it('allows termguicolors to be set at runtime', function()
769
807
screen:set_option('rgb', true)
770
808
screen:set_default_attr_ids({
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4