mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 15:38:33 +00:00
Transform global variable really_exiting into static.
This commit is contained in:
@@ -606,9 +606,6 @@ EXTERN int exiting INIT(= FALSE);
|
|||||||
/* TRUE when planning to exit Vim. Might
|
/* TRUE when planning to exit Vim. Might
|
||||||
* still keep on running if there is a changed
|
* still keep on running if there is a changed
|
||||||
* buffer. */
|
* buffer. */
|
||||||
EXTERN int really_exiting INIT(= FALSE);
|
|
||||||
/* TRUE when we are sure to exit, e.g., after
|
|
||||||
* a deadly signal */
|
|
||||||
/* volatile because it is used in signal handler deathtrap(). */
|
/* volatile because it is used in signal handler deathtrap(). */
|
||||||
EXTERN volatile int full_screen INIT(= FALSE);
|
EXTERN volatile int full_screen INIT(= FALSE);
|
||||||
/* TRUE when doing full-screen output
|
/* TRUE when doing full-screen output
|
||||||
|
@@ -3329,32 +3329,35 @@ void prepare_to_exit(void)
|
|||||||
*/
|
*/
|
||||||
void preserve_exit(void)
|
void preserve_exit(void)
|
||||||
{
|
{
|
||||||
|
// 'true' when we are sure to exit, e.g., after a deadly signal
|
||||||
|
static bool really_exiting = false;
|
||||||
|
|
||||||
// Prevent repeated calls into this method.
|
// Prevent repeated calls into this method.
|
||||||
if (really_exiting) {
|
if (really_exiting) {
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
really_exiting = TRUE;
|
really_exiting = true;
|
||||||
|
|
||||||
prepare_to_exit();
|
prepare_to_exit();
|
||||||
|
|
||||||
out_str(IObuff);
|
out_str(IObuff);
|
||||||
screen_start(); /* don't know where cursor is now */
|
screen_start(); // don't know where cursor is now
|
||||||
out_flush();
|
out_flush();
|
||||||
|
|
||||||
ml_close_notmod(); /* close all not-modified buffers */
|
ml_close_notmod(); // close all not-modified buffers
|
||||||
|
|
||||||
FOR_ALL_BUFFERS(buf) {
|
FOR_ALL_BUFFERS(buf) {
|
||||||
if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL) {
|
if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL) {
|
||||||
OUT_STR("Vim: preserving files...\n");
|
OUT_STR("Vim: preserving files...\n");
|
||||||
screen_start(); /* don't know where cursor is now */
|
screen_start(); // don't know where cursor is now
|
||||||
out_flush();
|
out_flush();
|
||||||
ml_sync_all(FALSE, FALSE); /* preserve all swap files */
|
ml_sync_all(false, false); // preserve all swap files
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ml_close_all(FALSE); /* close all memfiles, without deleting */
|
ml_close_all(false); // close all memfiles, without deleting
|
||||||
|
|
||||||
OUT_STR("Vim: Finished.\n");
|
OUT_STR("Vim: Finished.\n");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user