Show More
@@ -543,26 +543,26 define([ | |||
|
543 | 543 | } |
|
544 | 544 | var open = modes[mode].open || "%%"; |
|
545 | 545 | var close = modes[mode].close || "%%end"; |
|
546 | var mmode = mode; | |
|
547 | mode = mmode.substr(6); | |
|
548 | if(current_mode == mmode){ | |
|
546 | var magic_mode = mode; | |
|
547 | mode = magic_mode.substr(6); | |
|
548 | if(current_mode == magic_mode){ | |
|
549 | 549 | return; |
|
550 | 550 | } |
|
551 | 551 | utils.requireCodeMirrorMode(mode, function () { |
|
552 | 552 | // create on the fly a mode that switch between |
|
553 | 553 | // plain/text and something else, otherwise `%%` is |
|
554 | 554 | // source of some highlight issues. |
|
555 | CodeMirror.defineMode(mmode, function(config) { | |
|
555 | CodeMirror.defineMode(magic_mode, function(config) { | |
|
556 | 556 | return CodeMirror.multiplexingMode( |
|
557 | 557 | CodeMirror.getMode(config, 'text/plain'), |
|
558 | // always set someting on close | |
|
558 | // always set something on close | |
|
559 | 559 | {open: open, close: close, |
|
560 | 560 | mode: CodeMirror.getMode(config, mode), |
|
561 | 561 | delimStyle: "delimit" |
|
562 | 562 | } |
|
563 | 563 | ); |
|
564 | 564 | }); |
|
565 | that.code_mirror.setOption('mode', mmode); | |
|
565 | that.code_mirror.setOption('mode', magic_mode); | |
|
566 | 566 | }); |
|
567 | 567 | return; |
|
568 | 568 | } |
General Comments 0
You need to be logged in to leave comments.
Login now