mirror of
https://github.com/amix/vimrc
synced 2025-07-12 14:15:00 +08:00
Updated plugins
This commit is contained in:
@ -269,13 +269,19 @@ function! s:ReplaceCompletionOptions(source) abort
|
||||
let b:ale_old_completeopt = &l:completeopt
|
||||
endif
|
||||
|
||||
if &l:completeopt =~# 'preview'
|
||||
let &l:completeopt = 'menu,menuone,preview,noselect,noinsert'
|
||||
elseif &l:completeopt =~# 'popup'
|
||||
let &l:completeopt = 'menu,menuone,popup,noselect,noinsert'
|
||||
else
|
||||
let &l:completeopt = 'menu,menuone,noselect,noinsert'
|
||||
endif
|
||||
let l:opt_list = split(&l:completeopt, ',')
|
||||
" The menu and noinsert options must be set, or automatic completion
|
||||
" will be annoying.
|
||||
let l:new_opt_list = ['menu', 'menuone', 'noinsert']
|
||||
|
||||
" Permit some other completion options, provided users have set them.
|
||||
for l:opt in ['preview', 'popup', 'noselect']
|
||||
if index(l:opt_list, l:opt) >= 0
|
||||
call add(l:new_opt_list, l:opt)
|
||||
endif
|
||||
endfor
|
||||
|
||||
let &l:completeopt = join(l:new_opt_list, ',')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
@ -259,9 +259,7 @@ function! ale#debugging#InfoToClipboard() abort
|
||||
return
|
||||
endif
|
||||
|
||||
redir => l:output
|
||||
silent call ale#debugging#Info()
|
||||
redir END
|
||||
let l:output = execute('call ale#debugging#Info()')
|
||||
|
||||
let @+ = l:output
|
||||
call s:Echo('ALEInfo copied to your clipboard')
|
||||
@ -270,9 +268,7 @@ endfunction
|
||||
function! ale#debugging#InfoToFile(filename) abort
|
||||
let l:expanded_filename = expand(a:filename)
|
||||
|
||||
redir => l:output
|
||||
silent call ale#debugging#Info()
|
||||
redir END
|
||||
let l:output = execute('call ale#debugging#Info()')
|
||||
|
||||
call writefile(split(l:output, "\n"), l:expanded_filename)
|
||||
call s:Echo('ALEInfo written to ' . l:expanded_filename)
|
||||
|
@ -4,9 +4,7 @@
|
||||
function! ale#filetypes#LoadExtensionMap() abort
|
||||
" Output includes:
|
||||
" '*.erl setf erlang'
|
||||
redir => l:output
|
||||
silent exec 'autocmd'
|
||||
redir end
|
||||
let l:output = execute('exec "autocmd"')
|
||||
|
||||
let l:map = {}
|
||||
|
||||
|
@ -2,10 +2,10 @@
|
||||
" Description: Functions for working with eslint, for checking or fixing files.
|
||||
|
||||
let s:executables = [
|
||||
\ '.yarn/sdks/eslint/bin/eslint.js',
|
||||
\ 'node_modules/.bin/eslint_d',
|
||||
\ 'node_modules/eslint/bin/eslint.js',
|
||||
\ 'node_modules/.bin/eslint',
|
||||
\ '.yarn/sdks/eslint/bin/eslint',
|
||||
\]
|
||||
let s:sep = has('win32') ? '\' : '/'
|
||||
|
||||
@ -52,14 +52,20 @@ function! ale#handlers#eslint#GetCwd(buffer) abort
|
||||
let l:executable = ale#path#FindNearestExecutable(a:buffer, s:executables)
|
||||
|
||||
if !empty(l:executable)
|
||||
let l:nmi = strridx(l:executable, 'node_modules')
|
||||
let l:project_dir = l:executable[0:l:nmi - 2]
|
||||
let l:modules_index = strridx(l:executable, 'node_modules')
|
||||
let l:modules_root = l:modules_index > -1 ? l:executable[0:l:modules_index - 2] : ''
|
||||
|
||||
let l:sdks_index = strridx(l:executable, ale#path#Simplify('.yarn/sdks'))
|
||||
let l:sdks_root = l:sdks_index > -1 ? l:executable[0:l:sdks_index - 2] : ''
|
||||
else
|
||||
let l:modules_dir = ale#path#FindNearestDirectory(a:buffer, 'node_modules')
|
||||
let l:project_dir = !empty(l:modules_dir) ? fnamemodify(l:modules_dir, ':h:h') : ''
|
||||
let l:modules_root = !empty(l:modules_dir) ? fnamemodify(l:modules_dir, ':h:h') : ''
|
||||
|
||||
let l:sdks_dir = ale#path#FindNearestDirectory(a:buffer, ale#path#Simplify('.yarn/sdks'))
|
||||
let l:sdks_root = !empty(l:sdks_dir) ? fnamemodify(l:sdks_dir, ':h:h:h') : ''
|
||||
endif
|
||||
|
||||
return !empty(l:project_dir) ? l:project_dir : ''
|
||||
return strlen(l:modules_root) > strlen(l:sdks_root) ? l:modules_root : l:sdks_root
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#eslint#GetCommand(buffer) abort
|
||||
|
@ -52,9 +52,7 @@ endif
|
||||
function! ale#sign#SetUpDefaultColumnWithoutErrorsHighlight() abort
|
||||
let l:verbose = &verbose
|
||||
set verbose=0
|
||||
redir => l:output
|
||||
0verbose silent highlight SignColumn
|
||||
redir end
|
||||
let l:output = execute('highlight SignColumn', 'silent')
|
||||
let &verbose = l:verbose
|
||||
|
||||
let l:highlight_syntax = join(split(l:output)[2:])
|
||||
@ -171,10 +169,10 @@ endfunction
|
||||
|
||||
" Read sign data for a buffer to a list of lines.
|
||||
function! ale#sign#ReadSigns(buffer) abort
|
||||
redir => l:output
|
||||
silent execute 'sign place ' . s:GroupCmd() . s:PriorityCmd()
|
||||
\ . ' buffer=' . a:buffer
|
||||
redir end
|
||||
let l:output = execute(
|
||||
\ 'sign place ' . s:GroupCmd() . s:PriorityCmd()
|
||||
\ . ' buffer=' . a:buffer
|
||||
\ )
|
||||
|
||||
return split(l:output, "\n")
|
||||
endfunction
|
||||
|
Reference in New Issue
Block a user