This repository was archived by the owner on Sep 11, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
UI/Components/EditorElement/Foldings Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,9 @@ namespace SPCode.UI.Components
66{
77 public class SPFoldingStrategy
88 {
9- public char OpeningBrace { get ; set ; }
10- public char ClosingBrace { get ; set ; }
11-
129 public SPFoldingStrategy ( )
1310 {
14- OpeningBrace = '{' ;
15- ClosingBrace = '}' ;
11+
1612 }
1713
1814 public void UpdateFoldings ( FoldingManager manager , TextDocument document )
@@ -36,6 +32,7 @@ public IEnumerable<NewFolding> CreateNewFoldings(ITextSource document)
3632 for ( var i = 0 ; i < document . TextLength ; ++ i )
3733 {
3834 var c = document . GetCharAt ( i ) ;
35+
3936 if ( c == '\n ' || c == '\r ' )
4037 {
4138 lastNewLineOffset = i + 1 ;
@@ -120,15 +117,15 @@ public IEnumerable<NewFolding> CreateNewFoldings(ITextSource document)
120117 }
121118 case 3 :
122119 {
123- if ( c == '\" ' )
120+ if ( c == '\" ' && document . GetCharAt ( i - 1 ) != ' \\ ' )
124121 {
125122 CommentMode = 0 ;
126123 }
127124 break ;
128125 }
129126 case 4 :
130127 {
131- if ( c == '\' ' )
128+ if ( c == '\' ' && document . GetCharAt ( i - 1 ) != ' \\ ' )
132129 {
133130 CommentMode = 0 ;
134131 }
You can’t perform that action at this time.
0 commit comments