diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-11-22 06:52:21 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-11-22 07:21:26 +0800 |
| commit | 9b768752353d3cf99c6cb02e6c1f9d70c029ecb6 (patch) | |
| tree | 4625bc963ec1a910304039bd6573e0b10935cc5e /src/nvim/testdir | |
| parent | 5836c89ed0506748458e495b2751789e81057519 (diff) | |
| download | rneovim-9b768752353d3cf99c6cb02e6c1f9d70c029ecb6.tar.gz rneovim-9b768752353d3cf99c6cb02e6c1f9d70c029ecb6.tar.bz2 rneovim-9b768752353d3cf99c6cb02e6c1f9d70c029ecb6.zip | |
vim-patch:9.0.0916: getbufline() is inefficient for getting a single line
Problem: getbufline() is inefficient for getting a single line.
Solution: Add getbufoneline().
https://github.com/vim/vim/commit/ce30ccc06af7f2c03762e5b18dde37b26ea6ec42
Cherry-pick part of usr_41.txt from patch 8.1.1628.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_bufline.vim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_bufline.vim b/src/nvim/testdir/test_bufline.vim index 9c4e48734a..d4dee38620 100644 --- a/src/nvim/testdir/test_bufline.vim +++ b/src/nvim/testdir/test_bufline.vim @@ -11,7 +11,9 @@ func Test_setbufline_getbufline() hide call assert_equal(0, setbufline(b, 1, ['foo', 'bar'])) call assert_equal(['foo'], getbufline(b, 1)) + call assert_equal('foo', getbufoneline(b, 1)) call assert_equal(['bar'], getbufline(b, '$')) + call assert_equal('bar', getbufoneline(b, '$')) call assert_equal(['foo', 'bar'], getbufline(b, 1, 2)) exe "bd!" b call assert_equal([], getbufline(b, 1, 2)) @@ -35,8 +37,11 @@ func Test_setbufline_getbufline() call assert_equal(0, setbufline(b, 4, ['d', 'e'])) call assert_equal(['c'], b->getbufline(3)) + call assert_equal('c', b->getbufoneline(3)) call assert_equal(['d'], getbufline(b, 4)) + call assert_equal('d', getbufoneline(b, 4)) call assert_equal(['e'], getbufline(b, 5)) + call assert_equal('e', getbufoneline(b, 5)) call assert_equal([], getbufline(b, 6)) call assert_equal([], getbufline(b, 2, 1)) |