File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -120,4 +120,16 @@ namespace = "comment_";
120120 cm . execCommand ( "selectAll" )
121121 cm . execCommand ( "toggleComment" )
122122 } , "/* foo */\na\n/* bar */\nb" , "// /* foo */\n// a\n// /* bar */\n// b" )
123+
124+ var before = 'console.log("//string gets corrupted.");' ;
125+ var after = '// console.log("//string gets corrupted.");' ;
126+ test ( "toggleWithStringContainingComment1" , "javascript" , function ( cm ) {
127+ cm . setCursor ( { line : 0 , ch : 16 /* after // inside string */ } ) ;
128+ cm . execCommand ( "toggleComment" ) ;
129+ } , before , after )
130+ test ( "toggleWithStringContainingComment2" , "javascript" , function ( cm ) {
131+ cm . setCursor ( { line : 0 , ch : 16 /* after // inside string */ } ) ;
132+ cm . execCommand ( "toggleComment" ) ;
133+ cm . execCommand ( "toggleComment" ) ;
134+ } , before , before )
123135} ) ( ) ;
You can’t perform that action at this time.
0 commit comments