From 7866d2bcd6797b8279238ffb2f710bd9ea599cc8 Mon Sep 17 00:00:00 2001 From: dequis Date: Fri, 25 Sep 2015 03:22:02 -0300 Subject: Handle empty bracketed pastes (or sequences of those) Both cases were off-by-one mistakes erring on the side of being too conservative. This fixes these two harmless issues: - For a single empty paste, it required another keystroke before processing it - For a sequence of themcase, a single '~' was left in the input --- src/fe-text/gui-readline.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/fe-text') diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c index 4616e919..6e169b93 100644 --- a/src/fe-text/gui-readline.c +++ b/src/fe-text/gui-readline.c @@ -685,7 +685,7 @@ static void paste_bracketed_middle() int len = paste_buffer->len - marklen; unichar *ptr = (unichar *) paste_buffer->data; - if (len <= 0) { + if (len < 0) { return; } @@ -702,10 +702,8 @@ static void paste_bracketed_middle() len -= marklen * 2; /* go one step back */ - if (i > 0) { - i--; - ptr--; - } + i--; + ptr--; continue; } paste_bracketed_end(i, i != len); -- cgit v1.2.3