Indent reset at certain level
See original GitHub issueVS2017 Community MDK-SE v1.2.22
Indenting depth in the output gets reset after a certain depth. This example below shows a fragment of the output. It doesn’t seem to matter what’s going on in the code; when the indent level (or, possibly, the nesting level) reaches 4 deep in the initial source, it drops to 0 in the output.
Source fragment:
void Init() {
GridTerminalSystem.GetBlocksOfType(dummy, block => {
if(Me.IsSameConstructAs(block)) {
if(block is IMyShipDrill) {
drills.Add((IMyShipDrill)block);
} else
if(block is IMyConveyorSorter) {
sorters.Add((IMyConveyorSorter)block);
} else
if(block is IMyPistonBase) {
pistons.Add((IMyPistonBase)block);
} else
if(block is IMyShipConnector) {
var connector = (IMyShipConnector)block;
if(connector.ThrowOut) {
ejectors.Add(connector);
} else {
connectors.Add(connector);
}
} else
if(block is IMyRefinery) {
refineries.Add((IMyRefinery)block);
} else
if(block is IMyCargoContainer) {
containers.Add((IMyCargoContainer)block);
} else {
if(block is IMyMotorRotor) {
if(rotor == null) {
rotor = (IMyMotorRotor)block;
} else {
throw new ConstraintException("Structure must include a single rotor");
}
}
}
}
return false;
});
}
Output fragment:
void Init() {
GridTerminalSystem.GetBlocksOfType(dummy, block => {
if(Me.IsSameConstructAs(block)) {
if(block is IMyShipDrill) {
drills.Add((IMyShipDrill)block);
} else
if(block is IMyConveyorSorter) {
sorters.Add((IMyConveyorSorter)block);
} else
if(block is IMyPistonBase) {
pistons.Add((IMyPistonBase)block);
} else
if(block is IMyShipConnector) {
var connector = (IMyShipConnector)block;
if(connector.ThrowOut) {
ejectors.Add(connector);
} else {
connectors.Add(connector);
}
} else
if(block is IMyRefinery) {
refineries.Add((IMyRefinery)block);
} else
if(block is IMyCargoContainer) {
containers.Add((IMyCargoContainer)block);
} else {
if(block is IMyMotorRotor) {
if(rotor == null) {
rotor = (IMyMotorRotor)block;
} else {
throw new ConstraintException("Structure must include a single rotor");
}
}
}
}
return false;
});
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Restart Numbered List changes the Hanging indent spacing
For single-level numbering, you should do the following: Right-click an item in the numbered list and choose Adjust List Indents from the ...
Read more >Adjust indents and spacing in Word
Tip: To quickly change indents for an entire document, adjust the margins. Under Page Layout, select Margins, and choose the margin settings you...
Read more >How to Adjust Bullet or Number List Indents in Microsoft Word
Place your cursor next to the text for the list item. · Go to the Home tab and click the arrow next to...
Read more >How to adjust Indents in Microsoft Word - YouTube
This is a Microsoft Word tutorial covering, how to adjust Indents, tabs and borders. The tutor starts off by adjusting an indent in...
Read more >How to Adjust the Indents and Tabs in Microsoft Word
To change the indentation for an entire document, select all text (press Ctrl + A ), then adjust the indent spacing in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh - another tip. Rather than
is
-> cast, doYou’ll save a cast.
(PS: @ouroborus, you don’t need to pass in a dummy list. Just pass in null.)