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

The bgcolor of selected text in highlighted search keyword is not different from the highlight color #43928

Open
mercury233 opened this issue Feb 18, 2018 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member help wanted Issues identified as good community contribution opportunities search Search widget and operation issues
Milestone

Comments

@mercury233
Copy link

Issue Type

Bug

Description

Steps to reproduce:

  1. search some keyword in the left search panel
  2. click on one search result
  3. the keyword is highlighted
  4. select some word in the highlighted text

I want the bgcolor of selected text differ from highlighted color, but it is the same.
image
(in this pic, "COUNT" is selected)

Note that this issue only occur when I open the file from search panel, and only occur on the highlight of search result I clicked.
image
(the second highlight works fine)

I tried 4 color themes, all reproduced this issue.

VS Code Info

VS Code version: Code 1.20.1 (f88bbf9, 2018-02-13T15:34:36.336Z)
OS version: Windows_NT x64 6.1.7601

System Info
Item Value
CPUs Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz (4 x 3292)
Memory (System) 7.96GB (3.77GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe F:\Works\ygopro-scripts
Screen Reader no
VM 0%
Extensions (1)
Extension Author (truncated) Version
vscode-eslint dba 1.4.5
Reproduces without extensions
@alexdima
Copy link
Member

The search viewlet uses currentFindMatch, which is consistent with what the find wiget does when selecting a find result... But the find widget clears the decoration to a regular findMatch once the selection moves, while the search viewlet does not:

image

@alexdima alexdima assigned roblourens and unassigned alexdima Feb 26, 2018
@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues labels Mar 7, 2018
@roblourens roblourens added the help wanted Issues identified as good community contribution opportunities label Jul 11, 2018
@roblourens
Copy link
Member

@sandy081 do you have an idea how to do this? I think we just want to reset the "selected" row when selection moves in the editor. I thought it looked easy, but we just have an ITextModel, and I am not sure what the recommended way is to associate that model with an open editor.

@roblourens roblourens added this to the Backlog Candidates milestone Oct 27, 2019
@sandy081
Copy link
Member

You need to have access to ICodeEditor to track the position changes and reset the decorations. You can get the code editor from active editor. For eg:

const activeControl = this.editorService.activeControl;
		const activeCodeEditor = activeControl ? withNullAsUndefined(getCodeEditor(activeControl.getControl())) : undefined;

If you do not want to listen to position changes, how about resetting it when Search is focused out?

@ibraheemsaoud
Copy link

idk if this can help you fix this issue, but if I add a character on the same line before the search highlight, the selected text gets the correct highlight.

@andreamah andreamah assigned andreamah and unassigned roblourens Dec 15, 2022
@andreamah
Copy link
Contributor

andreamah commented Dec 5, 2023

image

This seems to be resolved already in the latest version.

@andreamah andreamah modified the milestones: Backlog, December 2023 Dec 5, 2023
@mercury233
Copy link
Author

This seems to be resolved already in the latest version.

Do you mean the latest version which isn't released yet? I'm using

Version: 1.84.2 (user setup)
Commit: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
Date: 2023-11-09T10:51:52.184Z

and this problem seems exist

@diminutivesloop
Copy link
Contributor

I'm also still seeing this on the latest Insiders version.

Version: 1.85.0-insider (Universal)
Commit: c46c2f120b96f1d538333b263e42d1f133a200f0

@andreamah In your screenshot it looks like the result you're selecting text from wasn't first selected from the search results panel which is part of the repro steps.

Note that this issue only occur when I open the file from search panel, and only occur on the highlight of search result I clicked.

@lcmartinezdev
Copy link

Could it be a specific theme bug?

@andreamah
Copy link
Contributor

I think I accidentally also had a highlight from the find widget also. Reopening.

@andreamah andreamah reopened this Dec 6, 2023
@andreamah andreamah removed this from the December 2023 milestone Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member help wanted Issues identified as good community contribution opportunities search Search widget and operation issues
Projects
None yet
Development

No branches or pull requests

9 participants