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

Search results not in monospace font #5192

Closed
jhasse opened this issue Apr 12, 2016 · 15 comments
Closed

Search results not in monospace font #5192

jhasse opened this issue Apr 12, 2016 · 15 comments
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code search Search widget and operation issues ux User experience issues
Milestone

Comments

@jhasse
Copy link
Contributor

jhasse commented Apr 12, 2016

The preview of lines in the search results aren't using a monospace font. Syntax highlighting would also be great.

This is what it currently looks like:

unbenannt

This is a quick mock-up I've made:

unbenannt

@egamma egamma added the feature-request Request for new features or functionality label Apr 13, 2016
@egamma
Copy link
Member

egamma commented Apr 13, 2016

@jrieken @bgashler1 fyi

@felixfbecker
Copy link
Contributor

The search query itself should also use a monospaced font. In the end, you are searching in code, so you write code inside this text box and it should be formatted like code. It is very hard to write complex regexps with a non-monospaced font.

@bgashler1 bgashler1 added the ux User experience issues label Jul 20, 2016
@atombender
Copy link

Any progress on this? I'm continually squinting at the tiny search panel.

Also: Syntax highlighting both in the search field and the matches. Regular expressions should have a grammar for groups and other non-literals. And search results should be syntax-highlighted just like the editor.

Also: Maybe do something to make the file name sections a bit more prominent. There's no distinction between a file name and the subsequent match within a file, since they are all rendered in the same font and colour, and it gets muddled. A slightly different background colour would help a lot.

@sandy081 sandy081 added this to the Backlog milestone Dec 7, 2016
@sandy081 sandy081 added the search Search widget and operation issues label Dec 7, 2016
@sandy081 sandy081 assigned sandy081 and unassigned sandy081 Dec 4, 2017
@esutton
Copy link

esutton commented Mar 6, 2018

+1

Supporting comment color in query results would be very helpful to find results in code rather than in comments or visa versa.

color

@lehni
Copy link

lehni commented Apr 17, 2018

You can achieve this with the Custom CSS and JS Loader extension:

.search-view .input,
.search-view .match {
  font-family: Menlo, Monaco, 'Courier New', monospace !important;
}

@josalhor
Copy link

If this is ever gets implemented (I hope so) the quick search and the search in the left sidebar should be treated equally.

vsudviw

It worries me a little that it may reduce the amount of text it fits before overflowing. Should it be a little larger? Specially on large screens.

@roblourens
Copy link
Member

We tried this in the past, also in similar places like the "find all references" peek view, it was very divisive and most people considered it ugly. One problem is that you have monospace code mixed in with non-monospace file names/paths, another is that it will never be syntax highlighted, this is not possible with the way search currently works, and monospaced but non-highlighted code looks bad. And finally the search widget just isn't a place optimized for reading code. Some day we will show search results in an editor and hopefully that will look nicer for you.

@roblourens roblourens added the *out-of-scope Posted issue is not in scope of VS Code label Oct 9, 2019
@atombender
Copy link

it was very divisive

So make it configurable?

@Salamandar
Copy link

I don't even understand why you closed this issue.

@lehni
Copy link

lehni commented Apr 1, 2020

It seems strange to me that VSCode is opinionated about something being ugly, where it leaves such decisions to the users in all other places. Mixing monospaced fonts with non-monospaced ones isn't ugly, it's a visual hierarchy that makes it clear what the different texts are: One is code, and one is a UI element describing where this code is from. Also, monospaced fonts not being syntax highlighted isn't necessarily a problem. It still makes it clear that what you're looking at is part from your code document, and hence it's using the same font. It's a visual clue that helps the eye parse the information it is looking at faster. And as such, it does make a whole lot of sense.

@lehni
Copy link

lehni commented Apr 1, 2020

Having said that, I now use the Customize UI extension with this setting to achieve what I want:

"customizeUI.stylesheet": {
  ".search-widget textarea, .find-widget textarea, .search-view .results .match": "font-family: Menlo, Monaco, 'Courier New', monospace !important"
}

And here how this looks in action (using Akkurat Mono by Lineto.com, my all time favorite coding font):

image

@karlhorky
Copy link

Some day we will show search results in an editor and hopefully that will look nicer for you

FYI, in case this is useful to anyone, the part from @roblourens' quote above about "show search results in an editor" can now be accomplished with the "Search Editor" feature (just like in Sublime Text):

https://code.visualstudio.com/updates/v1_43#_search-editors

@doivosevic
Copy link

Having said that, I now use the Customize UI extension with this setting to achieve what I want:

"customizeUI.stylesheet": {
  ".search-widget textarea, .find-widget textarea, .search-view .results .match": "font-family: Menlo, Monaco, 'Courier New', monospace !important"
}

And here how this looks in action (using Akkurat Mono by Lineto.com, my all time favorite coding font):

image

Does this still work with the same selector? I cannot get it to work on my machine

@lehni
Copy link

lehni commented Feb 20, 2021

@doivosevic I just checked, it still works for me.

@a1031
Copy link

a1031 commented May 23, 2022

Having said that, I now use the Customize UI extension with this setting to achieve what I want:

"customizeUI.stylesheet": {
  ".search-widget textarea, .find-widget textarea, .search-view .results .match": "font-family: Menlo, Monaco, 'Courier New', monospace !important"
}

@lehni This works perfectly, thanks!

How did you find the classnames for the search field UI elements? I'd like to also apply the style to the files to include and files to exclude textareas:

Screen Shot 2022-05-22 at 8 46 30 PM

I tried using these class names found in the vscode.dev online editor, but none of them worked:

  • .search-widgets-container textarea
  • .query-details textarea
  • .file-types textarea

@microsoft microsoft locked as resolved and limited conversation to collaborators May 23, 2022
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 *out-of-scope Posted issue is not in scope of VS Code search Search widget and operation issues ux User experience issues
Projects
None yet
Development

No branches or pull requests