From 63aa167f944b147b9d4b8c417a37f4beb212d984 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 24 Jan 2025 06:44:23 +0800 Subject: vim-patch:9.1.1049: insert-completed items are always sorted Problem: insert-completed items are always sorted, although the LSP spec[1] standard defines sortText in the returned completionitem list. This means that the server has sorted the results. When fuzzy is enabled, this will break the server's sorting results. Solution: disable sorting of candidates when "nosort" is set in 'completeopt' [1] https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItem closes: vim/vim#16501 https://github.com/vim/vim/commit/f400a0cc41113eb75516bdd7f38aeaa15208ba2c Co-authored-by: glepnir --- runtime/lua/vim/_meta/options.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/lua/vim/_meta/options.lua') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 107b1ffdfb..f0f0d1a768 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -1098,6 +1098,10 @@ vim.go.cia = vim.go.completeitemalign --- list of alternatives, but not how the candidates are --- collected (using different completion types). --- +--- nosort Disable sorting of completion candidates based on fuzzy +--- scores when "fuzzy" is enabled. Candidates will appear +--- in their original order. +--- --- @type string vim.o.completeopt = "menu,preview" vim.o.cot = vim.o.completeopt -- cgit