ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/tools/edi.git/commit/?id=b68312de33161a259a4e9c2b39c6b5f6713cb087

commit b68312de33161a259a4e9c2b39c6b5f6713cb087
Author: Andy Williams <a...@andywilliams.me>
Date:   Fri May 29 13:10:25 2015 +0100

    Fix deletion inserting random data.
    
    Off by one error (doubled). Classic.
    Lesson: Run the tests you write!
---
 elm_code/src/lib/widget/elm_code_widget_selection.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elm_code/src/lib/widget/elm_code_widget_selection.c 
b/elm_code/src/lib/widget/elm_code_widget_selection.c
index 5413daf..6f0e657 100644
--- a/elm_code/src/lib/widget/elm_code_widget_selection.c
+++ b/elm_code/src/lib/widget/elm_code_widget_selection.c
@@ -142,7 +142,7 @@ 
_elm_code_widget_selection_delete_multi(Elm_Code_Widget_Data *pd)
    first = elm_code_line_text_get(line, NULL);
    line = elm_code_file_line_get(pd->code->file, pd->selection->end_line);
    last = elm_code_line_text_get(line, &last_length);
-   length = pd->selection->start_col + last_length - pd->selection->end_col + 
1;
+   length = pd->selection->start_col + last_length - (pd->selection->end_col + 
1);
    content = malloc(sizeof(char) * length);
    strncpy(content, first, pd->selection->start_col - 1);
    strncpy(content + pd->selection->start_col - 1, last + 
pd->selection->end_col,

-- 


Reply via email to