patch 9.1.1518: getcompletiontype() may crash

Problem:  getcompletiontype() crashes when no completion is available
          (after v9.1.1509).
Solution: Don't call set_expand_context() (zeertzjq)

fixes: #17681
closes: #17684

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2025-07-06 20:26:56 +02:00
committed by Christian Brabandt
parent d6a5edd613
commit e2c0f81dd0
8 changed files with 53 additions and 50 deletions

View File

@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.1. Last change: 2025 Jul 05
*builtin.txt* For Vim version 9.1. Last change: 2025 Jul 06
VIM REFERENCE MANUAL by Bram Moolenaar
@ -4212,8 +4212,8 @@ getcmdcompltype() *getcmdcompltype()*
|getcmdprompt()|, |getcmdcomplpat()| and |setcmdline()|.
Returns an empty string when completion is not defined.
To get the type of the command-line completion for the
specified string, use |getcompletiontype()|.
To get the type of the command-line completion for a specified
string, use |getcompletiontype()|.
Return type: |String|