Skip to content

Commit f8fa2fb

Browse files
John Orrvim-scripts
authored andcommitted
Version 1.1: Fix handling of modified, un-named buffers
1 parent 7c382dd commit f8fa2fb

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

plugin/bufkill.vim

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" bufkill.vim
22
" Maintainer: John Orr (john underscore orr yahoo com)
3-
" Version: 1.0
4-
" Last Change: 01 December 2004
3+
" Version: 1.1
4+
" Last Change: 02 December 2004
55

66
" Introduction: {{{1
77
" Basic Usage:
@@ -60,10 +60,8 @@
6060
" instead keep it's info so that we can jump forwards to it again
6161
" eg in case of a mistake (one level of undo is already implemented).
6262

63-
" Bugfixes:
64-
" Patience...
65-
6663
" Changelog:
64+
" 1.1 - Fix handling of modified, un-named buffers
6765
" 1.0 - initial functionality
6866

6967
" Reload guard and 'compatible' handling {{{1
@@ -206,7 +204,7 @@ function! <SID>BufKill(cmd, bang) "{{{1
206204
" If the buffer is already '[No File]' then doing enew won't create a new
207205
" buffer, hence the bd/bw command will kill the current buffer and take
208206
" the window with it... so check for this case
209-
if bufname('%') == ''
207+
if bufname('%') == '' && ! &modified
210208
" No buffer to kill
211209
return
212210
endif

0 commit comments

Comments
 (0)