diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-09-08 08:51:59 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-09-08 08:51:59 -0400 |
commit | 9468e538694cd16847586c66de6e16ee7a090577 (patch) | |
tree | e1dfb775ce8c4bd7df56f9edfad36ea4ed30b8a3 /test/functional/helpers.lua | |
parent | dc9652e68de163290abee880a74bf1727c715a1e (diff) | |
parent | 087f3bacaf2c854f3d07fdece211c4670e140f32 (diff) | |
download | rneovim-9468e538694cd16847586c66de6e16ee7a090577.tar.gz rneovim-9468e538694cd16847586c66de6e16ee7a090577.tar.bz2 rneovim-9468e538694cd16847586c66de6e16ee7a090577.zip |
Merge #2929 'Disallow "set encoding" after startup'
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r-- | test/functional/helpers.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index f228f6290c..6055cc3c59 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -7,7 +7,7 @@ local Session = require('nvim.session') local nvim_prog = os.getenv('NVIM_PROG') or 'build/bin/nvim' local nvim_argv = {nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N', - '--cmd', 'set shortmess+=I background=light noswapfile noautoindent laststatus=1', + '--cmd', 'set shortmess+=I background=light noswapfile noautoindent laststatus=1 encoding=utf-8', '--embed'} -- Formulate a path to the directory containing nvim. We use this to @@ -183,11 +183,16 @@ local function spawn(argv) return session end -local function clear() +local function clear(extra_cmd) if session then session:exit(0) end - session = spawn(nvim_argv) + local args = {unpack(nvim_argv)} + if extra_cmd ~= nil then + table.insert(args, '--cmd') + table.insert(args, extra_cmd) + end + session = spawn(args) end local function insert(...) |