Giter Club home page Giter Club logo

Comments (3)

aretrosen avatar aretrosen commented on June 15, 2024 2

Hey, so I actually stumbled upon a pretty hacky but effective solution to this issue (and TBH, I'm kinda proud of myself for figuring it out, lol). Check it out:

custom_highlights = function(C)
  local cmpfn = require("catppuccin.groups.integrations.cmp")
  setfenv(cmpfn.get, { C = C })
  local cmp = cmpfn.get()
  for k, v in pairs(cmp) do
    if k:sub(8, 11) == "Kind" then
      cmp[k] = { bg = v.fg, fg = C.base }
    end
  end
  cmp["Folded"] = { bg = C.crust }
  return cmp
end

Basically, nothing to do manually any more. Anyway, thanks for the prompt response earlier. Closing this issue now.

from nvim.

mrtnvgr avatar mrtnvgr commented on June 15, 2024 1

It suppose that this commit removed global variables (C, O, U) from scope of integrations

from nvim.

nullchilly avatar nullchilly commented on June 15, 2024 1

Hi, you used our internal module which wasn't documented! Indeed, it was introduced in 836de8b as a way to fix our function cache.

Unfortunately, fixing this will introduce more complexity for me.

On the bright side, it's pretty easy to vim golf this with :'<,'>s/fg/fg = C.base, bg

image

The snippet below should gives the same behavior:

custom_highlights = function(C)
  return {
    Folded = { bg = C.crust },
    -- kind support
    CmpItemKindSnippet = { fg = C.base, bg = C.mauve },
    CmpItemKindKeyword = { fg = C.base, bg = C.red },
    CmpItemKindText = { fg = C.base, bg = C.teal },
    CmpItemKindMethod = { fg = C.base, bg = C.blue },
    CmpItemKindConstructor = { fg = C.base, bg = C.blue },
    CmpItemKindFunction = { fg = C.base, bg = C.blue },
    CmpItemKindFolder = { fg = C.base, bg = C.blue },
    CmpItemKindModule = { fg = C.base, bg = C.blue },
    CmpItemKindConstant = { fg = C.base, bg = C.peach },
    CmpItemKindField = { fg = C.base, bg = C.green },
    CmpItemKindProperty = { fg = C.base, bg = C.green },
    CmpItemKindEnum = { fg = C.base, bg = C.green },
    CmpItemKindUnit = { fg = C.base, bg = C.green },
    CmpItemKindClass = { fg = C.base, bg = C.yellow },
    CmpItemKindVariable = { fg = C.base, bg = C.flamingo },
    CmpItemKindFile = { fg = C.base, bg = C.blue },
    CmpItemKindInterface = { fg = C.base, bg = C.yellow },
    CmpItemKindColor = { fg = C.base, bg = C.red },
    CmpItemKindReference = { fg = C.base, bg = C.red },
    CmpItemKindEnumMember = { fg = C.base, bg = C.red },
    CmpItemKindStruct = { fg = C.base, bg = C.blue },
    CmpItemKindValue = { fg = C.base, bg = C.peach },
    CmpItemKindEvent = { fg = C.base, bg = C.blue },
    CmpItemKindOperator = { fg = C.base, bg = C.blue },
    CmpItemKindTypeParameter = { fg = C.base, bg = C.blue },
    CmpItemKindCopilot = { fg = C.base, bg = C.teal },
  }
end

from 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.