Skip to content

Commit a776085

Browse files
docs: update configs.md
skip-checks: true
1 parent f8af0d3 commit a776085

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

doc/configs.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4935,19 +4935,17 @@ vim.api.nvim_create_autocmd('LspAttach', {
49354935

49364936
-- Tab to accept suggestion
49374937
vim.keymap.set('i', '<Tab>', function()
4938-
if vim.lsp.inline_completion.is_visible() then
4939-
return vim.lsp.inline_completion.accept()
4940-
else
4938+
if not vim.lsp.inline_completion.get() then
49414939
return '<Tab>'
49424940
end
49434941
end, { expr = true, buffer = bufnr, desc = 'GitLab Duo: Accept suggestion' })
49444942

49454943
-- Alt/Option+[ for previous suggestion
4946-
vim.keymap.set('i', '<M-[>', vim.lsp.inline_completion.select_prev,
4944+
vim.keymap.set('i', '<M-[>', function() vim.lsp.inline_completion.select({ count = -1 }) end,
49474945
{ buffer = bufnr, desc = 'GitLab Duo: Previous suggestion' })
49484946

49494947
-- Alt/Option+] for next suggestion
4950-
vim.keymap.set('i', '<M-]>', vim.lsp.inline_completion.select_next,
4948+
vim.keymap.set('i', '<M-]>', function() vim.lsp.inline_completion.select({ count = 1 }) end,
49514949
{ buffer = bufnr, desc = 'GitLab Duo: Next suggestion' })
49524950
end
49534951
end
@@ -4990,8 +4988,8 @@ Default config:
49904988
}
49914989
}
49924990
```
4993-
- `on_attach`: [../lsp/gitlab_duo.lua:317](../lsp/gitlab_duo.lua#L317)
4994-
- `on_init`: [../lsp/gitlab_duo.lua:317](../lsp/gitlab_duo.lua#L317)
4991+
- `on_attach`: [../lsp/gitlab_duo.lua:315](../lsp/gitlab_duo.lua#L315)
4992+
- `on_init`: [../lsp/gitlab_duo.lua:315](../lsp/gitlab_duo.lua#L315)
49954993
- `root_markers` :
49964994
```lua
49974995
{ ".git" }

doc/configs.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3511,19 +3511,17 @@ Inline Completion Example >lua
35113511

35123512
-- Tab to accept suggestion
35133513
vim.keymap.set('i', '<Tab>', function()
3514-
if vim.lsp.inline_completion.is_visible() then
3515-
return vim.lsp.inline_completion.accept()
3516-
else
3514+
if not vim.lsp.inline_completion.get() then
35173515
return '<Tab>'
35183516
end
35193517
end, { expr = true, buffer = bufnr, desc = 'GitLab Duo: Accept suggestion' })
35203518

35213519
-- Alt/Option+[ for previous suggestion
3522-
vim.keymap.set('i', '<M-[>', vim.lsp.inline_completion.select_prev,
3520+
vim.keymap.set('i', '<M-[>', function() vim.lsp.inline_completion.select({ count = -1 }) end,
35233521
{ buffer = bufnr, desc = 'GitLab Duo: Previous suggestion' })
35243522

35253523
-- Alt/Option+] for next suggestion
3526-
vim.keymap.set('i', '<M-]>', vim.lsp.inline_completion.select_next,
3524+
vim.keymap.set('i', '<M-]>', function() vim.lsp.inline_completion.select({ count = 1 }) end,
35273525
{ buffer = bufnr, desc = 'GitLab Duo: Next suggestion' })
35283526
end
35293527
end
@@ -3558,8 +3556,8 @@ Default config:
35583556
version = "0.13.0"
35593557
}
35603558
}
3561-
- on_attach (use "gF" to view): ../lsp/gitlab_duo.lua:317
3562-
- on_init (use "gF" to view): ../lsp/gitlab_duo.lua:317
3559+
- on_attach (use "gF" to view): ../lsp/gitlab_duo.lua:315
3560+
- on_init (use "gF" to view): ../lsp/gitlab_duo.lua:315
35633561
- root_markers: >lua
35643562
{ ".git" }
35653563
- settings: >lua

0 commit comments

Comments
 (0)