From d62305303af873e17e6fe9d698f140daabb82aec Mon Sep 17 00:00:00 2001 From: Thomas Nordquist Date: Thu, 6 Jun 2019 23:20:20 +0200 Subject: [PATCH] Refactor --- app/src/components/Sidebar/CodeDiff/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/components/Sidebar/CodeDiff/index.tsx b/app/src/components/Sidebar/CodeDiff/index.tsx index 274be61..8ffdd64 100644 --- a/app/src/components/Sidebar/CodeDiff/index.tsx +++ b/app/src/components/Sidebar/CodeDiff/index.tsx @@ -66,7 +66,7 @@ class CodeDiff extends React.Component { .map((l: JsonPropertyLocation) => isPlottable(l.value) ? l : undefined) as Array } - private renderLines(changes: Array) { + private renderStyledCodeLines(changes: Array) { const styledLines = Prism.highlight(this.props.current, Prism.languages.json, 'json').split('\n') let lineNumber = 0 @@ -95,7 +95,7 @@ class CodeDiff extends React.Component { const changes = diff.diffLines(this.props.previous, this.props.current) const literalPositions = this.plottableLiteralsIndexedWithLineNumbers() - const code = this.renderLines(changes) + const code = this.renderStyledCodeLines(changes) const { diagram } = this.state const hasEnoughDataToDisplayDiagrams = this.props.messageHistory.count() > 1