Skip to content

Commit a07ac06

Browse files
committed
commit 28c08a0
28c08a0 feat(files): avoid message when nothing changed on applyEdits 11dd878 perf(keywords): not parse when completing 7b7facd fix(completion): fix word follow cursor not suggested f302272 fix(snippets): fix end selection when selection is exclusive 6346826 chore(doc): add coc-cursors section 9b64fe0 fix(files): > openResourceCommand didn't work for open cmd (#3841) 2b9f8f3 fix(files): fix check for currentOnly workspace edit 84fbafe feat(files): add configuration workspace.openResourceCommand 9c4e200 chore(doc): add sections coc-snippets and coc-workspace ee3ae97 fix(editInspect): respect native highlight group for path and lnum (#3840) 07a5369 chore(README): change logo to png file 19de46a chore(README): change logo to png file ed10bca chore(doc): remove unused configuration
1 parent e241cde commit a07ac06

File tree

5 files changed

+226
-100
lines changed

5 files changed

+226
-100
lines changed

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<a href="https://www.vim.org/scripts/script.php?script_id=5779">
3-
<img alt="Logo" src="https://alfs.chigua.cn/dianyou/data/platform/default/20220522/coc.svg" height="220" />
3+
<img alt="Logo" src="https://alfs.chigua.cn/dianyou/data/platform/default/20220525/coc.png" height="240" />
44
</a>
55
<p align="center">Make your Vim/Neovim as smart as VSCode.</p>
66
<p align="center">

autoload/coc/snippet.vim

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,20 +104,29 @@ function! coc#snippet#disable()
104104
silent! execute 'sunmap <buffer> <silent> '.nextkey
105105
endfunction
106106

107-
function! coc#snippet#select(position, text) abort
107+
function! coc#snippet#select(start, end, text) abort
108108
if pumvisible()
109109
call coc#_cancel()
110110
endif
111111
if mode() == 's'
112112
call feedkeys("\<Esc>", 'in')
113113
endif
114-
let cursor = coc#snippet#to_cursor(a:position)
115-
call cursor([cursor[0], cursor[1] - (&selection !~# 'exclusive')])
116-
let len = strchars(a:text) - (&selection !~# 'exclusive')
117-
let cmd = ''
118-
let cmd .= mode()[0] ==# 'i' ? "\<Esc>l" : ''
119-
let cmd .= printf('v%s', len > 0 ? len . 'h' : '')
120-
let cmd .= "o\<C-g>"
114+
if &selection ==# 'exclusive'
115+
let cursor = coc#snippet#to_cursor(a:start)
116+
call cursor([cursor[0], cursor[1]])
117+
let cmd = ''
118+
let cmd .= mode()[0] ==# 'i' ? "\<Esc>".(col('.') == 1 ? '' : 'l') : ''
119+
let cmd .= printf('v%s', strchars(a:text) . 'l')
120+
let cmd .= "\<C-g>"
121+
else
122+
let cursor = coc#snippet#to_cursor(a:end)
123+
call cursor([cursor[0], cursor[1] - 1])
124+
let len = strchars(a:text) - 1
125+
let cmd = ''
126+
let cmd .= mode()[0] ==# 'i' ? "\<Esc>l" : ''
127+
let cmd .= printf('v%s', len > 0 ? len . 'h' : '')
128+
let cmd .= "o\<C-g>"
129+
endif
121130
call feedkeys(cmd, 'n')
122131
endfunction
123132

build/index.js

Lines changed: 24 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

data/schema.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,11 @@
10551055
"maximum": 100,
10561056
"description": "Winblend option of notification window, neovim only."
10571057
},
1058+
"workspace.openResourceCommand": {
1059+
"type": "string",
1060+
"default": "tab drop",
1061+
"description": "Command to open files that not loaded, load files as hidden buffers when empty."
1062+
},
10581063
"workspace.ignoredFiletypes": {
10591064
"type": "array",
10601065
"default": [],
@@ -1422,12 +1427,6 @@
14221427
"default": "10MB",
14231428
"description": "Maximum file size in bytes that coc.nvim should handle, default '10MB'"
14241429
},
1425-
"coc.preferences.listOfWorkspaceEdit": {
1426-
"type": "string",
1427-
"default": "quickfix",
1428-
"description": "List should contains changed locations after workspace edit, default to vim's quickfix",
1429-
"enum": ["quickfix", "location", "none"]
1430-
},
14311430
"coc.preferences.useQuickfixForLocations": {
14321431
"type": "boolean",
14331432
"description": "Use vim's quickfix list for jump locations,\n need restart on change.",
@@ -1462,11 +1461,6 @@
14621461
"type": "string"
14631462
}
14641463
},
1465-
"coc.preferences.enableFloatHighlight": {
1466-
"type": "boolean",
1467-
"description": "Enable highlight for floating window.",
1468-
"default": true
1469-
},
14701464
"coc.preferences.rootPatterns": {
14711465
"type": "array",
14721466
"default": [".git", ".hg", ".projections.json"],

0 commit comments

Comments
 (0)