From 747dec7925e130e754cf5ef1db87dd8747923514 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 15 Aug 2022 21:12:42 +0800 Subject: [PATCH] vim-patch:8.2.3392: augroup completion escapes regexp pattern characters Problem: augroup completion escapes regexp pattern characters. Solution: Do not escape the augroup name. (closes vim/vim#8826) https://github.com/vim/vim/commit/b4d82e2a8d610c00139a74970df772eece2daf1c --- src/nvim/ex_getln.c | 4 ++-- src/nvim/testdir/test_cmdline.vim | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 80c774c1c5..aaa710245b 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -5285,8 +5285,8 @@ static int ExpandFromContext(expand_T *xp, char_u *pat, int *num_file, char ***f { EXPAND_SYNTAX, get_syntax_name, true, true }, { EXPAND_SYNTIME, get_syntime_arg, true, true }, { EXPAND_HIGHLIGHT, (ExpandFunc)get_highlight_name, true, true }, - { EXPAND_EVENTS, expand_get_event_name, true, true }, - { EXPAND_AUGROUP, expand_get_augroup_name, true, true }, + { EXPAND_EVENTS, expand_get_event_name, true, false }, + { EXPAND_AUGROUP, expand_get_augroup_name, true, false }, { EXPAND_CSCOPE, get_cscope_name, true, true }, { EXPAND_SIGN, get_sign_name, true, true }, { EXPAND_PROFILE, get_profile_name, true, true }, diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index f1ca6dadfe..b9eefa937a 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -925,11 +925,13 @@ func Test_cmdline_complete_various() call delete('Xfile2') " completion for the :augroup command - augroup XTest + augroup XTest.test augroup END call feedkeys(":augroup X\\\"\", 'xt') - call assert_equal("\"augroup XTest", @:) - augroup! XTest + call assert_equal("\"augroup XTest.test", @:) + call feedkeys(":au X\\\"\", 'xt') + call assert_equal("\"au XTest.test", @:) + augroup! XTest.test " completion for the :unlet command call feedkeys(":unlet one two\\\"\", 'xt')