Browse Source

Improved repr formatting

pull/55/head
Ionite 1 year ago
parent
commit
ada255eebd
No known key found for this signature in database
  1. 4
      StabilityMatrix.Core/Extensions/StringExtensions.cs
  2. 1
      StabilityMatrix.sln.DotSettings

4
StabilityMatrix.Core/Extensions/StringExtensions.cs

@ -10,7 +10,8 @@ public static class StringExtensions
var sb = new StringBuilder(); var sb = new StringBuilder();
foreach (var c in value) foreach (var c in value)
{ {
if (c > 127) // If not ascii or not printable
if (c > 127 || c < 32)
{ {
// This character is too big for ASCII // This character is too big for ASCII
var encodedValue = "\\u" + ((int) c).ToString("x4"); var encodedValue = "\\u" + ((int) c).ToString("x4");
@ -42,6 +43,7 @@ public static class StringExtensions
// Encode non-ascii characters // Encode non-ascii characters
literal = EncodeNonAsciiCharacters(literal); literal = EncodeNonAsciiCharacters(literal);
// Surround with single quotes // Surround with single quotes
literal = literal.Trim('"');
literal = $"'{literal}'"; literal = $"'{literal}'";
return literal; return literal;
} }

1
StabilityMatrix.sln.DotSettings

@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EOF/@EntryIndexedValue">EOF</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LRU/@EntryIndexedValue">LRU</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LRU/@EntryIndexedValue">LRU</s:String>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/QuickList/=F0CA621CDF5AB24282D8CDC11C520997/@KeyIndexDefined">True</s:Boolean> <s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/QuickList/=F0CA621CDF5AB24282D8CDC11C520997/@KeyIndexDefined">True</s:Boolean>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/QuickList/=F0CA621CDF5AB24282D8CDC11C520997/Entry/=1A64B45C2359DD448CF8A25D4A7469F9/@KeyIndexDefined">True</s:Boolean> <s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/QuickList/=F0CA621CDF5AB24282D8CDC11C520997/Entry/=1A64B45C2359DD448CF8A25D4A7469F9/@KeyIndexDefined">True</s:Boolean>

Loading…
Cancel
Save