Add an option for completely disabling command history, and add documentation

This commit is contained in:
w0rp
2017-02-16 21:33:44 +00:00
parent 3a2286a1b8
commit ca17b5aebd
4 changed files with 45 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ Before:
\})
After:
let g:ale_history_enabled = 1
unlet g:history
let g:ale_buffer_info = {}
let g:ale_max_buffer_history_size = 20
@@ -40,6 +41,16 @@ Execute(History should be set when commands are run):
" The Job ID will change each time, but we can check the type.
AssertEqual type(1), type(g:history[0].job_id)
Execute(History should be not set when disabled):
AssertEqual 'foobar', &filetype
let g:ale_history_enabled = 0
call ale#Lint()
call ale#engine#WaitForJobs(2000)
AssertEqual 0, len(g:ale_buffer_info[bufnr('%')].history)
Execute(History items should be popped after going over the max):
let g:ale_buffer_info[1] = {
\ 'history': map(range(20), '{''status'': ''started'', ''job_id'': v:val, ''command'': ''foobar''}'),