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

New search editor should be pre-filled with selected text when pressing Ctrl + Shift + F #116093

Closed
Merlin2001 opened this issue Feb 8, 2021 · 8 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders search Search widget and operation issues search-editor verified Verification succeeded
Milestone

Comments

@Merlin2001
Copy link

Merlin2001 commented Feb 8, 2021

I've been using the new "search.mode": "newEditor" setting as default lately and realized that it differs in an important way from "search.mode": "view":
In contrast to the search view, the search editor is not initialized with the selected text when pressing Ctrl + Shift + F.

Even more inconsistently, when setting "search.mode": "reuseEditor" the re-used editor is initialized with the selection (even ignoring the seedSearchStringFromSelection setting).

I think they should behave the same and potentially take into consideration #20768 so that Ctrl + F also behaves consistently.

I tested all combinations and they're a little inconsistent 🙈:

Pre-fill behavior legend:
0: Not pre-filled at all
1: Pre-filled with selection only
2: Pre-filled with selection or word the cursor is currently at (as criticized in #20768)

|  shortcut          |  seed..Selection |  search.mode  |  pre-fill behavior  |
|--------------------|------------------|---------------|---------------------|
|  Ctrl + F          |  false           |  irrelevant   |         0           |
|  Ctrl + F          |  true            |  irrelevant   |         2           |
|--------------------|------------------|---------------|---------------------|
|  Ctrl + Shift + F  |  false           |  view         |         0           |
|  Ctrl + Shift + F  |  false           |  reuseEditor  |         1 (!)       |
|  Ctrl + Shift + F  |  false           |  newEditor    |         0           |
|--------------------|------------------|---------------|---------------------|
|  Ctrl + Shift + F  |  true            |  view         |         1           |
|  Ctrl + Shift + F  |  true            |  reuseEditor  |         1           |
|  Ctrl + Shift + F  |  true            |  newEditor    |         0 (!)       |
@JacksonKearl
Copy link
Contributor

Thanks for the detailed report!

|  Ctrl + Shift + F  |  true            |  newEditor    |         0 (!)       |

This is a duplicate of #115633 and is fixed in Insiders.

|  Ctrl + Shift + F  |  false           |  reuseEditor  |         1 (!)       |

This is a bug. (and I suspect false/newEditor may behave incorrectly here Insiders too now)

@JacksonKearl JacksonKearl added bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues search-editor labels Feb 8, 2021
@JacksonKearl
Copy link
Contributor

JacksonKearl commented Feb 11, 2021

Fixed

|  Ctrl + Shift + F  |  false           |  reuseEditor  |         1 (!)       |

Left

|  Ctrl + Shift + F  |  false           |  newEditor  |         1 (!)       |

as-is, as there's no data loss to the new editor having a prefilled query.

@ghiscoding
Copy link

wow seriously, I know this new bug is a little frustrating (I see it too and that is why I'm tracking this issue) but wow just calm down, this is an Open Source project, if you want this bug fix then pull up your sleeves and fix it and stop bashing at the VSCode team. You're not paying a single penny for it, so why are you writing such harsh message?? As an Open Source library maintainer, I see message like yours and it just makes me want to quit sometime... the least you could do is be polite and wait for a fix, especially since you didn't pay neither contribute to the project... or just move to a paid software where you can expect more.

@JacksonKearl
Copy link
Contributor

@AndrewDavis I understand your compliant and I'm sorry you had trouble with this. To clarify: this feature was newly released last iteration (1.53.0) as an opt-in to different search modes. One of those modes (newEditor) did not behave the same as the existing default when text was selected in the editor. This was fixed in Insiders and will be fixed in Stable in 1-2 weeks.

Based on your comments it appears that you opted-into this new behavior by setting the search.mode setting away from its default, the new behavior did not match your expectations, and opting back out by resetting the setting to its default value resolved this issue, is this correct?

I ask because it is not clear to me if you perhaps set this setting then forgot about it, or if this somehow got enabled by default -- the latter would be a severe bug I would need to look more in to, but I have not heard of any cases of that happening.

@meganrogge meganrogge added the verified Verification succeeded label Feb 25, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders search Search widget and operation issues search-editor verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants
@ghiscoding @JacksonKearl @Merlin2001 @meganrogge and others