From a6a4f48b14b4a51fded531c86f6c04b4503a2ef8 Mon Sep 17 00:00:00 2001 From: Ian Wright <49083526+Landaman@users.noreply.github.com> Date: Tue, 7 Jan 2025 00:11:10 -0500 Subject: [PATCH] fix: directory rendering with custom highlights (#551) These would loose their trailing '/', making them unusable --- lua/oil/view.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/oil/view.lua b/lua/oil/view.lua index c6d96030..1facdcba 100644 --- a/lua/oil/view.lua +++ b/lua/oil/view.lua @@ -770,6 +770,10 @@ M.format_entry_cols = function(entry, column_defs, col_width, adapter, is_hidden else local hl = get_custom_hl(external_entry, is_hidden, false, false) if hl then + -- Add the trailing / if this is a directory, this is important + if entry_type == "directory" then + name = name .. "/" + end table.insert(cols, { name, hl }) return cols end