mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 08:18:17 +00:00
vim-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.
ff930cad8a
This commit is contained in:
@@ -5986,13 +5986,12 @@ static void ex_quit(exarg_T *eap)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// If there are more files or windows we won't exit.
|
||||||
* If there are more files or windows we won't exit.
|
if (check_more(FALSE, eap->forceit) == OK && only_one_window()) {
|
||||||
*/
|
exiting = true;
|
||||||
if (check_more(FALSE, eap->forceit) == OK && only_one_window())
|
}
|
||||||
exiting = TRUE;
|
if ((!buf_hide(wp->w_buffer)
|
||||||
if ((!buf_hide(curbuf)
|
&& check_changed(wp->w_buffer, (p_awa ? CCGD_AW : 0)
|
||||||
&& check_changed(curbuf, (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
|
||||||
|
@@ -1310,3 +1310,16 @@ func! Test_edit_rightleft()
|
|||||||
set norightleft
|
set norightleft
|
||||||
bw!
|
bw!
|
||||||
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
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user