To: vim_dev@googlegroups.com Subject: Patch 8.2.3876 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3876 Problem: 'cindent' does not recognize inline namespace. Solution: Skip over "inline" to find "namespace". (closes #9383) Files: src/cindent.c, src/testdir/test_cindent.vim *** ../vim-8.2.3875/src/cindent.c 2021-12-12 14:16:34.989862195 +0000 --- src/cindent.c 2021-12-22 20:52:44.281419157 +0000 *************** *** 755,760 **** --- 755,764 ---- int has_name_start = FALSE; s = cin_skipcomment(s); + + if (STRNCMP(s, "inline", 6) == 0 && (s[6] == NUL || !vim_iswordc(s[6]))) + s = cin_skipcomment(skipwhite(s + 6)); + if (STRNCMP(s, "namespace", 9) == 0 && (s[9] == NUL || !vim_iswordc(s[9]))) { p = cin_skipcomment(skipwhite(s + 9)); *** ../vim-8.2.3875/src/testdir/test_cindent.vim 2021-12-12 14:16:34.993862200 +0000 --- src/testdir/test_cindent.vim 2021-12-22 20:52:44.281419157 +0000 *************** *** 996,1001 **** --- 996,1010 ---- 22222222222222222; } } + inline namespace { + 111111111111111111; + } + inline /* test */ namespace { + 111111111111111111; + } + inline/* test */namespace { + 111111111111111111; + } /* invalid namespaces use block indent */ namespace test test2 { *************** *** 1019,1024 **** --- 1028,1036 ---- { 111111111111111111; } + inlinenamespace { + 111111111111111111; + } void getstring() { /* Raw strings */ *************** *** 1961,1966 **** --- 1973,1987 ---- 22222222222222222; } } + inline namespace { + 111111111111111111; + } + inline /* test */ namespace { + 111111111111111111; + } + inline/* test */namespace { + 111111111111111111; + } /* invalid namespaces use block indent */ namespace test test2 { *************** *** 1984,1989 **** --- 2005,2013 ---- { 111111111111111111; } + inlinenamespace { + 111111111111111111; + } void getstring() { /* Raw strings */ *************** *** 4358,4363 **** --- 4382,4396 ---- 22222222222222222; } } + inline namespace { + 111111111111111111; + } + inline /* test */ namespace { + 111111111111111111; + } + inline/* test */namespace { + 111111111111111111; + } /* invalid namespaces use block indent */ namespace test test2 { *************** *** 4381,4386 **** --- 4414,4422 ---- { 111111111111111111; } + inlinenamespace { + 111111111111111111; + } NAMESPACEEND [CODE] *************** *** 4449,4454 **** --- 4485,4499 ---- 22222222222222222; } } + inline namespace { + 111111111111111111; + } + inline /* test */ namespace { + 111111111111111111; + } + inline/* test */namespace { + 111111111111111111; + } /* invalid namespaces use block indent */ namespace test test2 { *************** *** 4472,4477 **** --- 4517,4525 ---- { 111111111111111111; } + inlinenamespace { + 111111111111111111; + } NAMESPACEEND [CODE] *** ../vim-8.2.3875/src/version.c 2021-12-22 20:29:06.232685076 +0000 --- src/version.c 2021-12-22 20:54:30.253190855 +0000 *************** *** 751,752 **** --- 751,754 ---- { /* Add new patch number below this line */ + /**/ + 3876, /**/ -- From "know your smileys": 8<}} Glasses, big nose, beard /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///