aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/inccommand_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-11-06 20:48:12 +0100
committerJustin M. Keyes <justinkz@gmail.com>2016-11-08 21:22:24 +0100
commitf3e8ca3bf50c5945ecfd801bf6eb49ffea5bbe0e (patch)
tree3d1b17c40a853cafeca73a29c97261306c3c6811 /test/functional/ui/inccommand_spec.lua
parentff6ec703d5f5b57a3c18034ba8a110ffcbf41cea (diff)
downloadrneovim-f3e8ca3bf50c5945ecfd801bf6eb49ffea5bbe0e.tar.gz
rneovim-f3e8ca3bf50c5945ecfd801bf6eb49ffea5bbe0e.tar.bz2
rneovim-f3e8ca3bf50c5945ecfd801bf6eb49ffea5bbe0e.zip
'inccommand': preserve 'modified'
During the live preview, the buffer-local 'modified' flag should not be changed.
Diffstat (limited to 'test/functional/ui/inccommand_spec.lua')
-rw-r--r--test/functional/ui/inccommand_spec.lua26
1 files changed, 25 insertions, 1 deletions
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua
index 09c47f1c34..520fadc8e0 100644
--- a/test/functional/ui/inccommand_spec.lua
+++ b/test/functional/ui/inccommand_spec.lua
@@ -610,6 +610,30 @@ describe(":substitute, inccommand=split", function()
screen:detach()
end)
+ it("preserves 'modified' buffer flag", function()
+ execute("set nomodified")
+ feed(":%s/tw")
+ screen:expect([[
+ Inc substitution on |
+ two lines |
+ |
+ {15:~ }|
+ {15:~ }|
+ {11:[No Name] }|
+ |2| two lines |
+ |4| two lines |
+ |
+ {15:~ }|
+ {15:~ }|
+ {15:~ }|
+ {15:~ }|
+ {10:[Preview] }|
+ :%s/tw^ |
+ ]])
+ feed([[<C-\><C-N>]]) -- Cancel the :substitute command.
+ eq(0, eval("&modified"))
+ end)
+
it('shows split window when typing the pattern', function()
feed(":%s/tw")
screen:expect([[
@@ -957,7 +981,7 @@ describe(":substitute, 'inccommand' with a failing expression", function()
common_setup(screen, case, default_text)
end
- it('in the pattern does nothing for', function()
+ it('in the pattern does nothing', function()
for _, case in pairs(cases) do
refresh(case)
execute("set inccommand=" .. case)