From 76d59f83de89c1514fd1f96b3c68b824937b2927 Mon Sep 17 00:00:00 2001 From: Andreas Waigel Date: Fri, 19 Aug 2022 19:09:13 +0200 Subject: [PATCH] Fix Indents on comments --- Rubberduck.SmartIndenter/LogicalCodeLine.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Rubberduck.SmartIndenter/LogicalCodeLine.cs b/Rubberduck.SmartIndenter/LogicalCodeLine.cs index aca65149d0..5c13af3bfd 100644 --- a/Rubberduck.SmartIndenter/LogicalCodeLine.cs +++ b/Rubberduck.SmartIndenter/LogicalCodeLine.cs @@ -47,6 +47,10 @@ public int NextLineIndents get { RebuildContinuedLine(); + if (_rebuilt.ContainsOnlyComment) + { + return 0; + } return _rebuilt.Segments.Count() < 2 ? _rebuilt.NextLineIndents : _rebuilt.Segments.Select(s => new AbsoluteCodeLine(s, _settings)).Select(a => a.NextLineIndents).Sum();