Commit Diff


commit - 16578ca54ffdaeb1dbb244f6577b18c9f52f8c03
commit + 5b3e45c115c5ee6143d5a16ba83c87da3c9903f8
blob - dfb9fa0403e167d2d816568be139b7066340d45f
blob + d0e0c6de1ce07894a690b437eb54e4db869c8068
--- ChangeLog
+++ ChangeLog
@@ -1,4 +1,6 @@
 2022-01-02  Omar Polo  <op@omarpolo.com>
+
+	* cmd.c (cmd_kill_telescope): ask yorn (yes or no) before quitting telescope.
 
 	* minibuffer.c (eecmd_select): execute the selected command, not what it's being typed into the minibuffer.
 
blob - e826aa9b83a84f8316aeca93e18b098f9f0eae1b
blob + adbdf3b9d75a5755f48b67d2e0a8137838d20c24
--- cmd.c
+++ cmd.c
@@ -270,13 +270,21 @@ cmd_end_of_buffer(struct buffer *buffer)
 		forward_line(buffer, -1);
 
 	cmd_move_end_of_line(buffer);
+}
+
+static void
+kill_telescope_cb(int r, struct tab *tab)
+{
+	if (r) {
+		save_session();
+		event_loopbreak();
+	}
 }
 
 void
 cmd_kill_telescope(struct buffer *buffer)
 {
-	save_session();
-	event_loopbreak();
+	yornp("really quit?", kill_telescope_cb, NULL);
 }
 
 void