1
0
mirror of https://github.com/amix/vimrc synced 2025-07-21 20:05:00 +08:00

Updated plugins, also experimenting with a new font

The font is IBM Plex Mono: https://ibm.github.io/type/
This commit is contained in:
amix
2017-11-24 14:54:40 +01:00
parent 7fc202ec88
commit e9aac9794b
255 changed files with 2898 additions and 3752 deletions

View File

@ -65,6 +65,17 @@ function! syntastic#postprocess#guards(errors) abort " {{{2
return a:errors
endfunction " }}}2
" convert error messages from UTF-8 to the current encoding
function! syntastic#postprocess#iconv(errors) abort " {{{2
if has('iconv') && &encoding !=# '' && &encoding !=# 'utf-8'
for e in a:errors
let e['text'] = iconv(e['text'], "utf-8", &encoding)
endfor
endif
return a:errors
endfunction " }}}2
" }}}1
let &cpo = s:save_cpo

View File

@ -264,6 +264,43 @@ function! syntastic#preprocess#perl(errors) abort " {{{2
return syntastic#util#unique(out)
endfunction " }}}2
function! syntastic#preprocess#perl6(errors) abort " {{{2
if a:errors[0] ==# 'Syntax OK'
return []
endif
let errs = s:_decode_JSON(join(a:errors, ''))
let out = []
if type(errs) == type({})
try
for val in values(errs)
let line = get(val, 'line', 0)
let pos = get(val, 'pos', 0)
if pos && has('byte_offset')
let line_pos = byte2line(pos + 1)
let column = line_pos > 0 ? pos - line2byte(line_pos) + 2 : 0
else
let column = 0
endif
call add(out, join([
\ get(val, 'filename', ''),
\ line,
\ column,
\ get(val, 'message', '') ], ':'))
endfor
catch /\m^Vim\%((\a\+)\)\=:E716/
call syntastic#log#warn('checker perl6/perl6: unrecognized error item ' . string(val))
let out = []
endtry
else
call syntastic#log#warn('checker perl6/perl6: unrecognized error format')
endif
return out
endfunction " }}}2
function! syntastic#preprocess#prospector(errors) abort " {{{2
let errs = join(a:errors, '')
if errs ==# ''

View File

@ -253,7 +253,7 @@ endfunction " }}}2
function! syntastic#util#findFileInParent(what, where) abort " {{{2
let old_suffixesadd = &suffixesadd
let &suffixesadd = ''
let file = findfile(a:what, escape(a:where, ' ') . ';')
let file = findfile(a:what, escape(a:where, ' ,') . ';')
let &suffixesadd = old_suffixesadd
return file
endfunction " }}}2
@ -307,8 +307,14 @@ function! syntastic#util#fname2buf(fname) abort " {{{2
" this is a best-effort attempt to escape file patterns (cf. :h file-pattern)
" XXX it fails for filenames containing something like \{2,3}
let buf = -1
for md in [':~:.', ':~', ':p']
let buf = bufnr('^' . escape(fnamemodify(a:fname, md), '\*?,{}[') . '$')
try
" Older versions of Vim can throw E94 here
let buf = bufnr('^' . escape(fnamemodify(a:fname, md), '\*?,{}[') . '$')
catch
" catch everything
endtry
if buf != -1
break
endif