File tree Expand file tree Collapse file tree 3 files changed +4
-20
lines changed Expand file tree Collapse file tree 3 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -1563,13 +1563,8 @@ void do_shell(
15631563 msg_putchar ('\n' ); // may shift screen one line up
15641564
15651565 // warning message before calling the shell
1566- if (p_warn && !autocmd_busy && msg_silent == 0 )
1567- FOR_ALL_BUFFERS (buf )
1568- if (bufIsChangedNotTerm (buf ))
1569- {
1566+ if (p_warn && !autocmd_busy && msg_silent == 0 && anyBufIsChanged ())
15701567 msg_puts (_ ("[No write since last change]\n" ));
1571- break ;
1572- }
15731568
15741569 // This windgoto is required for when the '\n' resulted in a "delete line
15751570 // 1" command to the terminal.
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ void u_undoline(void);
2626void u_blockfree (buf_T * buf );
2727int bufIsChanged (buf_T * buf );
2828int anyBufIsChanged (void );
29- int bufIsChangedNotTerm (buf_T * buf );
3029int curbufIsChanged (void );
3130void u_eval_tree (u_header_T * first_uhp , list_T * list );
3231/* vim: set ft=c : */
Original file line number Diff line number Diff line change @@ -3148,13 +3148,13 @@ void u_blockfree(buf_T *buf)
31483148 * Check if the 'modified' flag is set, or 'ff' has changed (only need to
31493149 * check the first character, because it can only be "dos", "unix" or "mac").
31503150 * "nofile" and "scratch" type buffers are considered to always be unchanged.
3151- * Also considers a buffer changed when a terminal window contains a running
3152- * job.
31533151 */
31543152int bufIsChanged (buf_T * buf )
31553153{
31563154
3157- return bufIsChangedNotTerm (buf );
3155+ // In a "prompt" buffer we do respect 'modified', so that we can control
3156+ // closing the window by setting or resetting that option.
3157+ return (!bt_dontwrite (buf ) || bt_prompt (buf )) && (buf -> b_changed || file_ff_differs (buf , TRUE));
31583158}
31593159
31603160/*
@@ -3170,16 +3170,6 @@ int anyBufIsChanged(void)
31703170 return FALSE;
31713171}
31723172
3173- /*
3174- * Like bufIsChanged() but ignoring a terminal window.
3175- */
3176- int bufIsChangedNotTerm (buf_T * buf )
3177- {
3178- // In a "prompt" buffer we do respect 'modified', so that we can control
3179- // closing the window by setting or resetting that option.
3180- return (!bt_dontwrite (buf ) || bt_prompt (buf )) && (buf -> b_changed || file_ff_differs (buf , TRUE));
3181- }
3182-
31833173int curbufIsChanged (void )
31843174{
31853175 return bufIsChanged (curbuf );
You can’t perform that action at this time.
0 commit comments