mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-17 16:03:41 -05:00
use abort argument for :function
This commit is contained in:
@@ -3,13 +3,13 @@
|
||||
" Version: 0.0
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2014/11/18 09:52:16.
|
||||
" Last Change: 2014/12/17 00:13:56.
|
||||
" =============================================================================
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! s:load()
|
||||
function! s:load() abort
|
||||
let rgbfile = $VIMRUNTIME . '/rgb.txt'
|
||||
let table = {}
|
||||
if filereadable(rgbfile)
|
||||
@@ -22,12 +22,12 @@ endfunction
|
||||
|
||||
let s:table = s:load()
|
||||
|
||||
function! lightline#colortable#name_to_rgb(name)
|
||||
function! lightline#colortable#name_to_rgb(name) abort
|
||||
let name = tolower(a:name)
|
||||
return has_key(s:table, name) ? s:table[name] : []
|
||||
endfunction
|
||||
|
||||
function! lightline#colortable#gui2cui(rgb, fallback)
|
||||
function! lightline#colortable#gui2cui(rgb, fallback) abort
|
||||
let rgb = map(matchlist(a:rgb, '#\(..\)\(..\)\(..\)')[1:3], '0 + ("0x".v:val)')
|
||||
if len(rgb) == 0
|
||||
let rgb = lightline#colortable#name_to_rgb(a:rgb)
|
||||
|
||||
Reference in New Issue
Block a user