Add support for select all with ctrl-a

Summary: Signed-off-by: Sanjeev BA <iamsanjeev@gmail.com>

Test Plan: Test with edi.

Reviewers: ajwillia.ms, jpeg, cedric

Reviewed By: ajwillia.ms

Differential Revision: https://phab.enlightenment.org/D4971
This commit is contained in:
Sanjeev BA 2017-06-17 17:16:24 +01:00 committed by Andy Williams
parent 4bf13c5c0c
commit ed201d7f30
3 changed files with 21 additions and 0 deletions

View File

@ -1536,6 +1536,8 @@ _elm_code_widget_control_key_down_cb(Elm_Code_Widget *widget, const char *key)
elm_code_widget_redo(widget);
else if (!strcmp("z", key))
elm_code_widget_undo(widget);
else if (!strcmp("a", key))
elm_code_widget_selection_select_all(widget);
}
static Eina_Bool

View File

@ -88,6 +88,22 @@ elm_code_widget_selection_end(Evas_Object *widget,
efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CHANGED, widget);
}
EAPI void
elm_code_widget_selection_select_all(Evas_Object *widget)
{
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);
int maxrow = elm_code_file_lines_get(pd->code->file);
elm_code_widget_selection_end(widget, maxrow, pd->col_count);
efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CHANGED, widget);
}
EAPI Elm_Code_Widget_Selection_Data *
elm_code_widget_selection_normalized_get(Evas_Object *widget)
{

View File

@ -35,6 +35,9 @@ EAPI void elm_code_widget_selection_paste(Evas_Object *widget);
EAPI Eina_Bool elm_code_widget_selection_is_empty(Evas_Object *widget);
EAPI void elm_code_widget_selection_select_all(Evas_Object *widget);
/**
* @}
*/