diff --git a/CodeCompletion/CodeFormatter.cs b/CodeCompletion/CodeFormatter.cs index d064b9c2b..209751867 100644 --- a/CodeCompletion/CodeFormatter.cs +++ b/CodeCompletion/CodeFormatter.cs @@ -1952,7 +1952,8 @@ namespace CodeFormatters else already_off = false; visit_node(_class_members.access_mod); - if (first_decl != null && !(_class_members.members[0] is short_func_definition)) + if (first_decl != null && !(_class_members.members[0] is short_func_definition) && + _class_members.access_mod.source_context.end_position.line_num == _class_members.source_context.begin_position.line_num) sb.Append(" "); if (!already_off) IncOffset(); diff --git a/TestSuite/formatter_tests/input/class3.pas b/TestSuite/formatter_tests/input/class3.pas new file mode 100644 index 000000000..57a5c2f81 --- /dev/null +++ b/TestSuite/formatter_tests/input/class3.pas @@ -0,0 +1,11 @@ +type + t1 = class +internal i1: integer; +private +i2: integer; +protected +i3: integer; +public +end; + +begin end. \ No newline at end of file diff --git a/TestSuite/formatter_tests/should/class3.pas b/TestSuite/formatter_tests/should/class3.pas new file mode 100644 index 000000000..9c216a5d5 --- /dev/null +++ b/TestSuite/formatter_tests/should/class3.pas @@ -0,0 +1,11 @@ +type + t1 = class + internal i1: integer; + private + i2: integer; + protected + i3: integer; + public + end; + +begin end. \ No newline at end of file diff --git a/TestSuite/formatter_tests/should/property4.pas b/TestSuite/formatter_tests/should/property4.pas index 3504fc3a7..c515807e2 100644 --- a/TestSuite/formatter_tests/should/property4.pas +++ b/TestSuite/formatter_tests/should/property4.pas @@ -1,9 +1,9 @@ type TExample = class - private + private fX: integer; - public + public property X: integer read fX write