aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/undo.c
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2019-05-25 11:14:35 +0900
committererw7 <erw7.github@gmail.com>2020-02-12 16:03:45 +0900
commitaec3d7915c55fc0b7dc73f6186cf0ae45d416d33 (patch)
tree54d83b901dd4b31126b0cb250b84a062a61c086e /src/nvim/undo.c
parentb015c4741caef37b3f89661e1d5d6a4a033b2856 (diff)
downloadrneovim-aec3d7915c55fc0b7dc73f6186cf0ae45d416d33.tar.gz
rneovim-aec3d7915c55fc0b7dc73f6186cf0ae45d416d33.tar.bz2
rneovim-aec3d7915c55fc0b7dc73f6186cf0ae45d416d33.zip
vim-patch:8.1.0091: MS-Windows: Cannot interrupt gdb when program is running
Problem: MS-Windows: Cannot interrupt gdb when program is running. Solution: Add debugbreak() and use it in the terminal debugger. Respect 'modified' in a prompt buffer. https://github.com/vim/vim/commit/4551c0a9fcdbdef52836d4852686d54b5e47fdaf
Diffstat (limited to 'src/nvim/undo.c')
-rw-r--r--src/nvim/undo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
index 1f74bada41..df92b2c036 100644
--- a/src/nvim/undo.c
+++ b/src/nvim/undo.c
@@ -2971,7 +2971,10 @@ static char_u *u_save_line(linenr_T lnum)
bool bufIsChanged(buf_T *buf)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
{
- return !bt_dontwrite(buf) && (buf->b_changed || file_ff_differs(buf, true));
+ // In a "prompt" buffer we do respect 'modified', so that we can control
+ // closing the window by setting or resetting that option.
+ return (!bt_dontwrite(buf) || bt_prompt(buf))
+ && (buf->b_changed || file_ff_differs(buf, true));
}
// Return true if any buffer has changes. Also buffers that are not written.