Open FichteFoll opened 8 years ago
Related (albeit the opposite), a request to have the history for the two panels independent: https://github.com/SublimeTextIssues/Core/issues/798
I think #798 is not opposite. This issue is about "Find" (Ctrl+F) and "Replace" (Ctrl+H) panels.
@AndreyMZ I feel that it is still potentially relevant, in the sense that, there is some crossover when moving from the "Find" or "Replace" panel to the "Find in Files" panel. For example, if you had independent settings, would you expect, when switching to the "Find in Files" panel from "Find" or "Replace", that the settings would be copied across with the search pattern/text or not?
Now:
On #798 I expect that when we switch from "Find" or "Replace" to "Find in Files" (or back from "Find in Files" to "Find" or "Replace"), nothing is copied across. I do not care if the find pattern is overridden by the text selected or not.
On this issue I believe @FichteFoll expects that when we switch from "Find" to "Replace" (or back from "Replace" to "Find") and some text is selected in the file editor, everything possible is copied across and the find pattern is NOT overridden by the text selected.
The culprit is ST performing a search run with the entered "find" pattern, when switching panels (Find <-> Replace <-> Find in Files). What we see in the new panel is the result of that search.
@wbond Hence I would mark that an issue rather an enhancement.
Steps to reproduce
Here is a forum post about it: https://forum.sublimetext.com/t/local-search-query-doesnt-carry-over-to-global-search/16128
... but instead using the current selection in the document when opening the new panel.
This comment from from the forum narrows down the reason for the described behavior more clearly. While picking up the current selection when pressing ctrl+f, ctrl+h or ctrl+shift+h is a helpful feature, it should propably be disabled if a search panel is already open and is focused.
If the caret is within one of the input fields of a find/replace panel, there is nothing new to pick up when switching to another panel. This is the one and only situation the content of the search field should remain unchanged.
Same here. https://forum.sublimetext.com/t/usability-issue-find-ui-looses-previously-entered-value/51927 Version 3.2.1, Build 3207
Summary
It happens quite frequently that I open the find panel, I modify the find pattern and later realize that I need to do a replace action. So I open the replace panel but the find pattern I already entered is lost, which is quite annoying. Instead, the pattern should be taken over if the find panel was open already.
Steps to reproduce
Desired behavior
The "Find What:" field takes over the pattern from the previously opened find panel.
Actual behavior
The "Find What:" field gets filled with the current selection in the view.