<commit_before>module Coloration
  module Writers
    module VimThemeWriter

      def build_result
        add_line "\" Vim color file"
        add_line "\" #{comment_text}"
        add_line

        add_line "set background=dark"
        add_line "highlight clear"
        add_line
        add_line 'if exists("syntax_on")'
        add_line "  syntax reset"
        add_line "endif"
        add_line
        add_line "let g:colors_name = \"#{@name}\""
        add_line

        default_style = Style.new(:fg => @ui["foreground"])
        search_style = @items["variable"] || @items["entity"] || @items["keyword"] || default_style
        border_color = @ui["background"].lighten_by(81)

        ui_mapping = {
          "Cursor" => Style.new(:bg => @ui["caret"]),
          "Visual" => Style.new(:bg => @ui["selection"]),
          "CursorLine" => Style.new(:bg => @ui["lineHighlight"]),
          "CursorColumn" => Style.new(:bg => @ui["lineHighlight"]),
          "LineNr" => Style.new(:fg => @ui["foreground"].mix_with(@ui["background"], 50), :bg => @ui["background"]),
          "VertSplit" => Style.new(:fg => border_color, :bg => border_color),
          "MatchParen" => @items["keyword"],
          "StatusLine" => Style.new(:fg => @ui["foreground"], :bg => border_color, :bold => true),
          "StatusLineNC" => Style.new(:fg => @ui["foreground"], :bg => border_color),
          "Pmenu" => "entity.name",
          "PmenuSel" => Style.new(:bg => @ui["selection"]),
          "IncSearch" => Style.new(:bg => search_style.foreground.mix_with(@ui["background"], 33)),<commit_msg>Better algorith for calculating StatusLine and VertSplit in vim themes<commit_after>module Coloration
  module Writers
    module VimThemeWriter

      def build_result
        add_line "\" Vim color file"
        add_line "\" #{comment_text}"
        add_line

        add_line "set background=dark"
        add_line "highlight clear"
        add_line
        add_line 'if exists("syntax_on")'
        add_line "  syntax reset"
        add_line "endif"
        add_line
        add_line "let g:colors_name = \"#{@name}\""
        add_line

        default_style = Style.new(:fg => @ui["foreground"])
        search_style = @items["variable"] || @items["entity"] || @items["keyword"] || default_style
        border_color = @ui["background"].mix_with(@ui["foreground"], 81)

        ui_mapping = {
          "Cursor" => Style.new(:bg => @ui["caret"]),
          "Visual" => Style.new(:bg => @ui["selection"]),
          "CursorLine" => Style.new(:bg => @ui["lineHighlight"]),
          "CursorColumn" => Style.new(:bg => @ui["lineHighlight"]),
          "LineNr" => Style.new(:fg => @ui["foreground"].mix_with(@ui["background"], 50), :bg => @ui["background"]),
          "VertSplit" => Style.new(:fg => border_color, :bg => border_color),
          "MatchParen" => @items["keyword"],
          "StatusLine" => Style.new(:fg => @ui["foreground"], :bg => border_color, :bold => true),
          "StatusLineNC" => Style.new(:fg => @ui["foreground"], :bg => border_color),
          "Pmenu" => "entity.name",
          "PmenuSel" => Style.new(:bg => @ui["selection"]),
          "IncSearch" => Style.new(:bg => search_style.foreground.mix_with(@ui["background"], 33)),
{'fraction_non_alphanumeric': 0.18500307314074985, 'fraction_numerical': 0.0036877688998156115, 'mean_word_length': 2.8520710059171597, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3301717', 'n_tokens_mistral': 1025, 'n_tokens_neox': 990, 'n_words': 195}