Skip to content

Commit 722c626

Browse files
committed
fixed concat test config
1 parent 09c0907 commit 722c626

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

Rubberduck.Core/AutoComplete/Service/SmartConcatenationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public override bool Handle(AutoCompleteEventArgs e, AutoCompleteSettings settin
2626

2727
var currentContent = CodePaneHandler.GetCurrentLogicalLine(e.Module);
2828
if ((!currentContent?.IsInsideStringLiteral ?? true)
29-
|| currentContent.Lines.Length >= settings.SmartConcat.MaxLogicalLineLineCount)
29+
|| currentContent.Lines.Length >= settings.SmartConcat.ConcatMaxLines)
3030
{
3131
// selection spans more than a single logical line, or spans too many lines to be legal;
3232
// too many line continuations throws COMException if we attempt to modify.

Rubberduck.Core/Settings/AutoCompleteSettings.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ public AutoCompleteSettings()
6363

6464
public class SmartConcatSettings : IEquatable<SmartConcatSettings>
6565
{
66-
private int _maxLogicalLineLineCount;
66+
private int _concatMaxLines;
6767

6868
[XmlAttribute]
6969
public bool IsEnabled { get; set; }
7070
public ModifierKeySetting ConcatVbNewLineModifier { get; set; }
7171

72-
public int MaxLogicalLineLineCount
72+
public int ConcatMaxLines
7373
{
74-
get => _maxLogicalLineLineCount;
74+
get => _concatMaxLines;
7575
set
7676
{
7777
if (value > ConcatMaxLinesMaxValue)
@@ -83,15 +83,15 @@ public int MaxLogicalLineLineCount
8383
value = ConcatMaxLinesMinValue;
8484
}
8585

86-
_maxLogicalLineLineCount = value;
86+
_concatMaxLines = value;
8787
}
8888
}
8989

9090
public bool Equals(SmartConcatSettings other)
9191
=> other != null &&
9292
other.IsEnabled == IsEnabled &&
9393
other.ConcatVbNewLineModifier == ConcatVbNewLineModifier &&
94-
other.MaxLogicalLineLineCount == MaxLogicalLineLineCount;
94+
other.ConcatMaxLines == ConcatMaxLines;
9595
}
9696

9797
public class SelfClosingPairSettings : IEquatable<SelfClosingPairSettings>

Rubberduck.Core/UI/Settings/AutoCompleteSettingsViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void UpdateConfig(Configuration config)
2929
config.UserSettings.AutoCompleteSettings.SmartConcat.IsEnabled = EnableSmartConcat;
3030
config.UserSettings.AutoCompleteSettings.SmartConcat.ConcatVbNewLineModifier =
3131
ConcatVbNewLine ? ModifierKeySetting.CtrlKey : ModifierKeySetting.None;
32-
config.UserSettings.AutoCompleteSettings.SmartConcat.MaxLogicalLineLineCount = ConcatMaxLines;
32+
config.UserSettings.AutoCompleteSettings.SmartConcat.ConcatMaxLines = ConcatMaxLines;
3333
config.UserSettings.AutoCompleteSettings.BlockCompletion.IsEnabled = EnableBlockCompletion;
3434
config.UserSettings.AutoCompleteSettings.BlockCompletion.CompleteOnTab = CompleteBlockOnTab;
3535
config.UserSettings.AutoCompleteSettings.BlockCompletion.CompleteOnEnter = CompleteBlockOnEnter;
@@ -43,7 +43,7 @@ private void TransferSettingsToView(Rubberduck.Settings.AutoCompleteSettings toL
4343

4444
EnableSmartConcat = toLoad.SmartConcat.IsEnabled;
4545
ConcatVbNewLine = toLoad.SmartConcat.ConcatVbNewLineModifier == ModifierKeySetting.CtrlKey;
46-
ConcatMaxLines = toLoad.SmartConcat.MaxLogicalLineLineCount;
46+
ConcatMaxLines = toLoad.SmartConcat.ConcatMaxLines;
4747

4848
EnableBlockCompletion = toLoad.BlockCompletion.IsEnabled;
4949
CompleteBlockOnTab = toLoad.BlockCompletion.CompleteOnTab;

Rubberduck.Core/app.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@
398398
xmlns:xsd="http://www.w3.org/2001/XMLSchema" IsEnabled="false">
399399
<SmartConcat IsEnabled="false">
400400
<ConcatVbNewLineModifier>None</ConcatVbNewLineModifier>
401-
<MaxLogicalLineLineCount>25</MaxLogicalLineLineCount>
401+
<ConcatMaxLines>25</ConcatMaxLines>
402402
</SmartConcat>
403403
<SelfClosingPairs IsEnabled="false" />
404404
<BlockCompletion IsEnabled="false" CompleteOnEnter="false" CompleteOnTab="false" />

RubberduckTests/AutoComplete/SmartConcatCompletionTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ private static SmartConcatenationHandler InitializeSut(TestCodeString original,
116116
settings = new AutoCompleteSettings {IsEnabled = true};
117117
settings.SmartConcat.IsEnabled = true;
118118
settings.SmartConcat.ConcatVbNewLineModifier = ModifierKeySetting.CtrlKey;
119+
settings.SmartConcat.ConcatMaxLines = AutoCompleteSettings.ConcatMaxLinesMaxValue;
119120

120121
var handler = new CodePaneSourceCodeHandler(new ProjectsRepository(vbe.Object));
121122
var sut = new SmartConcatenationHandler(handler);

0 commit comments

Comments
 (0)