Skip to content
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

"Auto Find in Selection = never" is ignored #90170

Closed
rstarkov opened this issue Feb 6, 2020 · 15 comments
Closed

"Auto Find in Selection = never" is ignored #90170

rstarkov opened this issue Feb 6, 2020 · 15 comments
Assignees
Labels
feature-request Request for new features or functionality settings-editor VS Code settings editor issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@rstarkov
Copy link

rstarkov commented Feb 6, 2020

  • VSCode Version: 1.41.1
  • OS Version: Win10

Steps to Reproduce:

  1. Start code without extensions
  2. Double check that Auto Find in Selection is set to "never"
  3. Select two words
  4. Press Ctrl+F

Expected: "find in selection" is off

Actual: "find in selection" is on, meaning I'm going to find exactly one match. Moreover, "find in selection" is just always on. Even when there is no selection. In 1.37.1 the button was disabled when there was no selection. Now the button is always enabled, and always activated.

Does this issue occur when all extensions are disabled?: Yes

@vscodebot
Copy link

vscodebot bot commented Feb 6, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@rstarkov
Copy link
Author

rstarkov commented Feb 6, 2020

The most recent version in which this setting worked the way I'd expect it to is 1.39.2.

@rebornix rebornix added the under-discussion Issue is under discussion for relevance, priority, approach label Feb 10, 2020
@rebornix rebornix added this to the February 2020 milestone Feb 10, 2020
@xgdgsc
Copy link
Contributor

xgdgsc commented Feb 16, 2020

I also started noticing this annoying regression recently.

@xgdgsc
Copy link
Contributor

xgdgsc commented Feb 25, 2020

This seems only happens for me on win10, ubuntu doesn' t have this issue.

@rebornix
Copy link
Member

I didn't reproduce this issue on Windows or other platforms. Do you run into the same issue if you comment out all the settings temporarily?

@rebornix rebornix added the info-needed Issue requires more information from poster label Feb 27, 2020
@xgdgsc
Copy link
Contributor

xgdgsc commented Feb 27, 2020

Removing "editor.find.autoFindInSelection": true, from config works. Don' t remember when added that.

@rebornix
Copy link
Member

@xgdgsc thanks, it means our code is not backwards compatible, will look into why that happens, thanks!

@rebornix rebornix modified the milestones: February 2020, March 2020 Feb 27, 2020
@vscodebot vscodebot bot closed this as completed Mar 5, 2020
@vscodebot
Copy link

vscodebot bot commented Mar 5, 2020

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@rstarkov
Copy link
Author

rstarkov commented Mar 9, 2020

@rebornix did this get closed by mistake? I can confirm that this was exactly like xgdgsc described.

@Will-W
Copy link

Will-W commented Mar 10, 2020

I had the same issue, having never set this setting. Specifically:

Steps

  • editor.find.autoFindInSelection set to its default value (never)
  • Select a word (that appears multiple times on the page)
  • Press ctrl+f to bring up the find box

Expected:

  • Find in selection unchecked, and multiple results are found

Actual

  • Find in selection is checked, and only one result is found (because it's searching in the one word selection).

If I explicitly set the setting to any of the three values (multiline, never or always), I get the correct result (as I understand it). If I now reset the setting in the settings UI, I still get the correct behaviour.

@rebornix rebornix reopened this Mar 12, 2020
@rebornix rebornix removed the info-needed Issue requires more information from poster label Mar 12, 2020
@greggman
Copy link
Contributor

This is broken for me (although it's never worked for me). Wound up here looking for a solution

Here you can see nothing is selected. I press Cmd-F to find and search in selection is on. I turn it off, close the box., search again, it's back on. At the end I verify that auto-find-in-selection is set to never. I also testing with all extensions disabled.

ScreenFlow

@rebornix
Copy link
Member

rebornix commented Apr 2, 2020

Root cause: Settings Editor (UI) doesn't support raw value validation. Please check the JSON content of your settings, you can find editor.find.autoFindInSelection: true, removing it can solve the problem.

Internally in Editor, we will convert true to always thus it always take effect but the settings editor will not do validation/convert.

let idx = dataElement.setting.enum!.indexOf(dataElement.value);
if (idx === -1) {
idx = dataElement.setting.enum!.indexOf(dataElement.defaultValue);
if (idx === -1) {
idx = 0;
}
}

@rebornix rebornix added the settings-editor VS Code settings editor issues label Apr 2, 2020
@rebornix rebornix modified the milestones: March 2020, April 2020 Apr 2, 2020
@greggman
Copy link
Contributor

greggman commented Apr 3, 2020

Well I checked my settings.json and you're correct it was set to true even though the setting UI claimed it was set to "never". I did not set it to true so some flow from where I started to now VSCode made it true.

Let me also point out though that right after I made that video I noticed the "search in selection" icon in the search UI doesn't always match the behavior of search. There were several times the button was highlighted "search in select" and yet it was not searching in just the selection.

ScreenFlow

@TobiasSekan
Copy link

TobiasSekan commented Apr 9, 2020

Same here

1. Double left click a word, to mark it
2. Press Ctrl+F
3. Find in selection is always active (and is reactivated)

Option: never or 'multiline`

* Still present min. since Version 1.43
* Same in Version 1.44 from 09.04.2020

Oh 🙈 , I found the Problem on my PC

The user and workspace settings was not the same as the folder setting.

After correct this, it's work perfectly 👍

@roblourens
Copy link
Member

Added generic checks that a setting value matches its schema type. If there is a mismatch it will look like this:

image

@roblourens roblourens removed the under-discussion Issue is under discussion for relevance, priority, approach label Apr 9, 2020
@roblourens roblourens added feature-request Request for new features or functionality verification-needed Verification of issue is requested labels Apr 9, 2020
@connor4312 connor4312 added the verified Verification succeeded label Apr 29, 2020
@github-actions github-actions bot locked and limited conversation to collaborators May 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality settings-editor VS Code settings editor issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

8 participants