commit 7abd279c92312f36c6e17bbf08addef489cf5a07
parent b25f6a1b7b3af5608ddfe7bace79451115eb2c34
Author: Hamish Downer <dmishd@gmail.com>
Date: Sun, 20 Feb 2011 22:09:44 +0000
async mode: ask for confirmation if file is being edited
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/sup/modes/edit-message-async-mode.rb b/lib/sup/modes/edit-message-async-mode.rb
@@ -31,8 +31,9 @@ class EditMessageAsyncMode < LineCursorMode
def killable?
if file_being_edited?
- BufferManager.flash "Please check that #{@file_path} is not open in any editor and try again."
- return false
+ if !BufferManager.ask_yes_or_no("It appears that #{@file_path} is still being edited. Are you sure?")
+ return false
+ end
end
@parent_edit_mode.edit_message_async_resume true
@@ -47,8 +48,9 @@ protected
def edit_finished
if file_being_edited?
- BufferManager.flash "Please check that #{@file_path} is not open in any editor and try again."
- return false
+ if !BufferManager.ask_yes_or_no("It appears that #{@file_path} is still being edited. Are you sure?")
+ return false
+ end
end
@parent_edit_mode.edit_message_async_resume