New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search: sometimes the search text changes at random #41156
Comments
You didn't use the editor find widget somewhere in there? Was just the text "prepare" selected in the editor at some point? |
@roblourens wow yeah looks like that's it! When I have the find widget opened and I click into the search viewlet, the text changes to the contents of the find widget. Did we add this on purpose? |
The weird thing however is that this seemed to happen while focus was in the search viewlet and not in the editor. I still think my steps from the bug description should never trigger this. |
@roblourens I take it back, it just happened again. No find widget was opened, the search input field changed its value right after I checked the search options. This is crazy :-/ |
I see that too. It replaces the current text in the search viewlet with the last text that was in the find widget (also if that is now closed). It does that when I click in the search viewlet's search text field or that text field's toggle buttons. |
Well @bpasero might still be describing the same thing though. You can see this like
One problem is that the search viewlet is not writing to the global search buffer, so it may think the global buffer text is newer even after searching in the search viewlet and restarting Code. Will fix that... |
You can set |
@roblourens imho changing the text in the search viewlet when it gets focus is not correct as long as a search is running or was running. Consider this scenario:
=> the search viewlet text gets replaced with what I searched in Chrome All in all I find the automatic population of the search viewlet based on that find buffer too aggressive. Maybe the option should be disabled by default. |
The scenario you describe is exactly how it is supposed to work. I am thinking that it should be disabled too, I've found it more annoying than useful. |
Added |
I still think this "feature" is fundamentally broken in that it would change either the global search input field or the find input field in the editor quite randomly by just moving focus into: Imagine I setup a very complicated search pattern and then it suddenly gets removed without me doing anything? |
That's what the feature is though. This is only when you have it enabled with the setting. And you can retrieve the previous value from the alt+up history Have had a couple of these lately though - #42724 |
I would maybe accept this to happen if the search input is empty, but not when I am in the middle of a search that shows results. How as a user do you even understand that the input was changed automatically and the results below no longer match? |
You're seeing that it's disabled by default for the search viewlet now though, right? Otherwise they'll only see that if they've opted into it. |
…en search.globalFindClipboard is enabled
@roblourens yeah it is disabled by default, at least for the global search, I was testing with the option turned on explicitly. |
It could be weird that the search viewlet shows results that don't match the query text but I wouldn't want to clear them or anything. |
I'm going to consider this resolved unless you have any other suggestion. |
@roblourens maybe we take this to a UX meeting |
Will bring it up in a UX meeting after my vacation, didn't have time this month. |
@bpasero Do you still want to discuss more? We can take it to this week's UX meeting. I won't say this isn't a weird feature, but we do match Sublime, etc as close as we can. Implementing it a different way probably wouldn't help the people who do want it. Would like to hear any suggestions you have. |
@roblourens I think its fine as long as the default is that it is disabled. I am probably not a good candidate for talking how I would expect this feature to work because I am not using it actually and I also do not find it useful for my personal workflows. I guess what I always found unexpected was that switching between editor find widget and search viewlet was changing the search input text as soon as focus was going in. I believe Sublime (and others?) might not have this issue because they reuse the same input boxes for editor search and global search. |
That's true. With Sublime you can do something similar when switching between apps.
|
@roblourens I would argue that is a different scenario though because you are leaving the application, copy something to the find clipboard elsewhere and then come back. I would never expect this behaviour from within the application. I think this feature is meant for the case where you come from another application and changed the find clipboard. |
I am recently seeing an issue where my search text randomly changes to something else. Steps I did (not reproducible):
=> when I clicked on "match words", my initial search word ("prepareActions") changed to "prepare"
/cc @rebornix if this could be related to the macOS search buffer clipboard support that we added in 1.19
The text was updated successfully, but these errors were encountered: