aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-12-26 08:30:15 -0500
committerJustin M. Keyes <justinkz@gmail.com>2014-12-26 08:30:15 -0500
commitd7a166578586f4f1636141e97103944584c00fa2 (patch)
treeeb2e56e594fc975ee773261b8ef0b3ba0c386179 /src
parent4840f59272bf7f312e6966b6562688ab7d5232f8 (diff)
parenta00c2e0ecbaec366364cecb5efbdb456c8c543ef (diff)
downloadrneovim-d7a166578586f4f1636141e97103944584c00fa2.tar.gz
rneovim-d7a166578586f4f1636141e97103944584c00fa2.tar.bz2
rneovim-d7a166578586f4f1636141e97103944584c00fa2.zip
Merge pull request #1718 from jonaias/master
Transform global variable really_exiting into static.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/globals.h3
-rw-r--r--src/nvim/misc1.c15
2 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 5f542eec0c..f53a780efe 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -606,9 +606,6 @@ EXTERN int exiting INIT(= FALSE);
/* TRUE when planning to exit Vim. Might
* still keep on running if there is a changed
* 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(). */
EXTERN volatile int full_screen INIT(= FALSE);
/* TRUE when doing full-screen output
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c
index fc848466c6..4f17f84e11 100644
--- a/src/nvim/misc1.c
+++ b/src/nvim/misc1.c
@@ -3329,32 +3329,35 @@ void prepare_to_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.
if (really_exiting) {
exit(2);
}
- really_exiting = TRUE;
+ really_exiting = true;
prepare_to_exit();
out_str(IObuff);
- screen_start(); /* don't know where cursor is now */
+ screen_start(); // don't know where cursor is now
out_flush();
- ml_close_notmod(); /* close all not-modified buffers */
+ ml_close_notmod(); // close all not-modified buffers
FOR_ALL_BUFFERS(buf) {
if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL) {
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();
- ml_sync_all(FALSE, FALSE); /* preserve all swap files */
+ ml_sync_all(false, false); // preserve all swap files
break;
}
}
- ml_close_all(FALSE); /* close all memfiles, without deleting */
+ ml_close_all(false); // close all memfiles, without deleting
OUT_STR("Vim: Finished.\n");