aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/031_close_commands_spec.lua
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-05-10 22:50:31 -0400
committerJames McCoy <jamessan@jamessan.com>2016-05-14 17:16:18 -0400
commit8c399d6b37f967d0ec9991d873666036de196a0a (patch)
tree25c816240e4bee86b6ee96ee0585c601ef9dcc4c /test/functional/legacy/031_close_commands_spec.lua
parent529e2ab17828943cf5004534429eab7a0b08cf91 (diff)
downloadrneovim-8c399d6b37f967d0ec9991d873666036de196a0a.tar.gz
rneovim-8c399d6b37f967d0ec9991d873666036de196a0a.tar.bz2
rneovim-8c399d6b37f967d0ec9991d873666036de196a0a.zip
vim-patch:7.4.1037
Problem: Using "q!" when there is a modified hidden buffer does not unload the current buffer, resulting in the need to abandon it again. Solution: When using "q!" unload the current buffer when needed. (Yasuhiro Matsumoto, Hirohito Higashi) https://github.com/vim/vim/commit/027387f70c671f62e3e08e0bdd09ec05b0232735
Diffstat (limited to 'test/functional/legacy/031_close_commands_spec.lua')
-rw-r--r--test/functional/legacy/031_close_commands_spec.lua24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/functional/legacy/031_close_commands_spec.lua b/test/functional/legacy/031_close_commands_spec.lua
index 3597cba12a..b79b1903ba 100644
--- a/test/functional/legacy/031_close_commands_spec.lua
+++ b/test/functional/legacy/031_close_commands_spec.lua
@@ -10,7 +10,7 @@
-- :edit
local helpers = require('test.functional.helpers')
-local feed, insert = helpers.feed, helpers.insert
+local feed, insert, source = helpers.feed, helpers.insert, helpers.source
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
describe('Commands that close windows and/or buffers', function()
@@ -84,6 +84,28 @@ describe('Commands that close windows and/or buffers', function()
feed('GA 4<Esc>:all!<CR>')
execute('1wincmd w')
expect('testtext 2 2 2')
+
+ -- Test ":q!" and hidden buffer.
+ execute('bw! Xtest1 Xtest2 Xtest3 Xtest4')
+ execute('sp Xtest1')
+ execute('wincmd w')
+ execute('bw!')
+ execute('set modified')
+ execute('bot sp Xtest2')
+ execute('set modified')
+ execute('bot sp Xtest3')
+ execute('set modified')
+ execute('wincmd t')
+ execute('hide')
+ execute('q!')
+ expect('testtext 3')
+ execute('q!')
+ feed('<CR>')
+ expect('testtext 1')
+ source([[
+ q!
+ " Now nvim should have exited
+ throw "Oh, Not finished yet."]])
end)
teardown(function()