feat: filename now supports oil.nvim
https://github.com/nvim-lualine/lualine.nvim/issues/1077
This PR adds filename support for oil.nvim, so it's no longer the full path but how the user specified the path to be shown
To be honest this is kind of a selfish PR where I am modifying the vanilla component, and as I said in my previous PR it would be better to somehow extract this logic for the user to write himself, but maybe that's too much effort
Why isn't this done inside the oil extension?
Why isn't this done inside the oil extension?
Is it possible to do this easily? When I implemented this I remember checking out extensions and seeing some blocker that I can't recall.
If possible yeah, this should be an extension, but the only way I see is somehow extending the current filename to add support
I don't think we would really need the filename component. AFAIK something like this would work as a custom component inside de oil extension:
function() {
-- proper module exists validation
local oil = require 'oil'
return oil.get_current_dir() .. oil.get_cursor_entry().name
}
I don't think we would really need the filename component. AFAIK something like this would work as a custom component inside de oil extension:
function() { -- proper module exists validation local oil = require 'oil' return oil.get_current_dir() .. oil.get_cursor_entry().name }
The filename component automatically shrinks the path when it does not fit, without it I wouldn't be able to read the path when in a terminal split most of the time, without that it's not even worth adding it imo.
Your solution would show the full path all the time
I see. So, we could move this shrinking logic to another place for it to be reusable. What do you think?
I see. So, we could move this shrinking logic to another place for it to be reusable. What do you think?
That's one solution, but we are not really solving the root problem, the root problem is that getting the current directory should be exposed to the global config somehow, then everything would just work