[logaling-commit] logaling/logaling-command [master] improve display color of glossary

Back to archive index

null+****@clear***** null+****@clear*****
Wed Jan 11 17:30:03 JST 2012


SUZUKI Miho	2012-01-11 17:30:03 +0900 (Wed, 11 Jan 2012)

  New Revision: b60b9422dd29332aa1e482e75292944717507dd8

  Merged cb15f09: Merge pull request #15 from logaling/improve-lookup-color

  Log:
    improve display color of glossary

  Modified files:
    lib/logaling/command.rb

  Modified: lib/logaling/command.rb (+7 -2)
===================================================================
--- lib/logaling/command.rb    2012-01-10 10:15:40 +0900 (5cbc52a)
+++ lib/logaling/command.rb    2012-01-11 17:30:03 +0900 (e8c96ac)
@@ -158,8 +158,13 @@ class Logaling::Command < Thor
         target_string = "#{term[:target_term].bright}"
         target_string <<  "\t# #{term[:note]}" unless term[:note].empty?
         if repository.glossary_counts > 1
-          color = (term[:name] == config["glossary"]) ? :green : :cyan
-          target_string << "\t(#{term[:name]})".color(color)
+          target_string << "\t"
+          glossary_name = "(#{term[:name]})"
+          if term[:name] == config["glossary"]
+            target_string << glossary_name.foreground(:white).background(:green)
+          else
+            target_string << glossary_name
+          end
         end
         source_string = term[:snipped_source_term].map{|word|  word.is_a?(Hash) ? word[:keyword].bright : word }.join
         printf("  %-#{max_str_size+10}s %s\n", source_string, target_string)




More information about the logaling-commit mailing list
Back to archive index