Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit e2d13c7

Browse files
committed
Disable indentation in for loops
1 parent eeb4398 commit e2d13c7

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

App/AssemblyInfo1.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@
3333
#if (DEBUG)
3434
[assembly: AssemblyVersion("1.13.*")]
3535
#else
36-
[assembly: AssemblyVersion("1.3.4.3")]
36+
[assembly: AssemblyVersion("1.3.4.4")]
3737
#endif

UI/Components/EditorElement.xaml.cs

+12-4
Original file line numberDiff line numberDiff line change
@@ -530,11 +530,19 @@ private void TextArea_TextEntered(object sender, TextCompositionEventArgs e)
530530
if (e.Text == ";")
531531
if (editor.CaretOffset >= 0)
532532
{
533+
533534
var line = editor.Document.GetLineByOffset(editor.CaretOffset);
534-
var leadingIndentation =
535-
editor.Document.GetText(TextUtilities.GetLeadingWhitespace(editor.Document, line));
536-
var newLineStr = leadingIndentation + SPSyntaxTidy.TidyUp(editor.Document.GetText(line)).Trim();
537-
editor.Document.Replace(line, newLineStr);
535+
var text = editor.Document.GetText(line);
536+
537+
// TODO: Poor way to fix this but atm I have no idea on how to fix this properly
538+
if (!text.Contains("for"))
539+
{
540+
var leadingIndentation =
541+
editor.Document.GetText(TextUtilities.GetLeadingWhitespace(editor.Document, line));
542+
var newLineStr = leadingIndentation +
543+
SPSyntaxTidy.TidyUp(text).Trim();
544+
editor.Document.Replace(line, newLineStr);
545+
}
538546
}
539547

540548
switch (e.Text)

0 commit comments

Comments
 (0)