Comments (11)
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 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.
I mean, it's easy to just implement truncation in the provider function itself, right?
from feline.nvim.
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.
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.
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.
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.
@MaiLunJiye can you please check if #65 does what you ask for
from feline.nvim.
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.
@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 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)
- Question: Background color of statusline does not change. HOT 2
- [Feature] HOT 2
- How do I configure feline as "default with no icons" HOT 2
- Changing single option without needing to add whole config HOT 2
- [Feature] Change the path seperator for the file_info provider HOT 2
- Unimplemented theme support HOT 5
- E542: Unbalanced groups HOT 8
- [Bug] adding 'neo-tree' to force-inactive table has no effect HOT 4
- Add my feline config link to your README.
- statusline config
- [Feature] An option for a small clock in the status bar HOT 1
- [Bug] cmdheight=0 not working HOT 12
- [Bug] Winbar disappears from inactive pane HOT 2
- [Bug] E5108: Error executing lua ... E539: Illegal character < > | Strings Ending With %% HOT 4
- [Bug] Actually disable winbar when using `disable` option HOT 3
- Error after install HOT 4
- [Feature] Feature request: component stack HOT 10
- [Bug] Starting Error
- [Bug] Global function `module` gets overwritten by feline HOT 2
- [Feature] Use a function to selectively update highlights
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feline.nvim.