Skip to content

Commit

Permalink
commit 69e029e
Browse files Browse the repository at this point in the history
69e029e feat(plugin): support color items in g:terminal_ansi_colors
5c72abf chore(highlight): use keepend for CodeBlock region
9be0d9e fix(doc): typo (#3116)
1c25102 fix(autoload): allow synmaxcolumn to be 0 (#3113)
456692f (docs)schema: allow custom coc.preferences.jumpCommand values (#3107)
0acc21f fix(workspace): check doc.uri equal or not (#3106)
  • Loading branch information
chemzqm committed Jun 4, 2021
1 parent 1a74bf3 commit 06d950e
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 32 deletions.
8 changes: 6 additions & 2 deletions autoload/coc/highlight.vim
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ function! coc#highlight#ranges(bufnr, key, hlGroup, ranges) abort
if !bufloaded(bufnr) || !exists('*getbufline')
return
endif
let synmaxcol = min([getbufvar(a:bufnr, '&synmaxcol', 1000), 1000])
let synmaxcol = getbufvar(a:bufnr, '&synmaxcol', 1000)
if synmaxcol == 0
let synmaxcol = 1000
endif
let synmaxcol = min([synmaxcol, 1000])
let srcId = s:create_namespace(a:key)
for range in a:ranges
let start = range['start']
Expand Down Expand Up @@ -132,7 +136,7 @@ function! coc#highlight#highlight_lines(winid, blocks) abort
endif
call add(defined, filetype)
endif
call s:execute(a:winid, 'syntax region CodeBlock'.region_id.' start=/\%'.start.'l/ end=/\%'.end.'l/ contains=@'.toupper(filetype))
call s:execute(a:winid, 'syntax region CodeBlock'.region_id.' start=/\%'.start.'l/ end=/\%'.end.'l/ contains=@'.toupper(filetype).' keepend')
let region_id = region_id + 1
endif
endfor
Expand Down
Loading

0 comments on commit 06d950e

Please sign in to comment.