[Bf-blender-cvs] [2549384baaa] master: Cleanup: minor tweaks to auto-close

Campbell Barton noreply at git.blender.org
Sun Nov 14 01:27:47 CET 2021


Commit: 2549384baaaedfce96157430f1f0a5b44147262f
Author: Campbell Barton
Date:   Sun Nov 14 11:11:20 2021 +1100
Branches: master
https://developer.blender.org/rB2549384baaaedfce96157430f1f0a5b44147262f

Cleanup: minor tweaks to auto-close

Spelling and failure to reuse variable missed in review.

===================================================================

M	source/blender/editors/space_text/text_ops.c

===================================================================

diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 3cca1859bbf..08869acdfc6 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -87,7 +87,7 @@ static void test_line_start(char c, bool *r_last_state)
 
 /**
  * This function receives a character and returns its closing pair if it exists.
- * \param character: Characater to find the closing pair.
+ * \param character: Character to find the closing pair.
  * \return The closing pair of the character if it exists.
  */
 static char text_closing_character_pair_get(const char character)
@@ -2428,11 +2428,10 @@ static int text_delete_exec(bContext *C, wmOperator *op)
       }
     }
     if (U.text_flag & USER_TEXT_EDIT_AUTO_CLOSE) {
-      const char *current = text->curl->line + text->curc;
-      if (*current != '\0') {
-        const char *prev = BLI_str_find_prev_char_utf8(text->curl->line + text->curc,
-                                                       text->curl->line);
-        if (*current == text_closing_character_pair_get(*prev)) {
+      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)) {
           txt_move_right(text, false);
           txt_backspace_char(text);
         }



More information about the Bf-blender-cvs mailing list