From ae9a3d3b9984ef8bf9cec1a8738f29821951c5a5 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 10 Nov 2016 18:28:33 +0100 Subject: 'inccommand': Simplify cursor placement logic. Remove the inner for-loop; just use the column of the first in-line match. --- test/functional/ui/inccommand_spec.lua | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua index 4eefb29b17..7b6f82569a 100644 --- a/test/functional/ui/inccommand_spec.lua +++ b/test/functional/ui/inccommand_spec.lua @@ -808,16 +808,37 @@ describe(":substitute, inccommand=split", function() ]]) end) - it("'hlsearch' highlights the substitution, 'cursorline' does not", function() - execute("set hlsearch") - execute("set cursorline") -- Should NOT appear in the preview window. - feed(":%s/tw") + it("'hlsearch' is active, 'cursorline' is not", function() + execute("set hlsearch cursorline") + feed("gg") + + -- Assert that 'cursorline' is active. screen:expect([[ + {16:^Inc substitution on }| + two lines | Inc substitution on | - {9:tw}{16:o lines }| + two lines | | {15:~ }| {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + :set hlsearch cursorline | + ]]) + + feed(":%s/tw") + -- 'cursorline' is NOT active during preview. + screen:expect([[ + Inc substitution on | + {9:tw}o lines | + Inc substitution on | + {9:tw}o lines | + | {11:[No Name] [+] }| |2| {9:tw}o lines | |4| {9:tw}o lines | -- cgit