Git Product home page Git Product logo

Comments (6)

mmirus avatar mmirus commented on September 26, 2024 2

Thanks for the fixes! I've confirmed that I can't reproduce those bugs anymore.

Here's what I'm seeing now, using the same test config as before:

  hlgroups = {
    TSFunction = {fg = "${orange}"},
  },
  filetype_hlgroups = {
    yaml = {
      TSField = { fg = "${red}" },
    },
    javascript = {
      TSFunction = { fg = "${green}" },
    },
    php = {
      TSFunction = { fg = "${purple}" },
    },
    ruby = {
      TSFunction = { fg = "${blue}" },
    }
  },

First, syntax highlighting in Telescope's preview uses the highlight groups of the filetype in the buffer that was open when Telescope was called rather than the filetype of the file being previewed.

For example:

  • Given a JavaScript hlgroup that sets the TSFunction fg to green
  • And a Ruby hlgroup that sets the TSFunction fg to red
  • When I open a JS file
  • And then I open the Telescope file finder and preview a Ruby file
  • The function names in the preview window should be red, but are actually green

Demo:

filetype highlight group bug 2-2022-02-11_14 58 46-optimized

Second, if I switch to a buffer that uses the non-file-type-specific hl group (the orange one, above), and then back to one that matches a rule for a specific file type (e.g., PHP), the PHP file will use the generic color instead of the PHP color. If I then switch to a file that has a specific rule (e.g., JS) and back to PHP, the correct colors are shown.

Demo:

filetype highlight group bug-2022-02-11_14 49 36-optimized

from onedarkpro.nvim.

olimorris avatar olimorris commented on September 26, 2024 1

@mmirus I've fixed the two issues you spotted in the latest commit. Please let me know what you think.

The solution to the floating windows was to ignore specific filetypes and buffer types.

from onedarkpro.nvim.

olimorris avatar olimorris commented on September 26, 2024 1

That is some epic testing! Thanks so much. I shall see if I can resolve!

from onedarkpro.nvim.

olimorris avatar olimorris commented on September 26, 2024 1

Struggling to solve the Telescope previewer issues. Will open an issue on their side and ask for help. Seems Telescope reads the file asynchronously with vim.loop.fs_ and there is no way to detect when you preview a ruby then a js file.

Key question: how much of a nuisance would it be for you?

from onedarkpro.nvim.

mmirus avatar mmirus commented on September 26, 2024

You got it!

from onedarkpro.nvim.

mmirus avatar mmirus commented on September 26, 2024

It probably wouldn't be much of an issue initially, as I don't have many file type specific rules in mind. If that grew over time then it would become more likely for the preview to differ significantly in projects with multiple languages.

From my perspective it's a matter of preference for you if it's a blocker or not. Waiting to add the feature means folks have to accept the trade-off of not being able to do file type specific rules. Releasing it with this bug means they can choose whether they prefer limited highlighting or buggy previewing. Of course that could open you up to complaints. So it's just down to what you want to do!

from onedarkpro.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.