This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository edi.
View the commit online.
commit 16109aca6632ace33b83d89d90e00e005e6c4631
Author: Alastair Poole <[email protected]>
AuthorDate: Fri Apr 24 13:07:21 2026 +0100
mainview: Add select all API and connect it.
---
src/bin/edi_main.c | 8 ++++++++
src/bin/editor/edi_editor.c | 4 ++++
src/bin/mainview/edi_mainview.c | 9 ++++++++-
src/bin/mainview/edi_mainview.h | 7 +++++++
src/bin/mainview/edi_mainview_panel.c | 34 ++++++++++++++++++++++++++++++++++
src/bin/mainview/edi_mainview_panel.h | 9 +++++++++
6 files changed, 70 insertions(+), 1 deletion(-)
diff --git a/src/bin/edi_main.c b/src/bin/edi_main.c
index 5accc73..e1433ef 100644
--- a/src/bin/edi_main.c
+++ b/src/bin/edi_main.c
@@ -1120,6 +1120,13 @@ _edi_menu_paste_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
edi_mainview_paste();
}
+static void
+_edi_menu_select_all_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ edi_mainview_select_all();
+}
+
static void
_edi_menu_find_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
@@ -1398,6 +1405,7 @@ _edi_menu_setup(Evas_Object *win)
elm_menu_item_add(menu, menu_it, edi_theme_icon_path_get("edit-cut"), _("Cut"), _edi_menu_cut_cb, NULL);
elm_menu_item_add(menu, menu_it, edi_theme_icon_path_get("edit-copy"), _("Copy"), _edi_menu_copy_cb, NULL);
elm_menu_item_add(menu, menu_it, edi_theme_icon_path_get("edit-paste"), _("Paste"), _edi_menu_paste_cb, NULL);
+ elm_menu_item_add(menu, menu_it, edi_theme_icon_path_get("edit-select-all"), _("Select All"), _edi_menu_select_all_cb, NULL);
elm_menu_item_separator_add(menu, menu_it);
elm_menu_item_add(menu, menu_it, edi_theme_icon_path_get("edit-find-replace"), _("Find & Replace"), _edi_menu_find_cb, NULL);
elm_menu_item_add(menu, menu_it, edi_theme_icon_path_get("edit-find"), _("Find file"), _edi_menu_findfile_cb, NULL);
diff --git a/src/bin/editor/edi_editor.c b/src/bin/editor/edi_editor.c
index 6992cfa..21cdc2c 100644
--- a/src/bin/editor/edi_editor.c
+++ b/src/bin/editor/edi_editor.c
@@ -927,6 +927,10 @@ _smart_cb_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
{
edi_mainview_goto_popup_show();
}
+ else if (!strcmp(ev->key, "a"))
+ {
+ edi_mainview_select_all();
+ }
else if (!strcmp(ev->key, "n"))
{
edi_mainview_item_next();
diff --git a/src/bin/mainview/edi_mainview.c b/src/bin/mainview/edi_mainview.c
index 1ddfa02..7dc919e 100644
--- a/src/bin/mainview/edi_mainview.c
+++ b/src/bin/mainview/edi_mainview.c
@@ -394,6 +394,14 @@ edi_mainview_paste()
edi_mainview_panel_paste(_current_panel);
}
+void
+edi_mainview_select_all()
+{
+ if (edi_mainview_is_empty()) return;
+
+ edi_mainview_panel_select_all(_current_panel);
+}
+
void
edi_mainview_search()
{
@@ -623,4 +631,3 @@ edi_mainview_add(Evas_Object *parent, Evas_Object *win)
elm_box_horizontal_set(parent, EINA_TRUE);
edi_mainview_panel_append();
}
-
diff --git a/src/bin/mainview/edi_mainview.h b/src/bin/mainview/edi_mainview.h
index 20bdb32..e377c4b 100644
--- a/src/bin/mainview/edi_mainview.h
+++ b/src/bin/mainview/edi_mainview.h
@@ -205,6 +205,13 @@ void edi_mainview_copy();
*/
void edi_mainview_paste();
+/**
+ * Select all content in the current view.
+ *
+ * @ingroup Content
+ */
+void edi_mainview_select_all();
+
/**
* Search the current view's contents.
*
diff --git a/src/bin/mainview/edi_mainview_panel.c b/src/bin/mainview/edi_mainview_panel.c
index d64b12e..974f1a4 100644
--- a/src/bin/mainview/edi_mainview_panel.c
+++ b/src/bin/mainview/edi_mainview_panel.c
@@ -1014,6 +1014,40 @@ edi_mainview_panel_paste(Edi_Mainview_Panel *panel)
elm_code_widget_selection_paste(editor->entry);
}
+void
+edi_mainview_panel_select_all(Edi_Mainview_Panel *panel)
+{
+ Edi_Editor *editor;
+ Elm_Code *code;
+ Elm_Code_Line *line;
+ unsigned int row, length;
+
+ if (!panel || !panel->current)
+ return;
+
+ editor = (Edi_Editor *)evas_object_data_get(panel->current->view, "editor");
+ if (!editor)
+ return;
+
+ code = elm_code_widget_code_get(editor->entry);
+ if (!code)
+ return;
+
+ row = elm_code_file_lines_get(code->file);
+ if (row <= 0)
+ return;
+
+ line = elm_code_file_line_get(code->file, row);
+ if (!line)
+ return;
+
+ length = elm_code_widget_line_text_column_width_get(editor->entry, line) + 1;
+
+ elm_code_widget_selection_start(editor->entry, 1, 1);
+ elm_code_widget_selection_end(editor->entry, row, length);
+ elm_object_focus_set(editor->entry, EINA_TRUE);
+}
+
void
edi_mainview_panel_search(Edi_Mainview_Panel *panel)
{
diff --git a/src/bin/mainview/edi_mainview_panel.h b/src/bin/mainview/edi_mainview_panel.h
index 0bfe6f6..2726044 100644
--- a/src/bin/mainview/edi_mainview_panel.h
+++ b/src/bin/mainview/edi_mainview_panel.h
@@ -273,6 +273,15 @@ void edi_mainview_panel_copy(Edi_Mainview_Panel *panel);
*/
void edi_mainview_panel_paste(Edi_Mainview_Panel *panel);
+/**
+ * Select all content in the current view.
+ *
+ * @param panel the mainview panel context
+ *
+ * @ingroup Content
+ */
+void edi_mainview_panel_select_all(Edi_Mainview_Panel *panel);
+
/**
* Search the current view's contents.
*
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.