From 0c6928dce265c4864635ff50e3323b4af46ca448 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Wed, 13 Apr 2022 21:24:30 +0200 Subject: [PATCH] Refactor hyperlink handling in `fetch_string` --- lib/colorls/core.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/colorls/core.rb b/lib/colorls/core.rb index 64acb5c5..5a674553 100644 --- a/lib/colorls/core.rb +++ b/lib/colorls/core.rb @@ -339,8 +339,7 @@ def fetch_string(content, key, color, increment) @count[increment] += 1 value = increment == :folders ? @folders[key] : @files[key] logo = value.gsub(/\\u[\da-f]{4}/i) { |m| [m[-4..].to_i(16)].pack('U') } - name = content.show - name = make_link(content) if @hyperlink + name = @hyperlink ? make_link(content) : content.show name += content.directory? && @indicator_style != 'none' ? '/' : ' ' entry = "#{out_encode(logo)} #{out_encode(name)}" entry = entry.bright if !content.directory? && content.executable?