mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 22:40:06 +08:00
Fix error_clear (#2847)
This commit is contained in:
parent
66338440f0
commit
b38414aea5
@ -13,18 +13,23 @@ let s:self._cmp = SpaceVim#api#import('vim#compatible')
|
|||||||
let s:self.hi_info_group = 'Comment'
|
let s:self.hi_info_group = 'Comment'
|
||||||
let s:self.hi_warn_group = 'WarningMsg'
|
let s:self.hi_warn_group = 'WarningMsg'
|
||||||
let s:self.hi_error_group = 'ErrorMsg'
|
let s:self.hi_error_group = 'ErrorMsg'
|
||||||
|
if exists('*nvim_create_namespace')
|
||||||
|
let s:self._hi_namespace = nvim_create_namespace('spacevim-signatures')
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
if exists('*nvim_buf_set_virtual_text')
|
if exists('*nvim_create_namespace')
|
||||||
|
" @vimlint(EVL103, 1, a:col)
|
||||||
function! s:self.info(line, col, message) abort
|
function! s:self.info(line, col, message) abort
|
||||||
call nvim_buf_set_virtual_text(0, bufnr('%'), a:line, [[a:message, self.hi_info_group],], {})
|
call nvim_buf_set_virtual_text(0, self._hi_namespace, a:line - 2, [[a:message, self.hi_info_group],], {})
|
||||||
endfunction
|
endfunction
|
||||||
function! s:self.warn(line, col, message) abort
|
function! s:self.warn(line, col, message) abort
|
||||||
call nvim_buf_set_virtual_text(0, bufnr('%'), a:line, [[a:message, self.hi_warn_group],], {})
|
call nvim_buf_set_virtual_text(0, self._hi_namespace, a:line - 2, [[a:message, self.hi_warn_group],], {})
|
||||||
endfunction
|
endfunction
|
||||||
function! s:self.error(line, col, message) abort
|
function! s:self.error(line, col, message) abort
|
||||||
call nvim_buf_set_virtual_text(0, bufnr('%'), a:line, [[a:message, self.hi_error_group],], {})
|
call nvim_buf_set_virtual_text(0, self._hi_namespace, a:line - 2, [[a:message, self.hi_error_group],], {})
|
||||||
endfunction
|
endfunction
|
||||||
|
" @vimlint(EVL103, 0, a:col)
|
||||||
else
|
else
|
||||||
|
|
||||||
function! s:self.info(line, col, message) abort
|
function! s:self.info(line, col, message) abort
|
||||||
@ -44,12 +49,18 @@ endfunction
|
|||||||
|
|
||||||
call s:self.set_group('SpaceVim_signatures')
|
call s:self.set_group('SpaceVim_signatures')
|
||||||
|
|
||||||
function! s:self.clear() abort
|
if exists('*nvim_create_namespace')
|
||||||
for id in self.id
|
function! s:self.clear() abort
|
||||||
call matchdelete(id)
|
call nvim_buf_clear_namespace(0, self._hi_namespace, 0, -1)
|
||||||
endfor
|
endfunction
|
||||||
let self.id = []
|
else
|
||||||
endfunction
|
function! s:self.clear() abort
|
||||||
|
for id in self.id
|
||||||
|
call matchdelete(id)
|
||||||
|
endfor
|
||||||
|
let self.id = []
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
function! SpaceVim#api#vim#signatures#get() abort
|
function! SpaceVim#api#vim#signatures#get() abort
|
||||||
|
@ -539,11 +539,7 @@ function! SpaceVim#layers#core#statusline#def_colors() abort
|
|||||||
exe 'hi! SpaceVim_statusline_ia gui=bold cterm=bold ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
|
exe 'hi! SpaceVim_statusline_ia gui=bold cterm=bold ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
|
||||||
exe 'hi! SpaceVim_statusline_b ctermbg=' . t[1][2] . ' ctermfg=' . t[1][3] . ' guibg=' . t[1][1] . ' guifg=' . t[1][0]
|
exe 'hi! SpaceVim_statusline_b ctermbg=' . t[1][2] . ' ctermfg=' . t[1][3] . ' guibg=' . t[1][1] . ' guifg=' . t[1][0]
|
||||||
exe 'hi! SpaceVim_statusline_c ctermbg=' . t[2][2] . ' ctermfg=' . t[2][3] . ' guibg=' . t[2][1] . ' guifg=' . t[2][0]
|
exe 'hi! SpaceVim_statusline_c ctermbg=' . t[2][2] . ' ctermfg=' . t[2][3] . ' guibg=' . t[2][1] . ' guifg=' . t[2][0]
|
||||||
if name ==# 'palenight' && t[9] ==# 'bright'
|
exe 'hi! SpaceVim_statusline_z ctermbg=' . t[3][1] . ' ctermfg=' . t[2][2] . ' guibg=' . t[3][0] . ' guifg=' . t[2][0]
|
||||||
exe 'hi! SpaceVim_statusline_z ctermbg=' . t[3][1] . ' ctermfg=' . t[2][2] . ' guibg=' . t[3][0] . ' guifg=' . t[2][0]
|
|
||||||
else
|
|
||||||
exe 'hi! SpaceVim_statusline_z ctermbg=' . t[3][1] . ' ctermfg=' . t[4][3] . ' guibg=' . t[3][0] . ' guifg=' . t[4][0]
|
|
||||||
endif
|
|
||||||
hi! SpaceVim_statusline_error ctermbg=003 ctermfg=Black guibg=#504945 guifg=#fb4934 gui=bold
|
hi! SpaceVim_statusline_error ctermbg=003 ctermfg=Black guibg=#504945 guifg=#fb4934 gui=bold
|
||||||
hi! SpaceVim_statusline_warn ctermbg=003 ctermfg=Black guibg=#504945 guifg=#fabd2f gui=bold
|
hi! SpaceVim_statusline_warn ctermbg=003 ctermfg=Black guibg=#504945 guifg=#fabd2f gui=bold
|
||||||
call s:HI.hi_separator('SpaceVim_statusline_a', 'SpaceVim_statusline_b')
|
call s:HI.hi_separator('SpaceVim_statusline_a', 'SpaceVim_statusline_b')
|
||||||
|
@ -60,7 +60,6 @@ function! SpaceVim#mapping#guide#theme#palenight#palette() abort
|
|||||||
\ [ s:guiBlack , s:gui05 , s:ctermWhite , s:cterm05 ],
|
\ [ s:guiBlack , s:gui05 , s:ctermWhite , s:cterm05 ],
|
||||||
\ ['#282828', '#689d6a', 235, 72],
|
\ ['#282828', '#689d6a', 235, 72],
|
||||||
\ ['#282828', '#8f3f71', 235, 132],
|
\ ['#282828', '#8f3f71', 235, 132],
|
||||||
\ 'bright'
|
|
||||||
\ ]
|
\ ]
|
||||||
else
|
else
|
||||||
return [
|
return [
|
||||||
@ -73,7 +72,6 @@ function! SpaceVim#mapping#guide#theme#palenight#palette() abort
|
|||||||
\ [ s:guiBlack , s:gui05 , s:ctermWhite , s:cterm05 ],
|
\ [ s:guiBlack , s:gui05 , s:ctermWhite , s:cterm05 ],
|
||||||
\ ['#282828', '#689d6a', 235, 72],
|
\ ['#282828', '#689d6a', 235, 72],
|
||||||
\ ['#282828', '#8f3f71', 235, 132],
|
\ ['#282828', '#8f3f71', 235, 132],
|
||||||
\ 'dark',
|
|
||||||
\ ]
|
\ ]
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -18,13 +18,12 @@ vim#signatures API provides some basic functions for showing signatures info.
|
|||||||
|
|
||||||
## Functions ane varilues
|
## Functions ane varilues
|
||||||
|
|
||||||
| function name | description |
|
| function name | description |
|
||||||
| ------------------------- | ---------------------------------------- |
|
| ----------------------- | ----------------------------------------------------- |
|
||||||
| `info(line, col, msg)` | show info signature message on specific line and col |
|
| `info(line, col, msg)` | show info signature message on specific line and col |
|
||||||
| `warn(line, col, msg)` | show warn signature message on specific line and col |
|
| `warn(line, col, msg)` | show warn signature message on specific line and col |
|
||||||
| `error(line, col, msg)` | show error signature message on specific line and col |
|
| `error(line, col, msg)` | show error signature message on specific line and col |
|
||||||
| `clear()` | clear signatures info |
|
| `clear()` | clear signatures info |
|
||||||
| `hi_info_group` | info message highlight group name |
|
| `hi_info_group` | info message highlight group name |
|
||||||
| `hi_warn_group` | warn message highlight group name |
|
| `hi_warn_group` | warn message highlight group name |
|
||||||
| `hi_error_group` | error message highlight group name |
|
| `hi_error_group` | error message highlight group name |
|
||||||
|
|
||||||
|
30
docs/cn/api/vim/signatures.md
Normal file
30
docs/cn/api/vim/signatures.md
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
title: "vim#signatures api"
|
||||||
|
description: "vim#signatures API 提供一些设置和获取 Vim 提示消息的函数。"
|
||||||
|
lang: cn
|
||||||
|
---
|
||||||
|
|
||||||
|
# [可用 APIs](../../) >> vim#signatures
|
||||||
|
|
||||||
|
<!-- vim-markdown-toc GFM -->
|
||||||
|
|
||||||
|
- [模块简介](#模块简介)
|
||||||
|
- [函数及变量](#函数及变量)
|
||||||
|
|
||||||
|
<!-- vim-markdown-toc -->
|
||||||
|
|
||||||
|
## 模块简介
|
||||||
|
|
||||||
|
vim#signatures API 提供一些设置和获取 Vim 提示消息的函数。
|
||||||
|
|
||||||
|
## 函数及变量
|
||||||
|
|
||||||
|
| 函数名称 | 功能描述 |
|
||||||
|
| ----------------------- | ----------------------------------------------------- |
|
||||||
|
| `info(line, col, msg)` | show info signature message on specific line and col |
|
||||||
|
| `warn(line, col, msg)` | show warn signature message on specific line and col |
|
||||||
|
| `error(line, col, msg)` | show error signature message on specific line and col |
|
||||||
|
| `clear()` | clear signatures info |
|
||||||
|
| `hi_info_group` | info message highlight group name |
|
||||||
|
| `hi_warn_group` | warn message highlight group name |
|
||||||
|
| `hi_error_group` | error message highlight group name |
|
@ -2,6 +2,6 @@ Execute ( SpaceVim statusline theme ):
|
|||||||
let g:_spacevim_built_in_themes = map(split(globpath('.', 'autoload/SpaceVim/mapping/guide/theme/*.vim'), "\n"), 'fnamemodify(v:val, ":t:r")')
|
let g:_spacevim_built_in_themes = map(split(globpath('.', 'autoload/SpaceVim/mapping/guide/theme/*.vim'), "\n"), 'fnamemodify(v:val, ":t:r")')
|
||||||
for theme in g:_spacevim_built_in_themes
|
for theme in g:_spacevim_built_in_themes
|
||||||
Log 'testing theme: ' . theme
|
Log 'testing theme: ' . theme
|
||||||
AssertEqual len(call('SpaceVim#mapping#guide#theme#' . theme . '#palette', [])), 10
|
AssertEqual len(call('SpaceVim#mapping#guide#theme#' . theme . '#palette', [])), 9
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user