Skip to content

Commit

Permalink
commit c1a97aa
Browse files Browse the repository at this point in the history
c1a97aa fix(source-language): fix bad range
19d68d3 fix(document): fix lines may not synchronized
aea0b97 chore(test): avoid test failure
e53dd0b fix(document): check bad range for applyEdits
5c703fa fix(semanticTokens): avoid unexpected cancel
49c570a refactor(completion): remove suggest.numberSelect
5b2c907 fix(completion): avoid refresh when selected
1b06063 feat(diagnostics): add config diagnostics.virtualTextLevel
baf6a41 fix(semanticTokens): range highlight when necessary
3f6dc4e chore(core): add more tests
ac7d0c1 refactor(index): use module.exports
  • Loading branch information
chemzqm committed Jan 31, 2022
1 parent 3f6cab4 commit 679b32c
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 141 deletions.
5 changes: 5 additions & 0 deletions autoload/coc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ let s:is_vim = !has('nvim')
let s:error_sign = get(g:, 'coc_status_error_sign', has('mac') ? '' : 'E')
let s:warning_sign = get(g:, 'coc_status_warning_sign', has('mac') ? '⚠️ ' : 'W')
let s:select_api = exists('*nvim_select_popupmenu_item')
let s:complete_info_api = exists('*complete_info')
let s:callbacks = {}

function! coc#expandable() abort
Expand Down Expand Up @@ -63,6 +64,10 @@ function! coc#_complete() abort
endfunction

function! coc#_do_complete(start, items, preselect)
" Refresh with selected item would cause unexpected CompleteDone
if s:complete_info_api && get(complete_info(['selected']), 'selected', -1) != -1 && &completeopt =~# 'noselect'
return
endif
let g:coc#_context = {
\ 'start': a:start,
\ 'candidates': a:items,
Expand Down
2 changes: 1 addition & 1 deletion autoload/coc/util.vim
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ endfunction

" used by vim
function! coc#util#get_buf_lines(bufnr, changedtick)
if !bufloaded(a:bufnr)
if !bufloaded(a:bufnr)
return v:null
endif
let changedtick = getbufvar(a:bufnr, 'changedtick')
Expand Down
258 changes: 128 additions & 130 deletions build/index.js

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions data/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,6 @@
"default": 99,
"description": "Priority of language sources."
},
"suggest.numberSelect": {
"type": "boolean",
"description": "Input number to select complete item, works on neovim >= 0.4.0 only.",
"default": false
},
"suggest.disableKind": {
"type": "boolean",
"description": "Remove kind field from vim complete item.",
Expand Down Expand Up @@ -682,6 +677,12 @@
"description": "Use NeoVim virtual text to display diagnostics",
"default": false
},
"diagnostic.virtualTextLevel": {
"type": ["string", "null"],
"description": "Filter diagnostic message in virtual text by level",
"default": null,
"enum": ["hint", "information", "warning", "error"]
},
"diagnostic.virtualTextAlignRight": {
"type": "boolean",
"description": "Make virtual text align to the right of window.",
Expand Down
9 changes: 4 additions & 5 deletions doc/coc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,6 @@ Built-in configurations:~

Priority of language sources, default: `99`

"suggest.numberSelect":~

Input number to select complete item, it could be wrong when
using '<up>' and '<down>' to select complete item, default: `false`

"suggest.disableKind":~

Remove kind field from Vim complete item, default: `false`
Expand Down Expand Up @@ -496,6 +491,10 @@ Built-in configurations:~

Use Neovim virtual text to display diagnostics, default: `false`

"diagnostic.virtualTextLevel":~

Filter diagnostic message in virtual text by level, default: `null`

"diagnostic.virtualTextAlignRight":~

Make virtual text align to the right of window, default: `false`
Expand Down
5 changes: 5 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2022-01-30

- Add configuration `diagnostics.virtualTextLevel`.
- Remove configuration `suggest.numberSelect`

# 2022-01-26

- Use `nvim_buf_set_text` when possible to keep extmarks.
Expand Down

0 comments on commit 679b32c

Please sign in to comment.