1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 07:00:04 +08:00

feat(checkers): add open_error_list option

close https://github.com/SpaceVim/SpaceVim/issues/4796
This commit is contained in:
wsdjeg 2023-03-25 19:56:07 +08:00
parent d5a0d06272
commit 468681284d
5 changed files with 12 additions and 2 deletions

View File

@ -23,6 +23,8 @@
" - `show_cursor_error`: Enable/Disable displaying error below current line.
" - `lint_exclude_filetype`: Set the filetypes which does not enable syntax
" checking.
" - `open_error_list`: Open the language checking windows. when set to 0, the
" windows will not be opened automatically. Defaults to 2.
if exists('s:show_cursor_error')
@ -38,6 +40,7 @@ endif
let s:lint_exclude_filetype = []
let s:lint_on_the_fly = 0
let s:lint_on_save = 1
let s:open_error_list = 0
let s:SIG = SpaceVim#api#import('vim#signatures')
let s:STRING = SpaceVim#api#import('data#string')
@ -72,6 +75,9 @@ function! SpaceVim#layers#checkers#set_variable(var) abort
call SpaceVim#logger#warn('show_cursor_error in checkers layer needs timers feature')
let s:show_cursor_error = 0
endif
let s:open_error_list = get(a:var, 'open_error_list', s:open_error_list)
endfunction
function! SpaceVim#layers#checkers#get_options() abort
@ -102,6 +108,8 @@ function! SpaceVim#layers#checkers#config() abort
let g:neomake_{ft}_enabled_makers = []
endfor
let g:neomake_open_list = s:open_error_list
elseif g:spacevim_lint_engine ==# 'ale'
let g:ale_echo_delay = get(g:, 'ale_echo_delay', 300)

View File

@ -1,5 +1,4 @@
scriptencoding utf-8
" 1 open list and move cursor 2 open list without move cursor
let s:lint_option = SpaceVim#layers#checkers#get_lint_option()
let s:neomake_automake_events = {}
@ -16,7 +15,6 @@ if !empty(s:neomake_automake_events)
catch /^Vim\%((\a\+)\)\=:E117/
endtry
endif
let g:neomake_open_list = get(g:, 'neomake_open_list', 2)
let g:neomake_verbose = get(g:, 'neomake_verbose', 0)
let g:neomake_java_javac_delete_output = get(g:, 'neomake_java_javac_delete_output', 0)
let g:neomake_error_sign = get(g:, 'neomake_error_sign', {

View File

@ -1792,6 +1792,8 @@ OPTIONS
`show_cursor_error`: Enable/Disable displaying error below current line.
`lint_exclude_filetype`: Set the filetypes which does not enable syntax
checking.
`open_error_list`: Open the language checking windows. when set to 0, the
windows will not be opened automatically. Defaults to 2.
==============================================================================
COLORSCHEME *SpaceVim-layers-colorscheme*

View File

@ -55,6 +55,7 @@ lang: zh
| `lint_on_save` | `true` | 设置保存文件时进行语法检查,默认已启用 |
| `show_cursor_error` | `true` | 设置在当前行下方展示语法错误,默认已启用 |
| `lint_exclude_filetype` | `[]` | 设置禁用语法检查的文件类型列表 |
| `open_error_list` | `1/2/0` | 设置语法检查结果窗口打开方式,默认为 2 |
```toml
[[layers]]

View File

@ -57,6 +57,7 @@ feature, you may need to load this layer with `show_cursor_error` to `false`.
| `lint_on_save` | `true` | Run syntax checking when saving a file. |
| `show_cursor_error` | `true` | Enable/Disable displaying error below current line. |
| `lint_exclude_filetype` | `[]` | Set the filetypes which does not enable syntax checking. |
| `open_error_list` | `1/2/0` | Open the language checking windows. Defaults to 2 |
```toml
[[layers]]