Open ndfsa opened 2 months ago
The following change to the files adapter would hide the size if the entry type is a directory.
--- a/lua/oil/adapters/files.lua
+++ b/lua/oil/adapters/files.lua
@@ -65,7 +65,7 @@ file_columns.size = {
render = function(entry, conf)
local meta = entry[FIELD_META]
local stat = meta.stat
- if not stat then
+ if not stat or stat.type == "directory" then
return columns.EMPTY
end
if stat.size >= 1e9 then
Note that this only works for this adapter, as I have not yet used the others.
I can make a PR with the change
Did you check the docs and existing issues?
Neovim version (nvim -v)
v0.11.0-dev-771+g67d6b6f27
Operating system/version
Arch Linux
Describe the bug
When using the size column, it shows "4.1k" for all directories regardless of their contents.
What is the severity of this bug?
minor (annoyance)
Steps To Reproduce
Expected Behavior
Although it is technically correct, 4096 being the size of the inode, I think it would be better to just hide the size if it does not represent the actual size of the contents.
Directory structure
test/ test/directory1/test.txt test/directory2/
Repro
Did you check the bug with a clean config?
nvim -u repro.lua
using the repro.lua file above.