Giter Club home page Giter Club logo

Comments (11)

ram02z avatar ram02z commented on July 17, 2024 2

I use the following function in my config for custom providers to help me truncate or disable them.

-- Returns true if 1/2 window width is greater than cols
local has_width_gt = function(cols, winid)
  winid = winid or 0
  return vim.api.nvim_win_get_width(winid) / 2 > cols
end

But at the same time it seems to be a good feature to add. Others' opinions on this would be appreciated

I agree that this feature seems good to add but it can introduce a decent amount of complexity to the code, like caching might. However, there is probably an elegant solution that another statusline plugin implements.

from feline.nvim.

famiu avatar famiu commented on July 17, 2024 1

@famiu I understand if you don't want to add this functionality to feline. Do you have any advice on how I could add truncation my own providers? Perhaps the README could mention a simple example of how one could do accomplish that?

I'll try to work on adding docs for that soon

from feline.nvim.

famiu avatar famiu commented on July 17, 2024

I mean, it's easy to just implement truncation in the provider function itself, right?

from feline.nvim.

famiu avatar famiu commented on July 17, 2024

I'm not sure if it'll be worth implementing a functionality like this. Feline is supposed to be minimal and expects most advanced things such as truncation to be done by the user since there's no one-size-fits-all when it comes to things like this. But at the same time it seems to be a good feature to add. Others' opinions on this would be appreciated

from feline.nvim.

famiu avatar famiu commented on July 17, 2024

I agree that this feature seems good to add but it can introduce a decent amount of complexity to the code, like caching might.

Mhm, and it also goes against Feline's design goal of minimalism and avoiding adding too many features.

However, there is probably an elegant solution that another statusline plugin implements.

Unless it's something very simple like a 2-3 line solution, I wouldn't be in favor of adding it personally.

from feline.nvim.

famiu avatar famiu commented on July 17, 2024

Closing this issue as I don't intend to work on it. If someone can implement it in a very simple manner that doesn't pollute the pre-existing code, they can make a PR, but I can't guarantee it being accepted in that case either.

from feline.nvim.

famiu avatar famiu commented on July 17, 2024

I've changed my mind regarding this. I think a very simple form of truncation can be added. I'll begin work on it soon

from feline.nvim.

famiu avatar famiu commented on July 17, 2024

@MaiLunJiye can you please check if #65 does what you ask for

from feline.nvim.

famiu avatar famiu commented on July 17, 2024

I've decided that at the end, truncation is something that should be implemented by the user after all. So I'm going to close this issue.

from feline.nvim.

mawkler avatar mawkler commented on July 17, 2024

@famiu I understand if you don't want to add this functionality to feline. Do you have any advice on how I could add truncation to my own providers? Perhaps the README could mention a simple example of how one could accomplish that?

from feline.nvim.

famiu avatar famiu commented on July 17, 2024

@famiu I understand if you don't want to add this functionality to feline. Do you have any advice on how I could add truncation to my own providers? Perhaps the README could mention a simple example of how one could accomplish that?

So, what kind of truncation do you want? @Melkster

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