Mercurial > vim
comparison src/testdir/test_bufwintabinfo.vim @ 13020:58cce40c965b v8.0.1386
patch 8.0.1386: cannot select modified buffers with getbufinfo()
commit https://github.com/vim/vim/commit/8e6a31df81113bbf0e4bb5324a74dc5f6c62a490
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Dec 10 21:06:22 2017 +0100
patch 8.0.1386: cannot select modified buffers with getbufinfo()
Problem: Cannot select modified buffers with getbufinfo().
Solution: Add the "bufmodified" flag. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/2431)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 10 Dec 2017 21:15:05 +0100 |
parents | 03a6aeea2096 |
children | 48287f1fc8a1 |
comparison
equal
deleted
inserted
replaced
13019:d4f4479e8e51 | 13020:58cce40c965b |
---|---|
17 let b:editor = 'vim' | 17 let b:editor = 'vim' |
18 let l = getbufinfo('%') | 18 let l = getbufinfo('%') |
19 call assert_equal(bufnr('%'), l[0].bufnr) | 19 call assert_equal(bufnr('%'), l[0].bufnr) |
20 call assert_equal('vim', l[0].variables.editor) | 20 call assert_equal('vim', l[0].variables.editor) |
21 call assert_notequal(-1, index(l[0].windows, bufwinid('%'))) | 21 call assert_notequal(-1, index(l[0].windows, bufwinid('%'))) |
22 | |
23 " Test for getbufinfo() with 'bufmodified' | |
24 call assert_equal(0, len(getbufinfo({'bufmodified' : 1}))) | |
25 call setbufline('Xtestfile1', 1, ["Line1"]) | |
26 let l = getbufinfo({'bufmodified' : 1}) | |
27 call assert_equal(1, len(l)) | |
28 call assert_equal(bufnr('Xtestfile1'), l[0].bufnr) | |
22 | 29 |
23 if has('signs') | 30 if has('signs') |
24 call append(0, ['Linux', 'Windows', 'Mac']) | 31 call append(0, ['Linux', 'Windows', 'Mac']) |
25 sign define Mark text=>> texthl=Search | 32 sign define Mark text=>> texthl=Search |
26 exe "sign place 2 line=3 name=Mark buffer=" . bufnr('%') | 33 exe "sign place 2 line=3 name=Mark buffer=" . bufnr('%') |