Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* Fix attachment delete off-by-one
@ 2011-09-25 13:56 Gaute Hope
  0 siblings, 0 replies; only message in thread
From: Gaute Hope @ 2011-09-25 13:56 UTC (permalink / raw)
  To: sup-devel

[-- Attachment #1: Type: text/plain, Size: 215 bytes --]

Hi,

deleting attachments with 'd' in edit-mode is off-by-one (you needed to
select the line above the attachment). Attached patch fixes this issue.

(Perhaps introduced with the account selector ?)

Regards,
Gaute

[-- Attachment #2: 0001-Fix-attachment-off-by-one-line-selection-in-edit-mes.patch --]
[-- Type: application/octet-stream, Size: 915 bytes --]

From b85798280484628b4ace525250a999d99e7bc480 Mon Sep 17 00:00:00 2001
From: Gaute Hope <eg@gaute.vetsj.com>
Date: Sun, 25 Sep 2011 15:50:03 +0200
Subject: [PATCH] Fix attachment off-by-one line selection in
 edit-message-mode

---
 lib/sup/modes/edit-message-mode.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
index 17ffadb..fb52990 100644
--- a/lib/sup/modes/edit-message-mode.rb
+++ b/lib/sup/modes/edit-message-mode.rb
@@ -282,7 +282,7 @@ EOS
   end
 
   def delete_attachment
-    i = curpos - @attachment_lines_offset - DECORATION_LINES - 1
+    i = curpos - @attachment_lines_offset - DECORATION_LINES - 2
     if i >= 0 && i < @attachments.size && BufferManager.ask_yes_or_no("Delete attachment #{@attachment_names[i]}?")
       @attachments.delete_at i
       @attachment_names.delete_at i
-- 
1.7.6.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-25 13:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-25 13:56 Fix attachment delete off-by-one Gaute Hope

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox