mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 00:19:55 +03:00
Fix that
This commit is contained in:
parent
017d0462c7
commit
50f161e2a3
|
@ -12,7 +12,7 @@ import { absolutifyCaret } from '../utils/dom/absolutifyCaret';
|
||||||
import { ScriptLine } from '../utils/stack-frame';
|
import { ScriptLine } from '../utils/stack-frame';
|
||||||
import generateAnsiHTML from '../utils/generateAnsiHTML';
|
import generateAnsiHTML from '../utils/generateAnsiHTML';
|
||||||
|
|
||||||
import { codeFrameColumns } from '@babel/code-frame';
|
// import { codeFrameColumns } from '@babel/code-frame';
|
||||||
import { nicinabox as theme } from 'redux-devtools-themes';
|
import { nicinabox as theme } from 'redux-devtools-themes';
|
||||||
|
|
||||||
interface StackFrameCodeBlockPropsType {
|
interface StackFrameCodeBlockPropsType {
|
||||||
|
@ -48,24 +48,25 @@ function StackFrameCodeBlock(props: StackFrameCodeBlockPropsType) {
|
||||||
}
|
}
|
||||||
sourceCode[line - 1] = text;
|
sourceCode[line - 1] = text;
|
||||||
});
|
});
|
||||||
const ansiHighlight = codeFrameColumns(
|
// const ansiHighlight = codeFrameColumns(
|
||||||
sourceCode.join('\n'),
|
// sourceCode.join('\n'),
|
||||||
{
|
// {
|
||||||
start: {
|
// start: {
|
||||||
line: lineNum,
|
// line: lineNum,
|
||||||
column:
|
// column:
|
||||||
columnNum == null
|
// columnNum == null
|
||||||
? 0
|
// ? 0
|
||||||
: columnNum - (isFinite(whiteSpace) ? whiteSpace : 0),
|
// : columnNum - (isFinite(whiteSpace) ? whiteSpace : 0),
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
forceColor: true,
|
// forceColor: true,
|
||||||
linesAbove: contextSize,
|
// linesAbove: contextSize,
|
||||||
linesBelow: contextSize,
|
// linesBelow: contextSize,
|
||||||
}
|
// }
|
||||||
);
|
// );
|
||||||
const htmlHighlight = generateAnsiHTML(ansiHighlight);
|
// const htmlHighlight = generateAnsiHTML(ansiHighlight);
|
||||||
|
const htmlHighlight = generateAnsiHTML(sourceCode.join('\n'));
|
||||||
const code = document.createElement('code');
|
const code = document.createElement('code');
|
||||||
code.innerHTML = htmlHighlight;
|
code.innerHTML = htmlHighlight;
|
||||||
absolutifyCaret(code);
|
absolutifyCaret(code);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user