summaryrefslogtreecommitdiffstats
path: root/curs_main.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2020-12-03 13:40:51 -0800
committerKevin McCarthy <kevin@8t8.us>2020-12-03 13:40:51 -0800
commit8d1f22a1f47a00f5f75c3878342c3a65ebcfd18a (patch)
tree75332f8e4f7c6adf53c0bdaaa471551eced0406f /curs_main.c
parentd52b69bb045c0fe3bb7e76e2a1e8a23441f6f4f9 (diff)
Refresh index if a tagged save aborts in the middle.
Make the sure the index message flags and status line are properly redrawn in that case.
Diffstat (limited to 'curs_main.c')
-rw-r--r--curs_main.c61
1 files changed, 37 insertions, 24 deletions
diff --git a/curs_main.c b/curs_main.c
index 19427025..06cc79f4 100644
--- a/curs_main.c
+++ b/curs_main.c
@@ -1702,34 +1702,47 @@ int mutt_index_menu (void)
case OP_SAVE:
case OP_DECODE_COPY:
case OP_DECODE_SAVE:
+ {
+ int rc;
+
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- if (mutt_save_message (tag ? NULL : CURHDR,
- (op == OP_DECRYPT_SAVE) ||
- (op == OP_SAVE) || (op == OP_DECODE_SAVE),
- (op == OP_DECODE_SAVE) || (op == OP_DECODE_COPY),
- (op == OP_DECRYPT_SAVE) || (op == OP_DECRYPT_COPY) ||
- 0) == 0 &&
- (op == OP_SAVE || op == OP_DECODE_SAVE || op == OP_DECRYPT_SAVE)
- )
- {
- menu->redraw |= REDRAW_STATUS;
+ rc = mutt_save_message (tag ? NULL : CURHDR,
+ (op == OP_DECRYPT_SAVE) ||
+ (op == OP_SAVE) || (op == OP_DECODE_SAVE),
+ (op == OP_DECODE_SAVE) || (op == OP_DECODE_COPY),
+ (op == OP_DECRYPT_SAVE) || (op == OP_DECRYPT_COPY) ||
+ 0);
+ /* These update status and delete flags, so require a redraw. */
+ if (op == OP_SAVE || op == OP_DECODE_SAVE || op == OP_DECRYPT_SAVE)
+ {
+ /* tagged operation could abort in the middle. need to make sure
+ * affected messages are still redrawn */
if (tag)
+ {
+ menu->redraw |= REDRAW_STATUS;
menu->redraw |= REDRAW_INDEX;
- else if (option (OPTRESOLVE))
- {
- if ((menu->current = ci_next_undeleted (menu->current)) == -1)
- {
- menu->current = menu->oldcurrent;
- menu->redraw |= REDRAW_CURRENT;
- }
- else
- menu->redraw |= REDRAW_MOTION_RESYNCH;
- }
- else
- menu->redraw |= REDRAW_CURRENT;
- }
- break;
+ }
+
+ if (rc == 0 && !tag)
+ {
+ menu->redraw |= REDRAW_STATUS;
+ if (option (OPTRESOLVE))
+ {
+ if ((menu->current = ci_next_undeleted (menu->current)) == -1)
+ {
+ menu->current = menu->oldcurrent;
+ menu->redraw |= REDRAW_CURRENT;
+ }
+ else
+ menu->redraw |= REDRAW_MOTION_RESYNCH;
+ }
+ else
+ menu->redraw |= REDRAW_CURRENT;
+ }
+ }
+ break;
+ }
case OP_MAIN_NEXT_NEW:
case OP_MAIN_NEXT_UNREAD: