Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Fri, 06 Oct 2023 16:41:36 UTC Commit: 4089741340522053319969975cebba19c3fce52b https://github.com/geany/geany/commit/4089741340522053319969975cebba19c3fce5...
Log Message: ----------- Don't comment global content unless it is Conf
When using Tools->Config Files to open a user file that doesn't exist. This fixes the first line of geany.css being wrongly uncommented (and the rest unchanged) due to toggle comment being used and CSS not having a line comment.
(Verbatim copy-paste of Nick's description of the previous version of the patch, thanks :-)
Modified Paths: -------------- src/ui_utils.c
Modified: src/ui_utils.c 11 lines changed, 2 insertions(+), 9 deletions(-) =================================================================== @@ -2159,16 +2159,9 @@ static void on_config_file_clicked(GtkWidget *widget, gpointer user_data) g_file_get_contents(global_file, &global_content, NULL, NULL);
doc = document_new_file(utf8_filename, ft, global_content); - if (global_content) + if (global_content && doc->file_type->id == GEANY_FILETYPES_CONF) { - if (doc->file_type->id == GEANY_FILETYPES_CONF) - comment_conf_files(doc->editor->sci); - else - { - sci_select_all(doc->editor->sci); - keybindings_send_command(GEANY_KEY_GROUP_FORMAT, - GEANY_KEYS_FORMAT_COMMENTLINETOGGLE); - } + comment_conf_files(doc->editor->sci); sci_set_current_line(doc->editor->sci, 0); document_set_text_changed(doc, FALSE); sci_empty_undo_buffer(doc->editor->sci);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).