mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-31 07:05:31 +08:00
Fix #876 - Save history in a separate buffer variable so history works when linting is disabled
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
Before:
|
||||
Save g:ale_warn_about_trailing_whitespace
|
||||
Save g:ale_linters
|
||||
Save g:ale_fixers
|
||||
|
||||
unlet! b:ale_history
|
||||
|
||||
let g:ale_warn_about_trailing_whitespace = 1
|
||||
|
||||
@@ -10,6 +13,7 @@ Before:
|
||||
call ale#engine#ResetExecutableCache()
|
||||
call ale#linter#Reset()
|
||||
let g:ale_linters = {}
|
||||
let g:ale_fixers = {}
|
||||
let g:ale_linter_aliases = {}
|
||||
let g:ale_buffer_info = {}
|
||||
let g:globals_lines = [
|
||||
@@ -60,9 +64,10 @@ After:
|
||||
|
||||
let g:ale_buffer_info = {}
|
||||
|
||||
unlet! g:testlinter1
|
||||
unlet! g:testlinter2
|
||||
unlet! g:testlinter1
|
||||
unlet! g:testlinter2
|
||||
|
||||
unlet! b:ale_history
|
||||
unlet! b:ale_linters
|
||||
unlet! g:output
|
||||
unlet! g:globals_string
|
||||
@@ -248,12 +253,10 @@ Execute (ALEInfo should output linter aliases):
|
||||
|
||||
Given testft.testft2 (Empty buffer with two filetypes):
|
||||
Execute (ALEInfo should return command history):
|
||||
let g:ale_buffer_info[bufnr('%')] = {
|
||||
\ 'history': [
|
||||
\ {'status': 'started', 'job_id': 347, 'command': 'first command'},
|
||||
\ {'status': 'started', 'job_id': 347, 'command': ['/bin/bash', '\c', 'last command']},
|
||||
\ ],
|
||||
\}
|
||||
let b:ale_history = [
|
||||
\ {'status': 'started', 'job_id': 347, 'command': 'first command'},
|
||||
\ {'status': 'started', 'job_id': 347, 'command': ['/bin/bash', '\c', 'last command']},
|
||||
\]
|
||||
|
||||
call ale#linter#Define('testft', g:testlinter1)
|
||||
call ale#linter#Define('testft2', g:testlinter2)
|
||||
@@ -272,12 +275,10 @@ Execute (ALEInfo should return command history):
|
||||
|
||||
Given testft.testft2 (Empty buffer with two filetypes):
|
||||
Execute (ALEInfo command history should print exit codes correctly):
|
||||
let g:ale_buffer_info[bufnr('%')] = {
|
||||
\ 'history': [
|
||||
\ {'status': 'finished', 'exit_code': 0, 'job_id': 347, 'command': 'first command'},
|
||||
\ {'status': 'finished', 'exit_code': 1, 'job_id': 347, 'command': ['/bin/bash', '\c', 'last command']},
|
||||
\ ],
|
||||
\}
|
||||
let b:ale_history = [
|
||||
\ {'status': 'finished', 'exit_code': 0, 'job_id': 347, 'command': 'first command'},
|
||||
\ {'status': 'finished', 'exit_code': 1, 'job_id': 347, 'command': ['/bin/bash', '\c', 'last command']},
|
||||
\]
|
||||
|
||||
call ale#linter#Define('testft', g:testlinter1)
|
||||
call ale#linter#Define('testft2', g:testlinter2)
|
||||
@@ -298,31 +299,29 @@ Given testft.testft2 (Empty buffer with two filetypes):
|
||||
Execute (ALEInfo command history should print command output if logging is on):
|
||||
let g:ale_history_log_output = 1
|
||||
|
||||
let g:ale_buffer_info[bufnr('%')] = {
|
||||
\ 'history': [
|
||||
\ {
|
||||
\ 'status': 'finished',
|
||||
\ 'exit_code': 0,
|
||||
\ 'job_id': 347,
|
||||
\ 'command': 'first command',
|
||||
\ 'output': ['some', 'first command output'],
|
||||
\ },
|
||||
\ {
|
||||
\ 'status': 'finished',
|
||||
\ 'exit_code': 1,
|
||||
\ 'job_id': 347,
|
||||
\ 'command': ['/bin/bash', '\c', 'last command'],
|
||||
\ 'output': ['different second command output'],
|
||||
\ },
|
||||
\ {
|
||||
\ 'status': 'finished',
|
||||
\ 'exit_code': 0,
|
||||
\ 'job_id': 347,
|
||||
\ 'command': 'command with no output',
|
||||
\ 'output': [],
|
||||
\ },
|
||||
\ ],
|
||||
\}
|
||||
let b:ale_history = [
|
||||
\ {
|
||||
\ 'status': 'finished',
|
||||
\ 'exit_code': 0,
|
||||
\ 'job_id': 347,
|
||||
\ 'command': 'first command',
|
||||
\ 'output': ['some', 'first command output'],
|
||||
\ },
|
||||
\ {
|
||||
\ 'status': 'finished',
|
||||
\ 'exit_code': 1,
|
||||
\ 'job_id': 347,
|
||||
\ 'command': ['/bin/bash', '\c', 'last command'],
|
||||
\ 'output': ['different second command output'],
|
||||
\ },
|
||||
\ {
|
||||
\ 'status': 'finished',
|
||||
\ 'exit_code': 0,
|
||||
\ 'job_id': 347,
|
||||
\ 'command': 'command with no output',
|
||||
\ 'output': [],
|
||||
\ },
|
||||
\]
|
||||
|
||||
call ale#linter#Define('testft', g:testlinter1)
|
||||
call ale#linter#Define('testft2', g:testlinter2)
|
||||
@@ -354,8 +353,6 @@ Execute (ALEInfo command history should print command output if logging is on):
|
||||
\])
|
||||
|
||||
Execute (ALEInfo should include executable checks in the history):
|
||||
let g:ale_buffer_info[bufnr('')] = {'history': []}
|
||||
|
||||
call ale#linter#Define('testft', g:testlinter1)
|
||||
call ale#engine#IsExecutable(bufnr(''), 'echo')
|
||||
call ale#engine#IsExecutable(bufnr(''), 'TheresNoWayThisIsExecutable')
|
||||
|
||||
Reference in New Issue
Block a user