From 47630743fc67c56f724cd99660d86d8c4ea7782f Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 30 Mar 2022 21:11:53 +0800 Subject: vim-patch:8.2.1844: using "q" at the more prompt doesn't stop a long message Problem: Using "q" at the more prompt doesn't stop a long message. Solution: Check for "got_int". (closes vim/vim#7122) https://github.com/vim/vim/commit/3d30af8783bf43fbfece641ec81ad8d2f01b3735 Cherry-pick file name change from patch 8.2.2112. --- test/functional/legacy/messages_spec.lua | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 test/functional/legacy/messages_spec.lua (limited to 'test') diff --git a/test/functional/legacy/messages_spec.lua b/test/functional/legacy/messages_spec.lua new file mode 100644 index 0000000000..330d70e7d4 --- /dev/null +++ b/test/functional/legacy/messages_spec.lua @@ -0,0 +1,38 @@ +local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') +local clear = helpers.clear +local command = helpers.command +local feed = helpers.feed + +before_each(clear) + +describe('messages', function() + it('more prompt with control characters can be quit vim-patch:8.2.1844', function() + local screen = Screen.new(40, 6) + screen:set_default_attr_ids({ + [1] = {foreground = Screen.colors.Blue}, -- SpecialKey + [2] = {bold = true, foreground = Screen.colors.SeaGreen}, -- MoreMsg + [3] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + }) + screen:attach() + command('set more') + feed([[:echom range(9999)->join("\x01")]]) + screen:expect([[ + 0{1:^A}1{1:^A}2{1:^A}3{1:^A}4{1:^A}5{1:^A}6{1:^A}7{1:^A}8{1:^A}9{1:^A}10{1:^A}11{1:^A}12| + {1:^A}13{1:^A}14{1:^A}15{1:^A}16{1:^A}17{1:^A}18{1:^A}19{1:^A}20{1:^A}21{1:^A}22| + {1:^A}23{1:^A}24{1:^A}25{1:^A}26{1:^A}27{1:^A}28{1:^A}29{1:^A}30{1:^A}31{1:^A}32| + {1:^A}33{1:^A}34{1:^A}35{1:^A}36{1:^A}37{1:^A}38{1:^A}39{1:^A}40{1:^A}41{1:^A}42| + {1:^A}43{1:^A}44{1:^A}45{1:^A}46{1:^A}47{1:^A}48{1:^A}49{1:^A}50{1:^A}51{1:^A}52| + {2:-- More --}^ | + ]]) + feed('q') + screen:expect([[ + ^ | + {3:~ }| + {3:~ }| + {3:~ }| + {3:~ }| + | + ]]) + end) +end) -- cgit