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

support for multi-part file extensions like *.test.js #2252

Merged
merged 5 commits into from
Dec 1, 2022

Conversation

mrjones2014
Copy link
Contributor

Description

Updates code used to get icons from nvim-web-devicons to pass the filename as well as extension.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list relevant details about your configuration

Set up nvim-web-devicons with configuration:

require('nvim-web-devicons').setup({
  override = {
    ['js'] = {
      icon = '',
      color = '#efd81d',
      cterm_color = '220',
      name = 'Js',
    },
    ['test.js'] = {
      icon = '',
      color = '#ffca28',
      cterm_color = '220',
      name = 'TestJavascript',
    },
  },
})

Then create a *.js and a *.test.js file, and open :Telescope find_file, and make sure the icons appear as configured.

Configuration:

  • Neovim version (nvim --version):
  • Operating system and version:

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

lua/telescope/utils.lua Outdated Show resolved Hide resolved
lua/telescope/utils.lua Outdated Show resolved Hide resolved
Copy link
Member

@Conni2461 Conni2461 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks :)

@DasGandlaf if you want to improve on this, with what you said here #2235 (comment), feel free to open a new PR. Thanks :)

@Conni2461 Conni2461 merged commit f37c603 into nvim-telescope:master Dec 1, 2022
@numToStr
Copy link

numToStr commented Dec 2, 2022

FYI, this completely breaks the icons, at least for me. For example, app.component.html and app.component.ts no longer show html and typescript file icon to them respectively, which was not the case before this PR.

@Conni2461
Copy link
Member

uff, does #2256 help?

@numToStr
Copy link

numToStr commented Dec 2, 2022

@Conni2461 Thanks a ton! It does fix the issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants