* lisp/progmodes/csharp-mode.el (csharp-ts-mode--indent-rules): Fix indentation rules for 'if' and 'else'. * test/lisp/progmodes/csharp-ts-mode-tests.el: * test/lisp/progmodes/csharp-ts-mode-resources/indent.erts: New test files. Copyright-paperwork-exempt: yes
52 lines
404 B
Plaintext
52 lines
404 B
Plaintext
Code:
|
|
(lambda ()
|
|
(csharp-ts-mode)
|
|
(indent-region (point-min) (point-max)))
|
|
|
|
Point-Char: |
|
|
|
|
Name: Indent single statement body for if/else. (bug#70345)
|
|
|
|
=-=
|
|
|
|
int x;
|
|
int y;
|
|
|
|
if (true)
|
|
x = 2;
|
|
|
|
if (true)
|
|
{
|
|
x = 2;
|
|
}
|
|
|
|
if (true)
|
|
x = 2;
|
|
else
|
|
y = 2;
|
|
|
|
if (true)
|
|
{
|
|
x = 2;
|
|
}
|
|
else
|
|
{
|
|
y = 2;
|
|
}
|
|
|
|
if (true)
|
|
x = 2;
|
|
else
|
|
{
|
|
y = 2;
|
|
}
|
|
|
|
if (true)
|
|
{
|
|
x = 2;
|
|
}
|
|
else
|
|
y = 2;
|
|
|
|
=-=-=
|