Skip to content

Commit

Permalink
commit 3dc6153
Browse files Browse the repository at this point in the history
3dc6153 Correct spelling `resutl` to `result` (#4711)
3d14e72 chore(deps): bump word-wrap from 1.2.3 to 1.2.4 (#4706)
2280f9a chore(deps): bump semver from 7.5.0 to 7.5.2 (#4685)
1df60fc docs: fix wrong prefix of CocList command options, ref commit 1d3b424 (#4631)
537f12b fix(rpc): fix unknown function error (#4675)
2a0e554 feat(ci): test with nvim nightly (#4661)
edcc376 chore(README): improve mappings (#4510)
0df7380 fix(notify): use nvim_buf_set_lines for nvim (#4542)
5704b37 chore(exception): typo workspaceContains (#4545)
19c782e chore(yarn): upgrade dev-dependencies (#4627)
e51a7cd fix(list): fix opening an empty buffer in the help action of the extensions (#4652)
3014125 feat: add coc.preferences.tagDefinitionTimeout (#4601)
43f4daa fix(util): properly escape breakat (#4597)
628f08a fix: hide list correctly on vim (#4584)
94dc105 fix(api): Fix Buffer.getVar() for non-current buffer (#4569)
b28b8dc fix(util): patchLine, byte aligned (#4526)
79e9e04 Fix typos and grammatical errors (#4521)
59a942d docs: fix typo termainal -> terminal (#4514)
8c0d3ef fix(semanticTokens): make indexing of highlight groups more consistent (#4500)
  • Loading branch information
chemzqm committed Jul 26, 2023
1 parent bbaa1d5 commit 9332d2a
Show file tree
Hide file tree
Showing 9 changed files with 227 additions and 215 deletions.
19 changes: 8 additions & 11 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<a href="https://www.vim.org/scripts/script.php?script_id=5779">
<img alt="Logo" src="https://alfs.chigua.cn/dianyou/data/platform/default/20220525/coc.png" height="240" />
</a>
<p align="center">Make your Vim/Neovim as smart as VSCode</p>
<p align="center">Make your Vim/Neovim as smart as VS Code</p>
<p align="center">
<a href="LICENSE.md"><img alt="Software License" src="https://img.shields.io/badge/license-Anti%20996-brightgreen.svg?style=flat-square"></a>
<a href="https://github.com/neoclide/coc.nvim/actions"><img alt="Actions" src="https://img.shields.io/github/actions/workflow/status/neoclide/coc.nvim/ci.yml?style=flat-square&branch=master"></a>
Expand All @@ -14,7 +14,7 @@

---

<img alt="Gif" src="https://alfs.chigua.cn/dianyou/data/platform/default/20220801/2022-08-01%2002-14-03.2022-08-01%2002_15_16.gif" width="60%" />
<img alt="Custom coc popup menu with snippet support" src="https://alfs.chigua.cn/dianyou/data/platform/default/20220801/2022-08-01%2002-14-03.2022-08-01%2002_15_16.gif" width="60%" />

_Custom popup menu with snippet support_

Expand All @@ -38,7 +38,7 @@ curl -sL install-node.vercel.app/lts | bash
For [vim-plug](https://github.com/junegunn/vim-plug) users:

```vim
" Use release branch (recommend)
" Use release branch (recommended)
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Or build from source code by using yarn: https://yarnpkg.com
Expand All @@ -51,15 +51,14 @@ Checkout [Install
coc.nvim](https://github.com/neoclide/coc.nvim/wiki/Install-coc.nvim) for
more info.

You **have to** install coc extension or configure language servers for
You **have to** install coc extensions or configure language servers for
LSP support.

Install extensions like:
Install extensions like this:

:CocInstall coc-json coc-tsserver

Or configure language server in `coc-settings.json` opened by
`:CocConfig`, like:
Or you can configure a language server in your `coc-settings.json`(open it using `:CocConfig`) like this:

```json
{
Expand Down Expand Up @@ -90,7 +89,7 @@ Configuration is required to make coc.nvim easier to work with, since it
doesn't change your key-mappings or Vim options. This is done as much as
possible to avoid conflict with your other plugins.

**❗️Important**: Some Vim plugins could change key mappings. Please use
**❗️Important**: Some Vim plugins can change your key mappings. Please use
command like`:verbose imap <tab>` to make sure that your keymap has taken effect.

```vim
Expand Down Expand Up @@ -367,10 +366,8 @@ keyset("n", "<leader>a", "<Plug>(coc-codeaction-selected)", opts)

-- Remap keys for apply code actions at the cursor position.
keyset("n", "<leader>ac", "<Plug>(coc-codeaction-cursor)", opts)
-- Remap keys for apply code actions affect whole buffer.
-- Remap keys for apply source code actions for current file.
keyset("n", "<leader>as", "<Plug>(coc-codeaction-source)", opts)
-- Remap keys for applying codeActions to the current buffer
keyset("n", "<leader>ac", "<Plug>(coc-codeaction)", opts)
-- Apply the most preferred quickfix action on the current line.
keyset("n", "<leader>qf", "<Plug>(coc-fix-current)", opts)

Expand Down
9 changes: 3 additions & 6 deletions autoload/coc/api.vim
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ endfunction

function! s:funcs.buf_get_var(bufnr, name)
call s:check_bufnr(a:bufnr)
if !has_key(b:, a:name)
if !has_key(getbufvar(a:bufnr, ''), a:name)
throw 'Key not found: '.a:name
endif
return getbufvar(a:bufnr, a:name)
Expand All @@ -616,11 +616,8 @@ endfunction

function! s:funcs.buf_del_var(bufnr, name)
call s:check_bufnr(a:bufnr)
if a:bufnr == bufnr('%')
execute 'unlet! b:'.a:name
else
call s:buf_execute(a:bufnr, ['unlet! b:'.a:name])
endif
let bufvars = getbufvar(a:bufnr, '')
call remove(bufvars, a:name)
return v:null
endfunction

Expand Down
8 changes: 6 additions & 2 deletions autoload/coc/notify.vim
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,12 @@ function! s:progress(winid, total, curr, index) abort
if !empty(message)
let lines = lines + coc#string#reflow(split(message, '\v\r?\n'), width)
endif
noa call setbufline(bufnr, 1, lines)
noa call deletebufline(bufnr, len(lines) + 1, '$')
if has('nvim')
call nvim_buf_set_lines(bufnr, 0, -1, v:false, lines)
else
noa call setbufline(bufnr, 1, lines)
noa call deletebufline(bufnr, len(lines) + 1, '$')
endif
let height = option['height']
let delta = len(lines) - height
if delta > 0 && height < 3
Expand Down
2 changes: 1 addition & 1 deletion autoload/coc/rpc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ endfunction

function! coc#rpc#request_async(method, args, cb) abort
if !coc#rpc#ready()
return cb('coc.nvim service not started.')
return call(a:cb, ['coc.nvim service not started.'])
endif
call s:client['request_async'](a:method, a:args, a:cb)
endfunction
Expand Down
2 changes: 1 addition & 1 deletion autoload/coc/string.vim
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ endfunction
" Used when 'wrap' and 'linebreak' is enabled
function! coc#string#content_height(lines, width) abort
let len = 0
let pattern = empty(&breakat) ? '.\zs' : '['.substitute(&breakat, '\([\[\]]\)', '\\\1', 'g').']\zs'
let pattern = empty(&breakat) ? '.\zs' : '['.substitute(&breakat, '\([\[\]\-]\)', '\\\1', 'g').']\zs'
for line in a:lines
if strwidth(line) <= a:width
let len += 1
Expand Down
347 changes: 177 additions & 170 deletions build/index.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions doc/coc-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ Colors~
*coc-config-colors*
"colors.enable" *coc-config-colors-enable*

Enable colors highlight feature, for termainal vim, 'termguicolors'
option should be enabled and the termainal support gui colors.
Enable colors highlight feature, for terminal vim, 'termguicolors'
option should be enabled and the terminal support gui colors.

Scope: `language-overridable`, default: `false`

Expand Down Expand Up @@ -1650,6 +1650,11 @@ Preferences~

Scope: `application`, default: `500`

"coc.preferences.tagDefinitionTimeout" *coc-preferences-tagDefinitionTimeout*

The timeout of CocTagFunc.
Scope: `application`, default: `0`

------------------------------------------------------------------------------
Float configuration~
*coc-config-float*
Expand Down
44 changes: 23 additions & 21 deletions doc/coc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2376,7 +2376,7 @@ CocActionAsync({action}, [...{args}, [{callback}]])

When callback function exists as the last argument, the callback
function is called with `error` string as the first argument and
`resutl` as the second argument. When no callback exists, error
`result` as the second argument. When no callback exists, error
message would be echoed.

Checkout |coc-actions| for available actions.
Expand Down Expand Up @@ -3497,49 +3497,52 @@ LIST COMMAND *coc-list-command*
*coc-list-options*
Options of CocList command~

----top
--top

Show list as top window.

----tab
--tab

Open list in new tabpage.

----normal
--normal

Start list in normal mode, recommended for short list.

----no-sort
--no-sort

Disable sort made by fuzzy score or most recently used, use it when
it's already sorted.

----input={input}
--input={input}

Specify the input on session start.

----height={number}
--height={number}

Specify the height of list window, override configuration
|coc-config-list-height|. No effect when list opened in new tab by
`--tab`.

----strict
-S
--strict, -S

Use strict matching instead of fuzzy matching.

----regex
-R
--regex, -R

Use regex matching instead of fuzzy matching.

----ignore-case
--ignore-case

Ignore case when using strict matching or regex matching.

----number-select
-N
--number-select, -N

Type a line number to select an item and invoke the default action on
insert mode. Type `0` to select the 10th line.

----interactive
-I
--interactive, -I

Use interactive mode, list items would be reloaded on input
change, filter and sort would be done by list implementation.

Expand All @@ -3549,23 +3552,22 @@ Options of CocList command~
means options including `--strict`, `--no-sort`, `--regex`,
`--ignore-case` would not work at all.

----auto-preview
-A
--auto-preview, -A

Start a preview for the current item on the visible list.

----no-quit
--no-quit

Not quit list session after invoke action.

Note: you may need to refresh the list for current state.

----first
--first

Invoke default action for first list item on list open.
Nothing happens when the list is empty.

----reverse
--reverse

Reverse the order of list items shown in the window, the bottom line
would shown the first item.
Expand Down
2 changes: 1 addition & 1 deletion plugin/coc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function! s:checkVersion() abort
else
if !has('nvim-0.5.0') && !has('patch-8.2.0750')
echohl WarningMsg
echom "coc.nvim works best on vim >= 8.2.0750 and neovim >= 0.5.0, consider upgrade your vim."
echom "coc.nvim works best on vim >= 8.2.0750 and neovim >= 0.5.0, consider upgrading vim."
echom "You can add this to your vimrc to avoid this message:"
echom " let g:coc_disable_startup_warning = 1"
echom "Note that some features may behave incorrectly."
Expand Down

0 comments on commit 9332d2a

Please sign in to comment.