@eht16 requested changes on this pull request.
Nice, thanks!
I added a few minor remarks. Additionally, could you please update the `MAINTAINERS` file in the root directory?
Thanks.
@@ -72,6 +72,7 @@ GP_CHECK_VIMODE
GP_CHECK_WEBHELPER GP_CHECK_WORKBENCH GP_CHECK_XMLSNIPPETS +GP_CHECK_INCDEC
As the rest of the list is sorted alphabetically, could you move your plugin after `GP_CHECK_GITCHANGEBAR`?
- gtk_container_add(GTK_CONTAINER(geany->main_widgets->editor_menu), plugin_data._menu_item_sep);
+ + plugin_data._menu_item_change_number = gtk_menu_item_new_with_mnemonic(_("_Increment or Decrement number")); + gtk_container_add(GTK_CONTAINER(geany->main_widgets->editor_menu), plugin_data._menu_item_change_number); + + configuration_apply(); + + g_signal_connect(plugin_data._menu_item_change_number, "activate", G_CALLBACK(on_change_number_x), NULL); +} + + +void plugin_cleanup (void) +{ + if (plugin_data._dialog) + { + gtk_widget_destroy (GTK_WIDGET (plugin_data._dialog));
Here and in some other places you use a space between identifier and opening braces, in other places not. I suggest to use a consistent style.
- keybindings_set_item (key_group, KB_DECREMENT_NUMBER, NULL, GDK_KEY_KP_Subtract, GDK_SHIFT_MASK,
+ "decrement_number", + _("Decrement Number By 1"), NULL); + keybindings_set_item (key_group, KB_INCREMENT_DECREMENT_NUMBER_X, NULL, GDK_KEY_KP_Multiply, GDK_SHIFT_MASK, + "increment_decrement_number_x", + _("Increment or Decrement Number X times"), NULL); + + plugin_data._menu_item_sep = gtk_separator_menu_item_new(); + gtk_container_add(GTK_CONTAINER(geany->main_widgets->editor_menu), plugin_data._menu_item_sep); + + plugin_data._menu_item_change_number = gtk_menu_item_new_with_mnemonic(_("_Increment or Decrement number")); + gtk_container_add(GTK_CONTAINER(geany->main_widgets->editor_menu), plugin_data._menu_item_change_number); + + configuration_apply(); + + g_signal_connect(plugin_data._menu_item_change_number, "activate", G_CALLBACK(on_change_number_x), NULL);
Here and in some other places, there is mixed indentation, sometimes spaces sometimes tabs. I suggest to use a consistent style.
+ /* when the number changes sign, the format is reset to avoid a display shift */ + if ((positive == FALSE && guessed_number >= 0) || (positive == TRUE && guessed_number < 0)) + { + format_length = 0; + } + else + { + format_length = digit_end - digit_start; + if (format_length > 12) + format_length = 0; + } + + g_snprintf(format_buf, sizeof(format_buf)-1, "%%0%d%c", format_length, use_hexa ? ( hexaCase == HEXA_CASE_UPPER ? 'X' : 'x' ) : 'd'); + + if ((buf = g_strdup_printf(format_buf, guessed_number)))
gcc warns here: ``` incdec-plugin.c: In function 'on_change_number': incdec-plugin.c:374:44: warning: format not a string literal, argument types not checked [-Wformat-nonliteral] 374 | if ((buf = g_strdup_printf(format_buf, guessed_number))) | ^~~~~~~~~~ ``` Maybe this can be fixed.