Patch 9.0.1426
Problem: Indent wrong after "export namespace" in C++.
Solution: Skip over "inline" and "export" in any order. (Virginia Senioria,
closes #12134, closes #12133)
Files: src/cindent.c, src/testdir/test_cindent.vim
*** ../vim-9.0.1425/src/cindent.c 2023-01-22 21:14:32.613863616 +0000
--- src/cindent.c 2023-03-24 19:24:04.260005272 +0000
***************
*** 769,775 ****
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])))
--- 769,777 ----
s = cin_skipcomment(s);
! // skip over "inline" and "export" in any order
! while ((STRNCMP(s, "inline", 6) == 0 || STRNCMP(s, "export", 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])))
*** ../vim-9.0.1425/src/testdir/test_cindent.vim 2022-05-21
21:24:02.000000000 +0100
--- src/testdir/test_cindent.vim 2023-03-24 19:21:11.407760413 +0000
***************
*** 4406,4411 ****
--- 4406,4423 ----
inline/* test */namespace {
111111111111111111;
}
+ export namespace {
+ 111111111111111111;
+ }
+ export inline namespace {
+ 111111111111111111;
+ }
+ export/* test */inline namespace {
+ 111111111111111111;
+ }
+ inline export namespace {
+ 111111111111111111;
+ }
/* invalid namespaces use block indent */
namespace test test2 {
***************
*** 4509,4514 ****
--- 4521,4538 ----
inline/* test */namespace {
111111111111111111;
}
+ export namespace {
+ 111111111111111111;
+ }
+ export inline namespace {
+ 111111111111111111;
+ }
+ export/* test */inline namespace {
+ 111111111111111111;
+ }
+ inline export namespace {
+ 111111111111111111;
+ }
/* invalid namespaces use block indent */
namespace test test2 {
*** ../vim-9.0.1425/src/version.c 2023-03-23 15:45:42.808274880 +0000
--- src/version.c 2023-03-24 19:22:48.867902719 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1426,
/**/
--
FATHER: Did you kill all those guards?
LAUNCELOT: Yes ... I'm very sorry ...
FATHER: They cost fifty pounds each!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20230324192613.257A91C0655%40moolenaar.net.