aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/inccommand_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-11-10 18:28:33 +0100
committerJustin M. Keyes <justinkz@gmail.com>2016-11-11 05:45:06 +0100
commitae9a3d3b9984ef8bf9cec1a8738f29821951c5a5 (patch)
treec92d1ba07e7aeeb57adf8a3de491d410b6109bae /test/functional/ui/inccommand_spec.lua
parent795f2bb9b9b4de2d503e7d792bf6a3c47f92b8c5 (diff)
downloadrneovim-ae9a3d3b9984ef8bf9cec1a8738f29821951c5a5.tar.gz
rneovim-ae9a3d3b9984ef8bf9cec1a8738f29821951c5a5.tar.bz2
rneovim-ae9a3d3b9984ef8bf9cec1a8738f29821951c5a5.zip
'inccommand': Simplify cursor placement logic.
Remove the inner for-loop; just use the column of the first in-line match.
Diffstat (limited to 'test/functional/ui/inccommand_spec.lua')
-rw-r--r--test/functional/ui/inccommand_spec.lua31
1 files changed, 26 insertions, 5 deletions
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 |