mirror of
https://github.com/dense-analysis/ale.git
synced 2026-05-17 13:59:47 +08:00
#857 - Add b:ale_fix_on_save for controlling fixing on save for specific buffers
This commit is contained in:
@@ -155,32 +155,10 @@ Execute (g:ale_lint_on_filetype_changed = 1 should bind the FileType event):
|
||||
\ ],
|
||||
\ CheckAutocmd('ALERunOnFiletypeChangeGroup')
|
||||
|
||||
Execute (g:ale_lint_on_save = 0 should bind no events):
|
||||
let g:ale_lint_on_save = 0
|
||||
let g:ale_fix_on_save = 0
|
||||
|
||||
AssertEqual [], CheckAutocmd('ALERunOnSaveGroup')
|
||||
|
||||
Execute (g:ale_lint_on_save = 1 should bind no events):
|
||||
let g:ale_lint_on_save = 1
|
||||
let g:ale_fix_on_save = 0
|
||||
|
||||
AssertEqual [
|
||||
\ 'BufWritePost * call ale#events#SaveEvent(str2nr(expand(''<abuf>'')))',
|
||||
\], CheckAutocmd('ALERunOnSaveGroup')
|
||||
|
||||
Execute (g:ale_lint_on_save = 0 and g:ale_fix_on_save = 1 should bind events):
|
||||
let g:ale_lint_on_save = 0
|
||||
let g:ale_fix_on_save = 1
|
||||
|
||||
AssertEqual [
|
||||
\ 'BufWritePost * call ale#events#SaveEvent(str2nr(expand(''<abuf>'')))',
|
||||
\], CheckAutocmd('ALERunOnSaveGroup')
|
||||
|
||||
Execute (g:ale_fix_on_save = 1 should bind events even when ALE is disabled):
|
||||
Execute (The SaveEvent should always be bound):
|
||||
let g:ale_enabled = 0
|
||||
let g:ale_lint_on_save = 0
|
||||
let g:ale_fix_on_save = 1
|
||||
let g:ale_fix_on_save = 0
|
||||
|
||||
AssertEqual [
|
||||
\ 'BufWritePost * call ale#events#SaveEvent(str2nr(expand(''<abuf>'')))',
|
||||
|
||||
Reference in New Issue
Block a user