From 3bdc61a13186699a9f9ad955ab1c8fbf5e8f032c Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 1 Oct 2013 13:54:34 +0100 Subject: Ensure cut can be undone. --- desktop/textarea.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'desktop/textarea.c') diff --git a/desktop/textarea.c b/desktop/textarea.c index 5d8400746..8afe12711 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -1570,7 +1570,7 @@ static bool textarea_replace_text(struct textarea *ta, size_t b_start, size_t b_end, const char *rep, size_t rep_len, bool add_to_clipboard, int *byte_delta, struct rect *r) { - if (!(b_start != b_end && rep_len == 0 && add_to_clipboard) && + if (!(b_start != b_end && rep == NULL && add_to_clipboard) && !(ta->flags & TEXTAREA_PASSWORD)) { /* Not just copying to clipboard, and not a password field; * Sort out undo buffer. */ @@ -1585,7 +1585,7 @@ static bool textarea_replace_text(struct textarea *ta, size_t b_start, return false; } - if (!(b_start != b_end && rep_len == 0 && add_to_clipboard) && + if (!(b_start != b_end && rep == NULL && add_to_clipboard) && !(ta->flags & TEXTAREA_PASSWORD)) { /* Not just copying to clipboard, and not a password field; * Update UNDO buffer */ -- cgit v1.2.3