From 53065309b8787f535d693225f24f8404057da041 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Sat, 17 Jun 2017 17:59:40 +0100 Subject: [PATCH] elm_code: Fix select-all column calculations --- src/lib/elementary/elm_code_widget_selection.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib/elementary/elm_code_widget_selection.c b/src/lib/elementary/elm_code_widget_selection.c index ea2e584b69..441bf9b3fe 100644 --- a/src/lib/elementary/elm_code_widget_selection.c +++ b/src/lib/elementary/elm_code_widget_selection.c @@ -91,14 +91,19 @@ elm_code_widget_selection_end(Evas_Object *widget, EAPI void elm_code_widget_selection_select_all(Evas_Object *widget) { + Elm_Code_Line *last_line; + unsigned int last_length, last_col; Elm_Code_Widget_Data *pd; - Elm_Code_Widget_Selection_Data *selection; pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); - elm_code_widget_selection_start(widget, 0, 0); + elm_code_widget_selection_start(widget, 1, 1); int maxrow = elm_code_file_lines_get(pd->code->file); - elm_code_widget_selection_end(widget, maxrow, pd->col_count); + last_line = elm_code_file_line_get(pd->code->file, elm_code_file_lines_get(pd->code->file)); + (void*) elm_code_line_text_get(last_line, &last_length); + last_col = elm_code_widget_line_text_column_width_to_position(widget, last_line, last_length); + + elm_code_widget_selection_end(widget, maxrow, last_col); efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CHANGED, widget); }