1
0
forked from aniani/vim

patch 7.4.2050

Problem:    When using ":vimgrep" may end up with duplicate buffers.
Solution:   When adding an error list entry pass the buffer number if possible.
This commit is contained in:
Bram Moolenaar
2016-07-16 18:24:56 +02:00
parent f6acffbe83
commit 015102e91e
3 changed files with 27 additions and 3 deletions

View File

@@ -1462,3 +1462,18 @@ func Test_history()
call HistoryTest('c')
call HistoryTest('l')
endfunc
func Test_duplicate_buf()
" make sure we can get the highest buffer number
edit DoesNotExist
edit DoesNotExist2
let last_buffer = bufnr("$")
" make sure only one buffer is created
call writefile(['this one', 'that one'], 'Xgrepthis')
vimgrep one Xgrepthis
vimgrep one Xgrepthis
call assert_equal(last_buffer + 1, bufnr("$"))
call delete('Xgrepthis')
endfunc