coloration 0.1 → 0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module Coloration
2
- VERSION = "0.1".freeze
2
+ VERSION = "0.2".freeze
3
3
  end
@@ -17,6 +17,7 @@ module Coloration
17
17
  add_line "let g:colors_name = \"#{@name}\""
18
18
  add_line
19
19
 
20
+ search_style = @items["variable"] || @items["entity"] || @items["keyword"]
20
21
  ui_mapping = {
21
22
  "Cursor" => Style.new(:bg => @ui["caret"]),
22
23
  "Visual" => Style.new(:bg => @ui["selection"]),
@@ -29,10 +30,10 @@ module Coloration
29
30
  "StatusLineNC" => Style.new(:fg => @ui["foreground"], :bg => @ui["selection"]),
30
31
  "Pmenu" => "entity.name",
31
32
  "PmenuSel" => Style.new(:bg => @ui["selection"]),
32
- "IncSearch" => Style.new(:bg => @items["variable"].foreground.mix_with(@ui["background"], 33)),
33
- "Search" => Style.new(:bg => @items["variable"].foreground.mix_with(@ui["background"], 33)),
33
+ "IncSearch" => Style.new(:bg => search_style.foreground.mix_with(@ui["background"], 33)),
34
+ "Search" => Style.new(:bg => search_style.foreground.mix_with(@ui["background"], 33)),
34
35
  "Directory" => "constant.other.symbol",
35
- "Folded" => Style.new(:fg => @items["comment"].foreground, :bg => @ui["background"]),
36
+ "Folded" => Style.new(:fg => @items["comment"].try(:foreground), :bg => @ui["background"]),
36
37
  }
37
38
 
38
39
  ui_mapping.keys.each do |key|
@@ -146,8 +147,10 @@ module Coloration
146
147
  "cssBraces" => "punctuation.section.property-list.css",
147
148
  }
148
149
 
150
+ default_style = Style.new
151
+ default_style.foreground = @ui["foreground"]
149
152
  items_mapping.keys.each do |key|
150
- add_line(format_item(key, items_mapping[key]))
153
+ add_line(format_item(key, items_mapping[key] || default_style))
151
154
  end
152
155
 
153
156
  self.result = @lines.join("\n")
metadata CHANGED
@@ -4,8 +4,8 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
8
- version: "0.1"
7
+ - 2
8
+ version: "0.2"
9
9
  platform: ruby
10
10
  authors:
11
11
  - Marcin Kulik
@@ -13,7 +13,7 @@ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
 
16
- date: 2010-07-20 00:00:00 +02:00
16
+ date: 2010-07-22 00:00:00 +02:00
17
17
  default_executable:
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency