Refactor hyperlink handling in fetch_string

This commit is contained in:
Claudio Bley 2022-04-13 21:24:30 +02:00
parent b8589c30fe
commit 0c6928dce2

View file

@ -339,8 +339,7 @@ module ColorLS
@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?