hermet pushed a commit to branch master.

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

commit afeb32650e17f4a8959c6c360f2daad920c7e7b0
Author: ChunEon Park <her...@hermet.pe.kr>
Date:   Wed May 14 17:21:37 2014 +0900

    editor - fix a bug that empty space is dangled in the end of lines.
    
    while adding/removing text lines, this bug is happened.
    fixed now.
---
 src/bin/edc_editor.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/bin/edc_editor.c b/src/bin/edc_editor.c
index 9f1982d..47420fe 100644
--- a/src/bin/edc_editor.c
+++ b/src/bin/edc_editor.c
@@ -61,10 +61,10 @@ line_decrease(edit_data *ed, int cnt)
 
    Evas_Object *textblock = elm_entry_textblock_get(ed->en_line);
    Evas_Textblock_Cursor *cur1 = evas_object_textblock_cursor_new(textblock);
-   evas_textblock_cursor_line_set(cur1, (ed->line_max - cnt));
+   evas_textblock_cursor_line_set(cur1, (ed->line_max - cnt - 1));
+   evas_textblock_cursor_line_char_last(cur1);
 
    Evas_Textblock_Cursor *cur2 = evas_object_textblock_cursor_new(textblock);
-   evas_textblock_cursor_line_set(cur2, ed->line_max);
    evas_textblock_cursor_paragraph_last(cur2);
 
    evas_textblock_cursor_range_delete(cur1, cur2);
@@ -76,7 +76,7 @@ line_decrease(edit_data *ed, int cnt)
 
    ed->line_max -= cnt;
 
-   if (ed->line_max < 0) ed->line_max = 0;
+   if (ed->line_max < 1) line_init(ed);
 }
 
 static void
@@ -846,17 +846,18 @@ edit_edc_read(edit_data *ed, const char *file_path)
    if (!strbuf_edit) goto err;
 
    Eina_File_Line *line;
+   int line_num = 0;
 
    //Read first line specially.
    if (eina_iterator_next(itr, (void **)(void *)&(line)))
      {
+        line_num = 1;
         if (!eina_strbuf_append(strbuf_line, "1")) goto err;
         if (!eina_strbuf_append_length(strbuf_edit, line->start, line->length))
            goto err;
      }
 
    //Read last lines.
-   int line_num = 1;
    EINA_ITERATOR_FOREACH(itr, line)
      {
         line_num++;

-- 


Reply via email to