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: #16501
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 50ef430..599f903 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 9.1. Last change: 2025 Jan 21
+*options.txt* For Vim version 9.1. Last change: 2025 Jan 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2164,6 +2164,10 @@
characters can be skipped and matches can be found even
if the exact sequence is not typed.
+ nosort Disable sorting of completion candidates based on fuzzy
+ scores when "fuzzy" is enabled. Candidates will appear
+ in their original order.
+
*'completepopup'* *'cpp'*
'completepopup' 'cpp' string (default empty)
global
diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index 6cbd102..2f2ab5a 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -1,4 +1,4 @@
-*version9.txt* For Vim version 9.1. Last change: 2025 Jan 18
+*version9.txt* For Vim version 9.1. Last change: 2025 Jan 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -41560,15 +41560,17 @@
Support for the XDG Desktop Specification |xdg-base-dir|
-Support highlighting the matched text for insert-mode completion and
-command-line completion in |ins-completion-menu|.
-
-Support highlighting the completion kind in |ins-completion-menu|, see
-|complete-items|.
-
Support for translating messages in Vim script plugins using the |gettext()|
and |bindtextdomain()| functions.
+Support highlighting the matched text and the completion kind for insert-mode
+completion and command-line completion in |ins-completion-menu|, see
+|complete-items|
+
+Include the "linematch" algorithm for the 'diffopt' setting. This aligns
+changes between buffers on similar lines improving the diff highlighting in
+Vim
+
*changed-9.2*
Changed~
-------
@@ -41623,9 +41625,7 @@
the "matches" key
- |v:stacktrace| The stack trace of the exception most recently caught and
not finished
-- include the linematch algorithm for the 'diffopt' setting. This aligns
- changes between buffers on similar lines improving the diff highlighting in
- Vim
+- New option value "nosort" for 'completeopt'
*added-9.2*
Added ~