Incorrect re-indentation for 'else' in if-else block
When you type in an if-else block with this style (no braces)
Before typing else I delete the leading spaces to line it up with the if. Then I type "else". When I finish typing the last "e" in else the word is re-indented to line up with the "1", the true expression. It shouldn't be re-indented. It end up looking like this:
if (cond)
1
else
Before typing else I delete the leading spaces to line it up with the if. Then I type "else". When I finish typing the last "e" in else the word is re-indented to line up with the "1", the true expression. It shouldn't be re-indented. It end up looking like this:
if (cond)
1
else
Leave a comment
This is indeed very annoying.
on 2014-02-27 17:46 *
By Simon Schäfer
Eclipse version changed from Indigo - Eclipse 3.7 to All
Version changed from 2.1.0-M2-29 to 3.0.2-210
on 2014-03-19 17:43 *
By Iulian Dragos
Assigned to set to Iulian Dragos
Status changed from Accepted to Fixed
Small improvements in indentation
Correct indentation for:
I needed to improve the testing infrastructure a bit:
suite, but failed in a real editor)
Fixed #1001306
Fixed #1000415
Branch: master
Commit: scala-ide:82c70919a7
Correct indentation for:
- assignments of string and char literals (val x = "abc")
- `else` alignment in brace-less if-else expressions
I needed to improve the testing infrastructure a bit:
- set a document partitioner (the results of indentation
suite, but failed in a real editor)
- correct the new caret position, and allow for tests where
Fixed #1001306
Fixed #1000415
Branch: master
Commit: scala-ide:82c70919a7