Branch: refs/heads/master Author: Nick Treleaven ntrel002@gmail.com Committer: GitHub noreply@github.com Date: Sat, 25 Feb 2023 17:17:37 UTC Commit: 2509e21526d36034f5251381a76555e7300fbfc0 https://github.com/geany/geany/commit/2509e21526d36034f5251381a76555e7300fbf...
Log Message: ----------- Tweak Join Lines command (#3402)
* Add Format->Join Lines menu item
* Don't require reflow column width for Join Lines
Fixes #1591.
* Document Join Lines
Modified Paths: -------------- data/geany.glade doc/geany.txt src/callbacks.c src/keybindings.c
Modified: data/geany.glade 9 lines changed, 9 insertions(+), 0 deletions(-) =================================================================== @@ -6867,6 +6867,15 @@ <child type="submenu"> <object class="GtkMenu" id="menu_format1_menu"> <property name="can-focus">False</property> + <child> + <object class="GtkMenuItem" id="join_lines1"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes">_Join Lines</property> + <property name="use-underline">True</property> + <signal name="activate" handler="on_join_lines1_activate" swapped="no"/> + </object> + </child> <child> <object class="GtkMenuItem" id="reflow_lines_block1"> <property name="visible">True</property>
Modified: doc/geany.txt 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -3634,6 +3634,10 @@ Reflow lines/block Reformat selected line breaking lines at the long line marker or the line breaking column if line breaking is enabled for the current document. + +Join Lines Replace line endings and following indentation + with a single space throughout the selection + or current (indented) text block. =============================== ========================= ==================================================
Modified: src/callbacks.c 6 lines changed, 6 insertions(+), 0 deletions(-) =================================================================== @@ -1902,6 +1902,12 @@ static void on_go_to_previous_marker1_activate(GtkMenuItem *menuitem, gpointer u }
+static void on_join_lines1_activate(GtkMenuItem *menuitem, gpointer user_data) +{ + keybindings_send_command(GEANY_KEY_GROUP_FORMAT, GEANY_KEYS_FORMAT_JOINLINES); +} + + static void on_reflow_lines_block1_activate(GtkMenuItem *menuitem, gpointer user_data) { keybindings_send_command(GEANY_KEY_GROUP_FORMAT, GEANY_KEYS_FORMAT_REFLOWPARAGRAPH);
Modified: src/keybindings.c 12 lines changed, 2 insertions(+), 10 deletions(-) =================================================================== @@ -504,8 +504,8 @@ static void init_default_kb(void) add_kb(group, GEANY_KEYS_FORMAT_REFLOWPARAGRAPH, NULL, GDK_KEY_j, GEANY_PRIMARY_MOD_MASK, "format_reflowparagraph", _("_Reflow Lines/Block"), "reflow_lines_block1"); - keybindings_set_item(group, GEANY_KEYS_FORMAT_JOINLINES, NULL, - 0, 0, "edit_joinlines", _("Join lines"), NULL); + add_kb(group, GEANY_KEYS_FORMAT_JOINLINES, NULL, + 0, 0, "edit_joinlines", _("_Join Lines"), "join_lines1");
group = keybindings_get_core_group(GEANY_KEY_GROUP_INSERT);
@@ -2388,14 +2388,6 @@ static void join_paragraph(GeanyEditor *editor) { ScintillaObject *sci = editor->sci; gboolean sel; - gint column; - - column = get_reflow_column(editor); - if (column == -1) - { - utils_beep(); - return; - }
sci_start_undo_action(sci); sel = sci_has_selection(sci);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).