jaehyun pushed a commit to branch master.

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

commit dffb6ead04cb92e93328d7c0974ee4e89418519c
Author: Jaehyun Cho <jae_hyun....@samsung.com>
Date:   Wed Feb 17 19:54:36 2016 +0900

    indent: Keep coding convensions in indent_text_auto_format()
---
 src/lib/indent.c | 90 ++++++++++++++++++++++++++++----------------------------
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/src/lib/indent.c b/src/lib/indent.c
index 7b1d125..95dc435 100644
--- a/src/lib/indent.c
+++ b/src/lib/indent.c
@@ -394,56 +394,56 @@ indent_text_auto_format(indent_data *id EINA_UNUSED,
    while (utf8_ptr && (utf8_ptr >= utf8))
      {
         if (utf8_ptr[0] != ' ')
-         {
-            if ((utf8_ptr[0] == '}') && (space > 0))
-              space -= TAB_SPACE;
-            if (!evas_textblock_cursor_paragraph_next(cur_start))
-             {
-                code_lines = eina_list_prepend(code_lines,
-                                               eina_stringshare_add("<br/>"));
-                evas_textblock_cursor_line_char_last(cur_start);
-             }
-            break;
-         }
+          {
+             if ((utf8_ptr[0] == '}') && (space > 0))
+               space -= TAB_SPACE;
+             if (!evas_textblock_cursor_paragraph_next(cur_start))
+               {
+                  code_lines = eina_list_prepend(code_lines,
+                                                 
eina_stringshare_add("<br/>"));
+                  evas_textblock_cursor_line_char_last(cur_start);
+               }
+             break;
+          }
         utf8_ptr--;
      }
    free(utf8);
 
    EINA_LIST_FOREACH(code_lines, l, line)
-    {
-       if ((line[0] == '}') && (space > 0))
-         space -= TAB_SPACE;
-       char *p = alloca(space + 1);
-       memset(p, ' ', space);
-       p[space] = '\0';
-       if (strcmp(line, "<br/>"))
-         eina_strbuf_append_printf(buf, "%s%s<br/>", p, line);
-       else
-         eina_strbuf_append_length(buf, "<br/>", 5);
-       memset(p, 0x0, space);
-       /* Based on the code line generation logic, "{" and "}" can exist
-          together in a code line within line comment.
-          In other case, "{" and "}" cannot exist together in a code line. */
-       if (strstr(line, "{") && !strstr(line, "}")) space += TAB_SPACE;
-       eina_stringshare_del(line);
-       line_cnt++;
-    }
-
-  frmt_buf = eina_strbuf_string_steal(buf);
-  tb_cur_pos = evas_textblock_cursor_pos_get(cur_start);
-  evas_textblock_cursor_pos_set(cur_end, tb_cur_pos);
-
-  evas_object_textblock_text_markup_prepend(cur_start, frmt_buf);
-
-  // Cancel last added diff, that was created when text pasted into entry.
-  redoundo_n_diff_cancel(rd, 1);
-  //Add data about formatted change into the redoundo queue.
-  redoundo_text_push(rd, frmt_buf, tb_cur_pos, 0, EINA_TRUE);
-
-  eina_strbuf_free(buf);
-  free(frmt_buf);
-  evas_textblock_cursor_free(cur_start);
-  return line_cnt;
+     {
+        if ((line[0] == '}') && (space > 0))
+          space -= TAB_SPACE;
+        char *p = alloca(space + 1);
+        memset(p, ' ', space);
+        p[space] = '\0';
+        if (strcmp(line, "<br/>"))
+          eina_strbuf_append_printf(buf, "%s%s<br/>", p, line);
+        else
+          eina_strbuf_append_length(buf, "<br/>", 5);
+        memset(p, 0x0, space);
+        /* Based on the code line generation logic, "{" and "}" can exist
+           together in a code line within line comment.
+           In other case, "{" and "}" cannot exist together in a code line. */
+        if (strstr(line, "{") && !strstr(line, "}")) space += TAB_SPACE;
+        eina_stringshare_del(line);
+        line_cnt++;
+     }
+
+   frmt_buf = eina_strbuf_string_steal(buf);
+   tb_cur_pos = evas_textblock_cursor_pos_get(cur_start);
+   evas_textblock_cursor_pos_set(cur_end, tb_cur_pos);
+
+   evas_object_textblock_text_markup_prepend(cur_start, frmt_buf);
+
+   // Cancel last added diff, that was created when text pasted into entry.
+   redoundo_n_diff_cancel(rd, 1);
+   //Add data about formatted change into the redoundo queue.
+   redoundo_text_push(rd, frmt_buf, tb_cur_pos, 0, EINA_TRUE);
+
+   eina_strbuf_free(buf);
+   free(frmt_buf);
+   evas_textblock_cursor_free(cur_start);
+   return line_cnt;
 }
 
 int

-- 


Reply via email to