Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public bool CodeBlockBraceOnNextLine
[LocDisplayName(nameof(VSPackage.Setting_FormattingOnPasteDisplayName))]
public bool FormatOnPaste
{
get => _formatOnPaste ?? true;
get => _formatOnPaste ?? _optionsStorage.Value.FormatOnPaste;
set => _formatOnPaste = value;
}

Expand All @@ -106,7 +106,7 @@ public bool FormatOnPaste
[LocDisplayName(nameof(VSPackage.Setting_SnippetsDisplayName))]
public SnippetSetting Snippets
{
get => _snippets ?? (SnippetSetting)_optionsStorage.Value.Snippets;
get => _snippets ?? _optionsStorage.Value.Snippets;
set => _snippets = value;
}

Expand All @@ -115,7 +115,7 @@ public SnippetSetting Snippets
[LocDisplayName(nameof(VSPackage.Setting_LogLevelDisplayName))]
public LogLevel LogLevel
{
get => _logLevel ?? (LogLevel)_optionsStorage.Value.LogLevel;
get => _logLevel ?? _optionsStorage.Value.LogLevel;
set => _logLevel = value;
}

Expand All @@ -136,14 +136,24 @@ protected override void OnApply(PageApplyEventArgs e)
_optionsStorage.Value.AutoInsertAttributeQuotes = _autoInsertAttributeQuotes.Value;
}

if (_commitElementsWithSpace is not null)
{
_optionsStorage.Value.CommitElementsWithSpace = _commitElementsWithSpace.Value;
}

if (_colorBackground is not null)
{
_optionsStorage.Value.ColorBackground = _colorBackground.Value;
}

if (_commitElementsWithSpace is not null)
if (_codeBlockBraceOnNextLine is not null)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff looks bad here, but what really happened was I moved _commitElementsWithSpace above, so the ordering was consistent everywhere in the file, then added the code for _codeBlockBraceOnNextLine

{
_optionsStorage.Value.CommitElementsWithSpace = _commitElementsWithSpace.Value;
_optionsStorage.Value.CodeBlockBraceOnNextLine = _codeBlockBraceOnNextLine.Value;
}

if (_formatOnPaste is not null)
{
_optionsStorage.Value.FormatOnPaste = _formatOnPaste.Value;
}

if (_snippets is SnippetSetting snippets)
Expand All @@ -162,8 +172,10 @@ protected override void OnClosed(EventArgs e)
_formatOnType = null;
_autoClosingTags = null;
_autoInsertAttributeQuotes = null;
_colorBackground = null;
_commitElementsWithSpace = null;
_colorBackground = null;
_codeBlockBraceOnNextLine = null;
_formatOnPaste = null;
_snippets = null;
_logLevel = null;
}
Expand Down
Loading