1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Merge pull request #2075 from m910q/fix-newline-indentation

Support for space indentation when splitting line with enter key
This commit is contained in:
Brian Fiete 2024-12-02 13:54:50 -05:00 committed by GitHub
commit c5d44e1ab3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4090,10 +4090,16 @@ namespace IDE.ui
}
if (column > 0)
{
String tabStr = scope String();
tabStr.Append('\t', column / gApp.mSettings.mEditorSettings.mTabSize);
tabStr.Append(' ', column % gApp.mSettings.mEditorSettings.mTabSize);
InsertAtCursor(tabStr);
String indentationStr = scope String();
switch (gApp.mSettings.mEditorSettings.mTabsOrSpaces)
{
case .Spaces:
indentationStr.Append(' ', column);
case .Tabs:
indentationStr.Append('\t', column / gApp.mSettings.mEditorSettings.mTabSize);
indentationStr.Append(' ', column % gApp.mSettings.mEditorSettings.mTabSize);
}
InsertAtCursor(indentationStr);
}
// Insert extra blank line if we're breaking between a { and a }