From 5e70184372e83e0fbb7f678176017fc76a0fbb16 Mon Sep 17 00:00:00 2001 From: Athitya Kumar Date: Thu, 27 Oct 2022 14:25:16 +0530 Subject: [PATCH] lint(483): makes linter happy --- lib/colorls/core.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/colorls/core.rb b/lib/colorls/core.rb index 7b669ad..7448e83 100644 --- a/lib/colorls/core.rb +++ b/lib/colorls/core.rb @@ -52,7 +52,7 @@ module ColorLS init_icons end - def get_additional_chars_per_item + def additional_chars_per_item 12 + (@show_git ? 4 : 0) + (@show_inode ? 10 : 0) end @@ -157,7 +157,7 @@ module ColorLS end def item_widths - @contents.map { |item| Unicode::DisplayWidth.of(item.show) + get_additional_chars_per_item } + @contents.map { |item| Unicode::DisplayWidth.of(item.show) + additional_chars_per_item } end def filter_hidden_contents @@ -356,7 +356,7 @@ module ColorLS entry = fetch_string(content, *options(content)) line << (' ' * padding) line << ' ' << entry.encode(Encoding.default_external, undef: :replace) - padding = widths[i] - Unicode::DisplayWidth.of(content.show) - get_additional_chars_per_item + padding = widths[i] - Unicode::DisplayWidth.of(content.show) - additional_chars_per_item end print line << "\n" end