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
6
6
{
7
7
public class SPFoldingStrategy
8
8
{
9
- public char OpeningBrace { get ; set ; }
10
- public char ClosingBrace { get ; set ; }
11
-
12
9
public SPFoldingStrategy ( )
13
10
{
14
- OpeningBrace = '{' ;
15
- ClosingBrace = '}' ;
11
+
16
12
}
17
13
18
14
public void UpdateFoldings ( FoldingManager manager , TextDocument document )
@@ -36,6 +32,7 @@ public IEnumerable<NewFolding> CreateNewFoldings(ITextSource document)
36
32
for ( var i = 0 ; i < document . TextLength ; ++ i )
37
33
{
38
34
var c = document . GetCharAt ( i ) ;
35
+
39
36
if ( c == '\n ' || c == '\r ' )
40
37
{
41
38
lastNewLineOffset = i + 1 ;
@@ -120,15 +117,15 @@ public IEnumerable<NewFolding> CreateNewFoldings(ITextSource document)
120
117
}
121
118
case 3 :
122
119
{
123
- if ( c == '\" ' )
120
+ if ( c == '\" ' && document . GetCharAt ( i - 1 ) != ' \\ ' )
124
121
{
125
122
CommentMode = 0 ;
126
123
}
127
124
break ;
128
125
}
129
126
case 4 :
130
127
{
131
- if ( c == '\' ' )
128
+ if ( c == '\' ' && document . GetCharAt ( i - 1 ) != ' \\ ' )
132
129
{
133
130
CommentMode = 0 ;
134
131
}
You can’t perform that action at this time.
0 commit comments