From e2843ede7ea2bb3f60f46d8c679ac67fc632451b Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@telfort.nl>
Date: Sat, 9 Dec 2017 10:56:57 +0100
Subject: [PATCH] text: let a Shift-selection persist when indenting and
 commenting

To achieve that, fake the Shift key being held when indenting/
unindenting/commenting/uncommenting.

Reported-by: Brand Huntsman <alpha@qzx.com>
---
 src/text.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/text.c b/src/text.c
index 8b497882..a01bcc86 100644
--- a/src/text.c
+++ b/src/text.c
@@ -343,6 +343,7 @@ void do_indent(void)
 
     set_modified();
     refresh_needed = TRUE;
+    shift_held = TRUE;
 }
 
 /* Return the number of bytes of whitespace at the start of the given text,
@@ -439,6 +440,7 @@ void do_unindent(void)
 
     set_modified();
     refresh_needed = TRUE;
+    shift_held = TRUE;
 }
 
 /* Perform an undo or redo for an indent or unindent action. */
@@ -550,6 +552,7 @@ void do_comment(void)
 
     set_modified();
     refresh_needed = TRUE;
+    shift_held = TRUE;
 }
 
 /* Test whether the given line can be uncommented, or add or remove a comment,
-- 
GitLab