From 5a3c9ef298f0d9d94b0baf257a7e2e146af04669 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 16 May 2019 17:25:54 +0200 Subject: [PATCH 1/2] Update contextualListener.js --- src/app/editor/contextualListener.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/app/editor/contextualListener.js b/src/app/editor/contextualListener.js index 7673e1d7d9..24027d9ae4 100644 --- a/src/app/editor/contextualListener.js +++ b/src/app/editor/contextualListener.js @@ -1,5 +1,6 @@ 'use strict' const remixLib = require('remix-lib') +const csjs = require('csjs-inject') const SourceMappingDecoder = remixLib.SourceMappingDecoder const AstWalker = remixLib.AstWalker const EventManager = require('../../lib/events') @@ -115,10 +116,16 @@ class ContextualListener { let lastCompilationResult = this._deps.compilersArtefacts['__last'] if (lastCompilationResult && lastCompilationResult.languageversion.indexOf('soljson') === 0) { let lineColumn = this._deps.offsetToLineColumnConverter.offsetToLineColumn(position, position.file, lastCompilationResult.getSourceCode().sources, lastCompilationResult.getAsts()) - let css = 'highlightreference' + const css = csjs` + .highlightref_fullLine { + position:absolute; + z-index:20; + opacity: 0.4; + background-color: var(--info); + } + ` if (node.children && node.children.length) { // If node has children, highlight the entire line. if not, just highlight the current source position of the node. - css = 'highlightreference' lineColumn = { start: { line: lineColumn.start.line, @@ -132,7 +139,7 @@ class ContextualListener { } const fileName = lastCompilationResult.getSourceName(position.file) if (fileName) { - return this.editor.addMarker(lineColumn, fileName, css) + return this.editor.addMarker(lineColumn, fileName, css.highlightref_fullLine.className) } } return null From 9c3ae5ffd8698631d2d4affaee00d124ba97cf5a Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 16 May 2019 17:39:48 +0200 Subject: [PATCH 2/2] Update contextualListener.js --- src/app/editor/contextualListener.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/editor/contextualListener.js b/src/app/editor/contextualListener.js index 24027d9ae4..3134353696 100644 --- a/src/app/editor/contextualListener.js +++ b/src/app/editor/contextualListener.js @@ -119,7 +119,7 @@ class ContextualListener { const css = csjs` .highlightref_fullLine { position:absolute; - z-index:20; + z-index:2; opacity: 0.4; background-color: var(--info); } @@ -139,7 +139,7 @@ class ContextualListener { } const fileName = lastCompilationResult.getSourceName(position.file) if (fileName) { - return this.editor.addMarker(lineColumn, fileName, css.highlightref_fullLine.className) + return this.editor.addMarker(lineColumn, fileName, css.highlightref_fullLine) } } return null