Add support for 'none' class

This commit is contained in:
Olivier Roques
2020-12-25 15:10:17 +01:00
parent 184eecba87
commit 79f6c5bc0f
3 changed files with 78 additions and 18 deletions

View File

@@ -10,7 +10,7 @@ local M = {}
-------------------- OPTIONS -------------------------------
M.options = {
theme = 'one',
theme = 'default',
sections = {
{class = 'mode', item = require('hardline.parts.mode').get_item},
{class = 'high', item = require('hardline.parts.git').get_item},
@@ -36,7 +36,7 @@ local function get_state(class)
end
local function color_item(class, item)
if not class then return item end
if not class or class == 'none' then return item end
local state = get_state(class)
local hlgroup = string.format('Hardline_%s_%s', class, state)
if fn.hlexists(hlgroup) == 0 then return item end