mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.0.1205: it is possible to unload a changed buffer
Problem: Using "1q" it is possible to unload a changed buffer. (Rick Howe) Solution: Check the right window for changes.
This commit is contained in:
parent
87ffb5c1a3
commit
ff930cad8a
@ -7245,8 +7245,8 @@ ex_quit(exarg_T *eap)
|
|||||||
*/
|
*/
|
||||||
if (check_more(FALSE, eap->forceit) == OK && only_one_window())
|
if (check_more(FALSE, eap->forceit) == OK && only_one_window())
|
||||||
exiting = TRUE;
|
exiting = TRUE;
|
||||||
if ((!buf_hide(curbuf)
|
if ((!buf_hide(wp->w_buffer)
|
||||||
&& check_changed(curbuf, (p_awa ? CCGD_AW : 0)
|
&& check_changed(wp->w_buffer, (p_awa ? CCGD_AW : 0)
|
||||||
| (eap->forceit ? CCGD_FORCEIT : 0)
|
| (eap->forceit ? CCGD_FORCEIT : 0)
|
||||||
| CCGD_EXCMD))
|
| CCGD_EXCMD))
|
||||||
|| check_more(TRUE, eap->forceit) == FAIL
|
|| check_more(TRUE, eap->forceit) == FAIL
|
||||||
|
@ -1373,3 +1373,16 @@ func Test_edit_complete_very_long_name()
|
|||||||
endif
|
endif
|
||||||
set swapfile&
|
set swapfile&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_edit_quit()
|
||||||
|
edit foo.txt
|
||||||
|
split
|
||||||
|
new
|
||||||
|
call setline(1, 'hello')
|
||||||
|
3wincmd w
|
||||||
|
redraw!
|
||||||
|
call assert_fails('1q', 'E37:')
|
||||||
|
bwipe! foo.txt
|
||||||
|
only
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
@ -761,6 +761,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1205,
|
||||||
/**/
|
/**/
|
||||||
1204,
|
1204,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user