Comments (4)
FOLLOW UP
Considering the error messages and the fact that "hidden" option is false, it seems that coc is trying to add highlights to a non existing buffer, indeed if the function "s:add_highlights_timer" in "autoload/coc/highlight.vim", i.e.
function! s:add_highlights_timer(bufnr, ns, highlights, priority) abort
let hls = []
let next = []
for i in range(0, len(a:highlights) - 1)
if i < g:coc_highlight_maximum_count
call add(hls, a:highlights[i])
else
call add(next, a:highlights[i])
endif
endfor
call s:add_highlights(a:bufnr, a:ns, hls, a:priority)
if len(next)
call timer_start(30, {->s:add_highlights_timer(a:bufnr, a:ns, next, a:priority)})
endif
endfunction
is changed as follows:
function! s:add_highlights_timer(bufnr, ns, highlights, priority) abort
let hls = []
let next = []
for i in range(0, len(a:highlights) - 1)
if i < g:coc_highlight_maximum_count
call add(hls, a:highlights[i])
else
call add(next, a:highlights[i])
endif
endfor
if bufwinnr(a:bufnr)!=-1 " check if buffer still exists
call s:add_highlights(a:bufnr, a:ns, hls, a:priority)
endif
if len(next) && bufwinnr(a:bufnr) != -1 "check if buffer still exists
call timer_start(30, {->s:add_highlights_timer(a:bufnr, a:ns, next, a:priority)})
endif
endfunction
error messages disappear. Note that adding highlights is prevented if buffer does not exist.
I do not know whether this is an appropriate fix or not, but I hope this helps fixing this issue,
best Cristiano
from coc.nvim.
Thank you for your report. Reproduced in vim with set nohidden
, and made a PR with fix.
from coc.nvim.
Hi,
there are still problems, if you open the file "molgl.c" with vim
(using the minimal vimrc file which I uploaded) and just after having open it:
-
press arrow down key
-
press <shift-o> to enter a new line and to switch to "insert mode"
-
press <Esc>
you will get again error messages,
unfortunately, I do not any fix to suggest yet,
best C.
from coc.nvim.
FOLLOW UP:
the only fix which I found is to ignore error E964 by modifying the function "s:funcs.buf_add_highlight" in
autoload/coc/api.vim as follows:
function! s:funcs.buf_add_highlight(bufnr, srcId, hlGroup, line, colStart, colEnd, ...) abort
if a:srcId == 0
let srcId = s:max_src_id + 1
let s:max_src_id = srcId
else
let srcId = a:srcId
endif
let bufnr = a:bufnr == 0 ? bufnr('%') : a:bufnr
let type = srcId == -1 ? a:hlGroup : a:hlGroup.'_'.srcId
let types = get(s:id_types, srcId, [])
if index(types, type) == -1
call add(types, type)
let s:id_types[srcId] = types
if empty(prop_type_get(type))
call prop_type_add(type, extend({'highlight': a:hlGroup}, get(a:, 1, {})))
endif
endif
let end = a:colEnd == -1 ? strlen(get(getbufline(bufnr, a:line + 1), 0, '')) + 1 : a:colEnd + 1
if end < a:colStart + 1
return
endif
let id = s:generate_id(a:bufnr)
try
call prop_add(a:line + 1, a:colStart + 1, {'bufnr': bufnr, 'type': type, 'id': id, 'end_col': end})
catch /^Vim\%((\a\+)\)\=:\(E967\|E964\)/
" ignore 967 and 964
endtry
if a:srcId == 0
" return generated srcId
return srcId
endif
return v:null
endfunction
where in the regexp of catch statement I replaced
/^Vim\%((\a\+)\)\=:E967/
with
/^Vim\%((\a\+)\)\=:\(E967\|E964\)/
best C.
from coc.nvim.
Related Issues (20)
- How to stop annoying prompt? HOT 1
- golang lsp gofumpt HOT 1
- ✗ coc-html spawn EINVAL / ✗ coc-pyright spawn EINVAL HOT 1
- Explaining why some LSP needs plugins HOT 1
- coc format behavior differently between Neovim and Vim, create unnecessary empty change in neovim. HOT 8
- something about jumpback after gD coc-definition HOT 2
- 打开rust文件时, coc报错 HOT 3
- Hover/docstring information with custom sources HOT 2
- 为什么会代码提示会提示两次? HOT 5
- [coc.nvim] Server languageserver.ccls failed to start: Error: expected rootUri HOT 1
- Failed open exsit file with list in vim HOT 5
- The text above get seleted automatically HOT 2
- The documentation has incorrect installation instructions for NeoBundle HOT 1
- How to remove the highlights when using go references HOT 3
- LinkedEditing not work in vim HOT 1
- help: completion of variables from dotenv files in shell scripts HOT 9
- <CR> can not confirm in vimwiki and folding codes failed HOT 4
- coc.nvim takes up two shortcut keys that I prefer to use. HOT 1
- Error on notification "codeAction": code action without data HOT 4
- Asynchronous Completion for `isIncomplete` Items in coc.nvim
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coc.nvim.