commit 76d4abac50c40f29efca246bca20730aaae9b7e8
parent 7abd279c92312f36c6e17bbf08addef489cf5a07
Author: Hamish Downer <dmishd@gmail.com>
Date: Tue, 22 Feb 2011 17:14:30 +0000
async edit mode: clean up
Some minor clean up to remove bits that were added during development,
remove extraneous whitespace and improve code style slightly.
Diffstat:
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/lib/sup/modes/edit-message-async-mode.rb b/lib/sup/modes/edit-message-async-mode.rb
@@ -1,5 +1,3 @@
-require 'thread'
-
module Redwood
class EditMessageAsyncMode < LineCursorMode
@@ -13,14 +11,14 @@ class EditMessageAsyncMode < LineCursorMode
@parent_edit_mode = parent_edit_mode
@file_path = file_path
@orig_mtime = File.mtime @file_path
-
+
@text = ["ASYNC MESSAGE EDIT",
"", "Your message with subject:", msg_subject, "is saved in a file:", "", @file_path, "",
"You can edit your message in the editor of your choice and continue to",
"use sup while you edit your message.", "",
"Press <Enter> to have the file path copied to the clipboard.", "",
"When you have finished editing, select this buffer and press 'E'.",]
- super()
+ super()
end
def lines; @text.length end
@@ -77,8 +75,7 @@ protected
vim_lock_file = File.join(File.dirname(@file_path), '.'+File.basename(@file_path)+'.swp')
emacs_lock_file = File.join(File.dirname(@file_path), '.#'+File.basename(@file_path))
- return true if File.exist? vim_lock_file
- return true if File.exist? emacs_lock_file
+ return true if File.exist?(vim_lock_file) || File.exist?(emacs_lock_file)
false
end
diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
@@ -1,7 +1,6 @@
require 'tempfile'
require 'socket' # just for gethostname!
require 'pathname'
-require 'thread'
module Redwood