diff --git a/data/geany.glade b/data/geany.glade index 26a0fc90..153dbee9 100644 --- a/data/geany.glade +++ b/data/geany.glade @@ -1405,23 +1405,6 @@ 3 - - - Enter in replace window activates Replace & Find - False - True - True - False - Enter in replace window activates Replace & Find instead of Replace - True - True - - - False - False - 4 - - diff --git a/doc/geany.txt b/doc/geany.txt index 090efc01..4267a7f9 100644 --- a/doc/geany.txt +++ b/doc/geany.txt @@ -1891,9 +1891,6 @@ Use the current file's directory for Find in Files active file. When this option is disabled, the directory of the last use of the Find in Files dialog is used. See `Find in Files`_ for details. -Enter in replace window performs Replace & Find instead of Replace - Select Replace & Find as default action when pressing enter in Replace dialog. - Projects ```````` @@ -2612,6 +2609,11 @@ extract_filetype_regex Regex to extract filetype name from file S via capture group one. **Search related** find_selection_type See `Find selection`_. 0 immediately +**Replace related** +replace_and_find_by_default Set ``Replace & Find`` button as default so + it will be activated when the Enter key is + pressed while one of the text fields has + focus. false immediately **Build Menu related** number_ft_menu_items The maximum number of menu items in the 2 on restart filetype section of the Build menu. diff --git a/src/keyfile.c b/src/keyfile.c index 8953401f..61b61770 100644 --- a/src/keyfile.c +++ b/src/keyfile.c @@ -227,6 +227,8 @@ static void init_pref_groups(void) "find_selection_type", GEANY_FIND_SEL_CURRENT_WORD); stash_group_add_string(group, &file_prefs.extract_filetype_regex, "extract_filetype_regex", GEANY_DEFAULT_FILETYPE_REGEX); + stash_group_add_boolean(group, &search_prefs.replace_and_find_by_default, + "replace_and_find_by_default", FALSE); /* Note: Interface-related various prefs are in ui_init_prefs() */ diff --git a/src/search.c b/src/search.c index fdd42448..33c45d37 100644 --- a/src/search.c +++ b/src/search.c @@ -192,9 +192,6 @@ static void init_prefs(void) "pref_search_always_wrap", FALSE, "check_hide_find_dialog"); stash_group_add_toggle_button(group, &search_prefs.use_current_file_dir, "pref_search_current_file_dir", TRUE, "check_fif_current_dir"); - stash_group_add_toggle_button(group, &search_prefs.replace_entry_activates_replace_and_find, - "pref_search_replace_entry_activates_replace_and_find", FALSE, - "check_replace_entry_activates_replace_and_find"); stash_group_add_boolean(group, &find_dlg.all_expanded, "find_all_expanded", FALSE); stash_group_add_boolean(group, &replace_dlg.all_expanded, "replace_all_expanded", FALSE); /* dialog positions */ @@ -1376,7 +1373,7 @@ static void on_replace_entry_activate(GtkEntry *entry, gpointer user_data) { on_replace_dialog_response(NULL, - search_prefs.replace_entry_activates_replace_and_find ? GEANY_RESPONSE_REPLACE_AND_FIND : GEANY_RESPONSE_REPLACE, + search_prefs.replace_and_find_by_default ? GEANY_RESPONSE_REPLACE_AND_FIND : GEANY_RESPONSE_REPLACE, NULL); } diff --git a/src/search.h b/src/search.h index e7c5c13c..bdb01123 100644 --- a/src/search.h +++ b/src/search.h @@ -61,7 +61,7 @@ typedef struct GeanySearchPrefs gboolean use_current_word; /**< Use current word for default search text */ gboolean use_current_file_dir; /* find in files directory to use on showing dialog */ gboolean hide_find_dialog; /* hide the find dialog on next or previous */ - gboolean replace_entry_activates_replace_and_find; /* enter in replace entry does Replace & Find */ + gboolean replace_and_find_by_default; /* enter in replace window performs Replace & Find instead of Replace */ enum GeanyFindSelOptions find_selection_type; } GeanySearchPrefs;