提交 60707855 编写于 作者: A Alexandru Dima 提交者: GitHub

Merge pull request #10784 from ramamurthynagaraj/issue_10754

Fixes 10754 - Using mode transition constructor so that modeId is available
...@@ -10,6 +10,7 @@ import * as modes from 'vs/editor/common/modes'; ...@@ -10,6 +10,7 @@ import * as modes from 'vs/editor/common/modes';
import {LineStream} from 'vs/editor/common/modes/lineStream'; import {LineStream} from 'vs/editor/common/modes/lineStream';
import {NullMode, NullState, nullTokenize} from 'vs/editor/common/modes/nullMode'; import {NullMode, NullState, nullTokenize} from 'vs/editor/common/modes/nullMode';
import {Token} from 'vs/editor/common/modes/supports'; import {Token} from 'vs/editor/common/modes/supports';
import {ModeTransition} from 'vs/editor/common/core/ModeTransition';
export interface ILeavingNestedModeData { export interface ILeavingNestedModeData {
/** /**
...@@ -189,10 +190,7 @@ export class TokenizationSupport implements modes.ITokenizationSupport, IDisposa ...@@ -189,10 +190,7 @@ export class TokenizationSupport implements modes.ITokenizationSupport, IDisposa
myState = myState.clone(); myState = myState.clone();
if (prependModeTransitions.length <= 0 || prependModeTransitions[prependModeTransitions.length-1].mode !== this._mode) { if (prependModeTransitions.length <= 0 || prependModeTransitions[prependModeTransitions.length-1].mode !== this._mode) {
// Avoid transitioning to the same mode (this can happen in case of empty embedded modes) // Avoid transitioning to the same mode (this can happen in case of empty embedded modes)
prependModeTransitions.push({ prependModeTransitions.push(new ModeTransition(deltaOffset,this._mode));
startIndex: deltaOffset,
mode: this._mode
});
} }
var maxPos = Math.min(stopAtOffset - deltaOffset, buffer.length); var maxPos = Math.min(stopAtOffset - deltaOffset, buffer.length);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册