Mercurial > vim
changeset 6516:1d3139ae6ce6 v7.4.585
updated for version 7.4.585
Problem: Range for :bdelete does not work. (Ronald Schild)
Solution: Also allow unloaded buffers.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 20 Jan 2015 13:29:49 +0100 |
parents | 0b114f2476f9 |
children | 7c2829a0234b |
files | src/ex_cmds.h src/testdir/test_command_count.in src/testdir/test_command_count.ok src/version.c |
diffstat | 4 files changed, 34 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -173,7 +173,7 @@ EX(CMD_badd, "badd", ex_edit, ADDR_LINES), EX(CMD_bdelete, "bdelete", ex_bunload, BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR, - ADDR_LOADED_BUFFERS), + ADDR_BUFFERS), EX(CMD_behave, "behave", ex_behave, NEEDARG|WORD1|TRLBAR|CMDWIN, ADDR_LINES),
--- a/src/testdir/test_command_count.in +++ b/src/testdir/test_command_count.in @@ -92,11 +92,37 @@ STARTTEST :call append(0, g:lines) :unlet g:lines :w|bd -:se hidden :b1 ENDTEST STARTTEST +:let g:lines = [] +:func BufStatus() +: call add(g:lines, 'aaa: ' . buflisted(g:buf_aaa) . ' bbb: ' . buflisted(g:buf_bbb) . ' ccc: ' . buflisted(g:buf_ccc)) +:endfunc +:se nohidden +:e aaa +:let buf_aaa = bufnr('%') +:e bbb +:let buf_bbb = bufnr('%') +:e ccc +:let buf_ccc = bufnr('%') +:b1 +:call BufStatus() +:exe buf_bbb . "," . buf_ccc . "bdelete" +:call BufStatus() +:exe buf_aaa . "bdelete" +:call BufStatus() +:e! test.out +:call append('$', g:lines) +:unlet g:lines +:delfunc BufStatus +:w|bd +:b1 +ENDTEST + +STARTTEST +:se hidden :only! :let g:lines = [] :%argd
--- a/src/testdir/test_command_count.ok +++ b/src/testdir/test_command_count.ok @@ -28,8 +28,11 @@ 0close $+tabe E16: Invalid range 0tabm x +aaa: 1 bbb: 1 ccc: 1 +aaa: 1 bbb: 0 ccc: 0 +aaa: 0 bbb: 0 ccc: 0 argdo: c d e windo: 2 3 4 -bufdo: 2 3 4 5 6 7 8 9 10 12 +bufdo: 2 3 4 5 6 7 8 9 10 15 bufdo: 3 4 5 6 7 tabdo: 2 3 4