jaehyun pushed a commit to branch master.

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

commit f98127a4854fb3c0d70a238ef027a3661ca72bee
Author: Jaehyun Cho <jae_hyun....@samsung.com>
Date:   Wed Feb 17 20:38:20 2016 +0900

    indent: Fix to preserve separate code lines
    
    If copied code lines are in the separate lines, then paste those code
    lines in the separate lines.
    
    <Test Case>
    1. Copy the following in edc.
    "TILED_HORIZ(120)
    visible: 0;"
    2. Paste
    
    <Test Result>
    Previously, those code lines are pasted in the same line.
    Now, those code lines are pasted in the separate lines like original
    code lines.
---
 src/lib/indent.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/lib/indent.c b/src/lib/indent.c
index 3a6a736..0c6b370 100644
--- a/src/lib/indent.c
+++ b/src/lib/indent.c
@@ -269,7 +269,16 @@ indent_text_auto_format(indent_data *id EINA_UNUSED,
 
              while (utf8_ptr < utf8_end)
                {
-                  if (*utf8_ptr == '{' || *utf8_ptr == '}' || *utf8_ptr == ';')
+                  if (*utf8_ptr == '\n')
+                    {
+                       code_lines = eina_list_append(code_lines,
+                                       eina_stringshare_add_length(utf8_lexem,
+                                       utf8_ptr - utf8_lexem));
+                       utf8_append_ptr = utf8_ptr;
+                       break;
+                    }
+                  else if (*utf8_ptr == '{' || *utf8_ptr == '}' ||
+                           *utf8_ptr == ';')
                     {
                        if (*utf8_ptr == '{')
                          {

-- 


Reply via email to