patch 9.1.1689: CmdlineChanged not triggered by <Del>

Problem:  CmdlineChanged not triggered by <Del>
Solution: Use STRCMP() instead of STRNCMP()
          (Shougo Matsushita)

closes: #18101

Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Shougo Matsushita
2025-08-26 17:36:49 +02:00
committed by Christian Brabandt
parent a19b019b87
commit 540480697d
3 changed files with 16 additions and 3 deletions

View File

@ -1855,7 +1855,7 @@ getcmdline_int(
if (ccline.cmdbuff != NULL)
{
prev_cmdbuff = vim_strnsave(ccline.cmdbuff, ccline.cmdpos);
prev_cmdbuff = vim_strsave(ccline.cmdbuff);
if (prev_cmdbuff == NULL)
goto returncmd;
}
@ -2622,8 +2622,8 @@ cmdline_changed:
// Trigger CmdlineChanged autocommands.
if (trigger_cmdlinechanged
&& (ccline.cmdpos != prev_cmdpos
|| (prev_cmdbuff != NULL && STRNCMP(prev_cmdbuff,
ccline.cmdbuff, prev_cmdpos) != 0)))
|| (prev_cmdbuff != NULL &&
STRCMP(prev_cmdbuff, ccline.cmdbuff) != 0)))
trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINECHANGED);
// Trigger CursorMovedC autocommands.