| 668 | } |
| 669 | |
| 670 | function debugTokenWithContext(text:string, start:number, end:number):string { |
| 671 | let lineStart = text.lastIndexOf("\n", start) + 1; |
| 672 | let lineEnd = text.indexOf("\n", end); |
| 673 | if(lineEnd === -1) lineEnd = undefined; |
| 674 | let tokenStart = start - lineStart; |
| 675 | let tokenEnd = end - lineStart; |
| 676 | let line = text.substring(lineStart, lineEnd); |
| 677 | |
| 678 | return line.substring(0, tokenStart) + "|" + line.substring(tokenStart, tokenEnd) + "|" + line.substring(tokenEnd); |
| 679 | } |
| 680 | |
| 681 | interface HistoryItem { finalized?: boolean, changes:(Change|SpanChange)[] } |
| 682 | interface CMEditor extends CodeMirror.Editor { |