aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-12-12 23:01:53 -0500
committerJames McCoy <jamessan@jamessan.com>2016-12-28 14:57:39 -0500
commitfe03ce23bfc5c45545b53d4959aeeb27d82753ed (patch)
treebdd8a620471f3529d8171e8e5e989d2552424dc7 /src/nvim/testdir
parent03ed7e1ebaf7f0934b176c71949a77a3fe2291fb (diff)
downloadrneovim-fe03ce23bfc5c45545b53d4959aeeb27d82753ed.tar.gz
rneovim-fe03ce23bfc5c45545b53d4959aeeb27d82753ed.tar.bz2
rneovim-fe03ce23bfc5c45545b53d4959aeeb27d82753ed.zip
vim-patch:7.4.2273
Problem: getwininfo() and getbufinfo() are inefficient. Solution: Do not make a copy of all window/buffer-local options. Make it possible to get them with gettabwinvar() or getbufvar(). https://github.com/vim/vim/commit/3056735ae8a366aa7fcb51872520895251858637
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_bufwintabinfo.vim24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_bufwintabinfo.vim b/src/nvim/testdir/test_bufwintabinfo.vim
index 42c016621f..5c916e2dd7 100644
--- a/src/nvim/testdir/test_bufwintabinfo.vim
+++ b/src/nvim/testdir/test_bufwintabinfo.vim
@@ -18,7 +18,6 @@ function Test_getbufwintabinfo()
let b:editor = 'vim'
let l = getbufinfo('%')
call assert_equal(bufnr('%'), l[0].bufnr)
- call assert_equal(8, l[0].options.tabstop)
call assert_equal('vim', l[0].variables.editor)
call assert_notequal(-1, index(l[0].windows, bufwinid('%')))
@@ -49,7 +48,6 @@ function Test_getbufwintabinfo()
call assert_equal(winbufnr(2), winlist[1].bufnr)
call assert_equal(winheight(2), winlist[1].height)
call assert_equal(1, winlist[2].winnr)
- call assert_equal('auto', winlist[0].options.signcolumn)
call assert_equal(2, winlist[3].tabnr)
call assert_equal('green', winlist[2].variables.signal)
call assert_equal(winwidth(1), winlist[0].width)
@@ -81,3 +79,25 @@ function Test_getbufwintabinfo()
call assert_false(winlist[2].loclist)
wincmd t | only
endfunction
+
+function Test_get_buf_options()
+ let opts = getbufvar(bufnr('%'), '&')
+ call assert_equal(v:t_dict, type(opts))
+ call assert_equal(8, opts.tabstop)
+endfunc
+
+function Test_get_win_options()
+ let opts = getwinvar(1, '&')
+ call assert_equal(v:t_dict, type(opts))
+ call assert_equal(0, opts.linebreak)
+ if has('signs')
+ call assert_equal('auto', opts.signcolumn)
+ endif
+
+ let opts = gettabwinvar(1, 1, '&')
+ call assert_equal(v:t_dict, type(opts))
+ call assert_equal(0, opts.linebreak)
+ if has('signs')
+ call assert_equal('auto', opts.signcolumn)
+ endif
+endfunc