Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-11-14 03:26:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-11-14 03:26:06 +0300
commit7e82c840b7a43b0594ba274c745f3049e0148d12 (patch)
treeedead495c02405d67d6279575d3c1504ccb25f1d
parent2549384baaaedfce96157430f1f0a5b44147262f (diff)
Fix text editor auto-close with quotes
Back-spacing a quote from the beginning of a line would delete the quote in-front instead of doing nothing.
-rw-r--r--source/blender/editors/space_text/text_ops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 08869acdfc6..3c0ffa29bbd 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -2431,7 +2431,8 @@ static int text_delete_exec(bContext *C, wmOperator *op)
const char *curr = text->curl->line + text->curc;
if (*curr != '\0') {
const char *prev = BLI_str_find_prev_char_utf8(curr, text->curl->line);
- if (*curr == text_closing_character_pair_get(*prev)) {
+ if ((curr != prev) && /* When back-spacing from the start of the line. */
+ (*curr == text_closing_character_pair_get(*prev))) {
txt_move_right(text, false);
txt_backspace_char(text);
}