diff --git a/rc/core/c-family.kak b/rc/core/c-family.kak index 293c7335e..4924edd69 100644 --- a/rc/core/c-family.kak +++ b/rc/core/c-family.kak @@ -54,7 +54,7 @@ def -hidden _c-family-indent-on-newline %[ eval -draft -itersel %[ ## indent after an opening brace try %[ exec -draft K s\{\h*$ j ] ## indent after a label - try %[ exec -draft K s[a-zA-Z0-9_-]+:\h*$ j ] + try %[ exec -draft k s[a-zA-Z0-9_-]+:\h*$ j ] ## indent after a statement not followed by an opening brace try %[ exec -draft k \b(if|else|for|while)\h*\(.+?\)\h*$ j ] ## align to the opening parenthesis on a previous line if its followed by text on the same line diff --git a/test/regression/872-indentation-misbeahviour-c++/cmd b/test/regression/872-indentation-misbeahviour-c++/cmd new file mode 100644 index 000000000..54aed4f85 --- /dev/null +++ b/test/regression/872-indentation-misbeahviour-c++/cmd @@ -0,0 +1 @@ +i diff --git a/test/regression/872-indentation-misbeahviour-c++/in b/test/regression/872-indentation-misbeahviour-c++/in new file mode 100644 index 000000000..8e0399c37 --- /dev/null +++ b/test/regression/872-indentation-misbeahviour-c++/in @@ -0,0 +1,9 @@ +class foo { + %(p)rivate: + int a; + int b; + public: + foo() {} + void bar() { + } +}; diff --git a/test/regression/872-indentation-misbeahviour-c++/out b/test/regression/872-indentation-misbeahviour-c++/out new file mode 100644 index 000000000..de1fbda91 --- /dev/null +++ b/test/regression/872-indentation-misbeahviour-c++/out @@ -0,0 +1,10 @@ +class foo { + + private: + int a; + int b; + public: + foo() {} + void bar() { + } +}; diff --git a/test/regression/872-indentation-misbeahviour-c++/rc b/test/regression/872-indentation-misbeahviour-c++/rc new file mode 100644 index 000000000..b2602daae --- /dev/null +++ b/test/regression/872-indentation-misbeahviour-c++/rc @@ -0,0 +1,4 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/core/formatter.kak" +source "%val{runtime}/rc/core/c-family.kak" +set buffer filetype cpp