From 5a9d3be54cce2f21d5f76a4bc5ebef08927b1988 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 17 Mar 2016 00:21:48 -0400 Subject: test: minor changes --- runtime/doc/options.txt | 4 +-- src/nvim/buffer.c | 6 ++--- test/functional/options/shortmess_spec.lua | 39 +++++++++++++++++++++++++++++ test/functional/ui/shortmess_spec.lua | 40 ------------------------------ 4 files changed, 44 insertions(+), 45 deletions(-) create mode 100644 test/functional/options/shortmess_spec.lua delete mode 100644 test/functional/ui/shortmess_spec.lua diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 29f4e671ed..dbc87a8676 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5538,8 +5538,8 @@ A jump table for the options with a short description can be found at |Q_op|. c don't give |ins-completion-menu| messages. For example, "-- XXX completion (YYY)", "match 1 of 2", "The only match", "Pattern not found", "Back at original", etc. - q use "recording" instead of "recording @a" - F don't give the file info when editing a file, like `:silent` + q use "recording" instead of "recording @a" + F don't give the file info when editing a file, like `:silent` was used for the command This gives you the opportunity to avoid that a change between buffers diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 4661a191a9..8d3769cb54 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -141,8 +141,7 @@ open_buffer ( /* mark cursor position as being invalid */ curwin->w_valid = 0; - if (curbuf->b_ffname != NULL - ) { + if (curbuf->b_ffname != NULL) { int old_msg_silent = msg_silent; if (shortmess(SHM_FILEINFO)) { msg_silent = 1; @@ -154,8 +153,9 @@ open_buffer ( msg_silent = old_msg_silent; // Help buffer is filtered. - if (curbuf->b_help) + if (curbuf->b_help) { fix_help_buffer(); + } } else if (read_stdin) { int save_bin = curbuf->b_p_bin; linenr_T line_count; diff --git a/test/functional/options/shortmess_spec.lua b/test/functional/options/shortmess_spec.lua new file mode 100644 index 0000000000..04a64d2943 --- /dev/null +++ b/test/functional/options/shortmess_spec.lua @@ -0,0 +1,39 @@ +local helpers = require('test.functional.helpers') +local Screen = require('test.functional.ui.screen') +local clear, feed, execute = helpers.clear, helpers.feed, helpers.execute + +describe("'shortmess'", function() + local screen + + before_each(function() + clear() + screen = Screen.new(25, 5) + screen:attach() + end) + + after_each(function() + screen:detach() + end) + + describe('"F" flag', function() + it('hides messages about the files read', function() + execute('e test') + screen:expect([[ + ^ | + ~ | + ~ | + ~ | + "test" is a directory | + ]]) + execute('set shortmess=F') + execute('e test') + screen:expect([[ + ^ | + ~ | + ~ | + ~ | + :e test | + ]]) + end) + end) +end) diff --git a/test/functional/ui/shortmess_spec.lua b/test/functional/ui/shortmess_spec.lua deleted file mode 100644 index e58e33f6c3..0000000000 --- a/test/functional/ui/shortmess_spec.lua +++ /dev/null @@ -1,40 +0,0 @@ -local helpers = require('test.functional.helpers') -local Screen = require('test.functional.ui.screen') -local clear, feed, execute = helpers.clear, helpers.feed, helpers.execute - -describe("'shortmess'", function() - local screen - - before_each(function() - clear() - screen = Screen.new(25, 5) - screen:attach() - execute('set shortmess&') - end) - - after_each(function() - screen:detach() - end) - - describe("=F", function() - it(':hides messages about the files read', function() - execute('e test') - screen:expect([[ - ^ | - ~ | - ~ | - ~ | - "test" is a directory | - ]]) - execute('set shortmess=F') - execute('e test') - screen:expect([[ - ^ | - ~ | - ~ | - ~ | - :e test | - ]]) - end) - end) -end) -- cgit