bug fix #605
This commit is contained in:
parent
caa940f0c9
commit
924a625e45
|
|
@ -348,7 +348,16 @@ namespace CodeFormatters
|
|||
{
|
||||
if (multi_line_nodes.Count > 0)
|
||||
{
|
||||
lines[i] = new string(' ', addit_pos_for_multiline) + lines[i];
|
||||
if (multi_line_nodes.Count == 1)
|
||||
lines[i] = new string(' ', addit_pos_for_multiline) + lines[i];
|
||||
else
|
||||
{
|
||||
if (off > lines[i].Length)
|
||||
lines[i] = new string(' ', addit_pos_for_multiline + off) + lines[i];
|
||||
else
|
||||
lines[i] = new string(' ', addit_pos_for_multiline) + lines[i];
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2697,9 +2706,10 @@ namespace CodeFormatters
|
|||
}
|
||||
if (_function_lambda_definition.formal_parameters != null && Text[GetPosition(_function_lambda_definition.formal_parameters.source_context.end_position.line_num, _function_lambda_definition.formal_parameters.source_context.end_position.column_num)+1] != ')')
|
||||
add_space_before = true;
|
||||
multiline_stack_pop(_function_lambda_definition);
|
||||
|
||||
int tmp_off = off;
|
||||
visit_node(_function_lambda_definition.proc_body);
|
||||
multiline_stack_pop(_function_lambda_definition);
|
||||
off = tmp_off;
|
||||
}
|
||||
public override void visit(function_lambda_call _function_lambda_call)
|
||||
|
|
|
|||
|
|
@ -3825,7 +3825,7 @@ namespace CodeCompletion
|
|||
TypeScope gen_arg = gen_args[i];
|
||||
if (gen_arg.instances != null && gen_arg.original_type != null)
|
||||
{
|
||||
if (gen_arg.original_type.generic_params != null)
|
||||
if (gen_arg.original_type.generic_params != null && this.generic_params != null)
|
||||
for (int j=0; j < gen_arg.original_type.generic_params.Count; j++)
|
||||
{
|
||||
if (string.Compare(gen_arg.original_type.generic_params[j], this.generic_params[j], true) == 0)
|
||||
|
|
|
|||
29
TestSuite/formatter_tests/input/Program997.pas
Normal file
29
TestSuite/formatter_tests/input/Program997.pas
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
begin
|
||||
|
||||
Arr(0).ForEach(i -> begin
|
||||
|
||||
writeln(2, 3);
|
||||
begin
|
||||
writeln(2,
|
||||
3,
|
||||
4,
|
||||
5);
|
||||
writeln;
|
||||
Arr(0).ForEach(i -> begin
|
||||
sin(2);
|
||||
end);
|
||||
end;
|
||||
writeln;
|
||||
writeln;
|
||||
end);
|
||||
begin
|
||||
ww;
|
||||
end;
|
||||
writeln(2,
|
||||
sin(3,
|
||||
2),
|
||||
4);
|
||||
writeln(2
|
||||
+ 3
|
||||
+ 4);
|
||||
end.
|
||||
Loading…
Reference in a new issue