mirror of
https://github.com/amix/vimrc
synced 2025-08-07 22:35:01 +08:00
Updated the plugins
This commit is contained in:
@ -3,11 +3,17 @@
|
||||
|
||||
call ale#Set('haskell_brittany_executable', 'brittany')
|
||||
|
||||
function! ale#fixers#brittany#Fix(buffer) abort
|
||||
function! ale#fixers#brittany#GetExecutable(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_brittany_executable')
|
||||
|
||||
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'brittany')
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#brittany#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#brittany#GetExecutable(a:buffer)
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ 'command': l:executable
|
||||
\ . ' --write-mode inplace'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
|
@ -6,13 +6,28 @@ function! ale#fixers#generic_python#AddLinesBeforeControlStatements(buffer, line
|
||||
let l:new_lines = []
|
||||
let l:last_indent_size = 0
|
||||
let l:last_line_is_blank = 0
|
||||
let l:in_docstring = 0
|
||||
|
||||
for l:line in a:lines
|
||||
let l:indent_size = len(matchstr(l:line, '^ *'))
|
||||
|
||||
if !l:in_docstring
|
||||
" Make sure it is not just a single line docstring and then verify
|
||||
" it's starting a new docstring
|
||||
if match(l:line, '\v^ *("""|'''''').*("""|'''''')') == -1
|
||||
\&& match(l:line, '\v^ *("""|'''''')') >= 0
|
||||
let l:in_docstring = 1
|
||||
endif
|
||||
else
|
||||
if match(l:line, '\v^ *.*("""|'''''')') >= 0
|
||||
let l:in_docstring = 0
|
||||
endif
|
||||
endif
|
||||
|
||||
if !l:last_line_is_blank
|
||||
\&& !l:in_docstring
|
||||
\&& l:indent_size <= l:last_indent_size
|
||||
\&& match(l:line, '\v^ *(return|if|for|while|break|continue)') >= 0
|
||||
\&& match(l:line, '\v^ *(return|if|for|while|break|continue)(\(| |$)') >= 0
|
||||
call add(l:new_lines, '')
|
||||
endif
|
||||
|
||||
|
@ -7,7 +7,7 @@ function! ale#fixers#hfmt#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_hfmt_executable')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ 'command': ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'hfmt')
|
||||
\ . ' -w'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
|
@ -1,13 +1,10 @@
|
||||
" Author: eborden <evan@evan-borden.com>
|
||||
" Description: Integration of hlint refactor with ALE.
|
||||
"
|
||||
call ale#Set('haskell_hlint_executable', 'hlint')
|
||||
|
||||
function! ale#fixers#hlint#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_hlint_executable')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ 'command': ale#handlers#hlint#GetExecutable(a:buffer)
|
||||
\ . ' --refactor'
|
||||
\ . ' --refactor-options="--inplace"'
|
||||
\ . ' %t',
|
||||
|
@ -3,11 +3,17 @@
|
||||
"
|
||||
call ale#Set('haskell_stylish_haskell_executable', 'stylish-haskell')
|
||||
|
||||
function! ale#fixers#stylish_haskell#Fix(buffer) abort
|
||||
function! ale#fixers#stylish_haskell#GetExecutable(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_stylish_haskell_executable')
|
||||
|
||||
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'stylish-haskell')
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#stylish_haskell#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#stylish_haskell#GetExecutable(a:buffer)
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ 'command': l:executable
|
||||
\ . ' --inplace'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
|
Reference in New Issue
Block a user