<p></p>
<p>I thought due to <a href="https://github.com/geany/geany/pull/2695#issuecomment-748722240" data-hovercard-type="pull_request" data-hovercard-url="/geany/geany/pull/2695/hovercard">this comment</a> the request for an option was dropped? I think all this started over not closing <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="770286561" data-permission-text="Title is private" data-url="https://github.com/geany/geany/issues/2693" data-hovercard-type="issue" data-hovercard-url="/geany/geany/issues/2693/hovercard" href="https://github.com/geany/geany/issues/2693">#2693</a> as a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="116938755" data-permission-text="Title is private" data-url="https://github.com/geany/geany/issues/758" data-hovercard-type="issue" data-hovercard-url="/geany/geany/issues/758/hovercard" href="https://github.com/geany/geany/issues/758">#758</a> and not reading the discussion there.</p>
<p>Key points (duplicated across issues):</p>
<ol>
<li>The goal of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="116938755" data-permission-text="Title is private" data-url="https://github.com/geany/geany/issues/758" data-hovercard-type="issue" data-hovercard-url="/geany/geany/issues/758/hovercard" href="https://github.com/geany/geany/issues/758">#758</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="770286561" data-permission-text="Title is private" data-url="https://github.com/geany/geany/issues/2693" data-hovercard-type="issue" data-hovercard-url="/geany/geany/issues/2693/hovercard" href="https://github.com/geany/geany/issues/2693">#2693</a> is to update the search text in the Find and Replace dialogs <strong>whenever <kbd>Ctrl</kbd>+<kbd>f</kbd> is pressed, rather than only the first time the dialogs are shown</strong>. This seems like a totally reasonable behaviour that most applications that have a Find feature do.</li>
<li>There was a misunderstanding in both issues where it was believed that the goal was to update the search text in the Find and Replace dialogs <strong>whenever the selection was changed</strong> (which would indeed be weird), thus prompting for a request about needing an option to turn this feature off.</li>
<li>It was clarified that the intention is <strong>1</strong> and not <strong>2</strong> so <strong>no option is needed</strong>.</li>
</ol>
<p>I assume this issue is a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="771718809" data-permission-text="Title is private" data-url="https://github.com/geany/geany/issues/2695" data-hovercard-type="pull_request" data-hovercard-url="/geany/geany/pull/2695/hovercard" href="https://github.com/geany/geany/pull/2695">#2695</a> because a PR is bound the branch on which it was created, and it <a href="https://github.com/geany/geany/pull/2695#issuecomment-748728322" data-hovercard-type="pull_request" data-hovercard-url="/geany/geany/pull/2695/hovercard">was suggested</a> to not use <code>master</code> branch for the PR (a good suggestion for future PRs but not really essential/required).</p>
<p>If the above summary is accurate, then all that's needed is a patch like this:</p>
<div class="highlight highlight-source-diff"><pre><span class="pl-c1">diff --git a/src/search.c b/src/search.c</span>
index 82682ae33..f45d7b477 100644
<span class="pl-md">--- a/src/search.c</span>
<span class="pl-mi1">+++ b/src/search.c</span>
<span class="pl-mdr">@@ -575,14 +575,16 @@</span> void search_show_find_dialog(void)
        }
        else
        {
<span class="pl-md"><span class="pl-md">-</span>          /* only set selection if the dialog is not already visible */</span>
<span class="pl-md"><span class="pl-md">-</span>          if (! gtk_widget_get_visible(find_dlg.dialog) && sel)</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>                if (sel != NULL)</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>                {</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>                        /* update the search text from current selection */</span>
                        gtk_entry_set_text(GTK_ENTRY(find_dlg.entry), sel);
<span class="pl-mi1"><span class="pl-mi1">+</span>                        /* reset the entry widget's background colour */</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>                        ui_set_search_entry_background(find_dlg.entry, TRUE);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>                }</span>
                gtk_widget_grab_focus(find_dlg.entry);
                set_dialog_position(find_dlg.dialog, find_dlg.position);
                gtk_widget_show(find_dlg.dialog);
<span class="pl-md"><span class="pl-md">-</span>          if (sel != NULL) /* when we have a selection, reset the entry widget's background colour */</span>
<span class="pl-md"><span class="pl-md">-</span>                  ui_set_search_entry_background(find_dlg.entry, TRUE);</span>
                /* bring the dialog back in the foreground in case it is already open but the focus is away */
                gtk_window_present(GTK_WINDOW(find_dlg.dialog));
        }
<span class="pl-mdr">@@ -751,11 +753,13 @@</span> void search_show_replace_dialog(void)
        }
        else
        {
<span class="pl-md"><span class="pl-md">-</span>          /* only set selection if the dialog is not already visible */</span>
<span class="pl-md"><span class="pl-md">-</span>          if (! gtk_widget_get_visible(replace_dlg.dialog) && sel)</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>                if (sel != NULL)</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>                {</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>                        /* update the search text from current selection */</span>
                        gtk_entry_set_text(GTK_ENTRY(replace_dlg.find_entry), sel);
<span class="pl-md"><span class="pl-md">-</span>          if (sel != NULL) /* when we have a selection, reset the entry widget's background colour */</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>                        /* reset the entry widget's background colour */</span>
                        ui_set_search_entry_background(replace_dlg.find_entry, TRUE);
<span class="pl-mi1"><span class="pl-mi1">+</span>                }</span>
                gtk_widget_grab_focus(replace_dlg.find_entry);
                set_dialog_position(replace_dlg.dialog, replace_dlg.position);
                gtk_widget_show(replace_dlg.dialog);
<span class="pl-mdr">@@ -1059,10 +1063,8 @@</span> void search_show_find_in_files_dialog_full(const gchar *text, const gchar *dir)
 
        if (!text)
        {
<span class="pl-md"><span class="pl-md">-</span>          /* only set selection if the dialog is not already visible, or has just been created */</span>
<span class="pl-md"><span class="pl-md">-</span>          if (doc && ! sel && ! gtk_widget_get_visible(fif_dlg.dialog))</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>                if (doc && ! sel)</span>
                        sel = editor_get_default_selection(doc->editor, search_prefs.use_current_word, NULL);
<span class="pl-md"><span class="pl-md">-</span></span>
                text = sel;
        }
        entry = gtk_bin_get_child(GTK_BIN(fif_dlg.search_combo));</pre></div>
<p>If that's the case, I propose to update the title and description of this PR and to force push a commit similar to above patch. I'm currently on vacation and will have time to merge this in the next days. <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/etkaar/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/etkaar">@etkaar</a> your work on this is appreciated!</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/2697#issuecomment-749156210">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ7CVXO34YCUINIOHMDSV6O4HANCNFSM4VD57AXA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAIOWJ4O2DBIYRTSSRPZU3DSV6O4HA5CNFSM4VD57AXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFSTTO4Q.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/2697#issuecomment-749156210",
"url": "https://github.com/geany/geany/pull/2697#issuecomment-749156210",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>