jaehyun pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=26b84340fe15c9409e04998a9a13a6be713769b4

commit 26b84340fe15c9409e04998a9a13a6be713769b4
Author: Jaehyun Cho <jae_hyun....@samsung.com>
Date:   Wed Feb 17 22:46:00 2016 +0900

    indent: Fix not to insert a new line between '{' and block state
    
    <Test Case>
    1. Copy "description { "default";" in basic.edc.
    2. Paste
    
    <Test Result>
    Previously, a new line is inserted between "description {" and
    ""default";".
    Now, the copied text is pasted.
---
 src/lib/indent.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/lib/indent.c b/src/lib/indent.c
index 79a75a7..0898734 100644
--- a/src/lib/indent.c
+++ b/src/lib/indent.c
@@ -358,9 +358,21 @@ indent_text_auto_format(indent_data *id EINA_UNUSED,
                                       /* To preserve code line until block 
name,
                                          keep start position of lexeme and
                                          append code line until ';'. */
-                                      if (*bracket_right_ptr == '\"' ||
-                                          (bracket_right_ptr + 4 < utf8_end &&
-                                           !strncmp(bracket_right_ptr, 
"name:", 5)))
+                                      Eina_Bool block_name_found = EINA_FALSE;
+
+                                      if (*bracket_right_ptr == '\"')
+                                        block_name_found = EINA_TRUE;
+                                      else if (bracket_right_ptr + 4 < 
utf8_end)
+                                        {
+                                           if (!strncmp(bracket_right_ptr,
+                                                        "name:", 5))
+                                             block_name_found = EINA_TRUE;
+                                           else if (!strncmp(bracket_right_ptr,
+                                                             "state:", 5))
+                                             block_name_found = EINA_TRUE;
+                                        }
+
+                                      if (block_name_found)
                                         {
                                            keep_lexem_start_pos = EINA_TRUE;
                                            break;

-- 


Reply via email to