Giter Club home page Giter Club logo

Comments (4)

alex-courtis avatar alex-courtis commented on August 16, 2024 1

That would be great.

Let's use a setter set_icon_by_filetype please instead of exposing the internals.

Confirmed: no action will be needed in the case of colourscheme change etc.

from nvim-web-devicons.

classabbyamp avatar classabbyamp commented on August 16, 2024

this solves my issue

diff --git a/lua/nvim-web-devicons.lua b/lua/nvim-web-devicons.lua
index 4301079..d8b6a73 100644
--- a/lua/nvim-web-devicons.lua
+++ b/lua/nvim-web-devicons.lua
@@ -39,7 +39,7 @@ local function refresh_icons()
 end
 
 -- Map of filetypes -> icon names
-local filetypes = {
+M.filetypes = {
   ["avif"] = "avif",
   ["bzl"] = "bzl",
   ["brewfile"] = "brewfile",
@@ -437,7 +437,7 @@ function M.get_icon(name, ext, opts)
 end
 
 function M.get_icon_name_by_filetype(ft)
-  return filetypes[ft]
+  return M.filetypes[ft]
 end
 
 function M.get_icon_by_filetype(ft, opts)

by allowing me to do require("nvim-web-devicons").filetypes["srcpkg"] = "void"

would that be an acceptable change to PR?

from nvim-web-devicons.

classabbyamp avatar classabbyamp commented on August 16, 2024

but inside the setter, that mechanism is the way to go?

from nvim-web-devicons.

alex-courtis avatar alex-courtis commented on August 16, 2024

but inside the setter, that mechanism is the way to go?

Yes please - completely override or add.

from nvim-web-devicons.

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.