From fdd8dcae01beb66397226ad65e4f1bbd3d1dd55c Mon Sep 17 00:00:00 2001 From: Kovas Palunas Date: Tue, 18 Jun 2019 13:35:35 -0700 Subject: man.vim: Handle ANSI escape sequences with ":" #10267 closes #10267 --- test/functional/plugin/man_spec.lua | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'test') diff --git a/test/functional/plugin/man_spec.lua b/test/functional/plugin/man_spec.lua index e5da7932a5..b25bd7e85a 100644 --- a/test/functional/plugin/man_spec.lua +++ b/test/functional/plugin/man_spec.lua @@ -1,23 +1,19 @@ local helpers = require('test.functional.helpers')(after_each) local plugin_helpers = require('test.functional.plugin.helpers') - local Screen = require('test.functional.ui.screen') - local command, eval, rawfeed = helpers.command, helpers.eval, helpers.rawfeed - -before_each(function() - plugin_helpers.reset() - helpers.clear() - command('syntax on') - command('set filetype=man') -end) +local clear = helpers.clear describe(':Man', function() describe('man.lua: highlight_line()', function() local screen before_each(function() - command('syntax off') -- Ignore syntax groups + plugin_helpers.reset() + clear() + command('syntax on') + command('set filetype=man') + command('syntax off') -- Ignore syntax groups screen = Screen.new(52, 5) screen:set_default_attr_ids({ b = { bold = true }, @@ -131,5 +127,22 @@ describe(':Man', function() | ]]) end) + + it('handles : characters in input', function() + rawfeed([[ + i[40m 0 [41m 1 [42m 2 [43m 3 + [44m 4 [45m 5 [46m 6 [47m 7 [100m 8 [101m 9 + [102m 10 [103m 11 [104m 12 [105m 13 [106m 14 [107m 15 + [48:5:16m 16 ]]) + eval('man#init_pager()') + + screen:expect([[ + ^ 0 1 2 3 | + 4 5 6 7 8 9 | + 10 11 12 13 14 15 | + 16 | + | + ]]) + end) end) end) -- cgit