From 3e93c212cc2567093440c0a277c28b4cb1589a0c Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 18 Nov 2020 08:17:57 +0100 Subject: [PATCH] highlighter: vim9 script implementation of s:gui2cui --- autoload/airline/highlighter.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/autoload/airline/highlighter.vim b/autoload/airline/highlighter.vim index 3d225226..dddd4b8e 100644 --- a/autoload/airline/highlighter.vim +++ b/autoload/airline/highlighter.vim @@ -314,4 +314,14 @@ if !exists(":def") || (exists(":def") && get(g:, "airline_experimental", 0)==0) finish else " This is using Vim9 script " {{{1 + def s:gui2cui(rgb: string, fallback: string): string # {{{2 + if empty(rgb) + return fallback + elseif match(rgb, '^\%(NONE\|[fb]g\)$') > -1 + return rgb + endif + var _rgb = [] + _rgb = map(split(rgb[1:], '..\zs'), {_, v -> str2nr("0x" .. v)}) + return airline#msdos#round_msdos_colors(_rgb) + enddef endif