make sure we hightlight the current file

pull/1/head
yann300 7 years ago
parent 6a4c434c3e
commit 1aa49cc003
  1. 7
      src/app.js
  2. 4
      src/app/editor/contextualListener.js

@ -395,8 +395,11 @@ function run () {
return compiler.lastCompilationResult
},
highlight: (position, node) => {
position = offsetToLineColumnConverter.offsetToLineColumn(position, position.file, compiler.lastCompilationResult)
return editor.addMarker(position, config.get('currentFile'), 'highlightcall')
if (compiler.lastCompilationResult && compiler.lastCompilationResult.source && compiler.lastCompilationResult.source.target === config.get('currentFile')) {
position = offsetToLineColumnConverter.offsetToLineColumn(position, position.file, compiler.lastCompilationResult)
return editor.addMarker(position, config.get('currentFile'), 'highlightcall')
}
return null
},
stopHighlighting: (event) => {
editor.removeMarker(event.eventId, event.fileTarget)

@ -67,7 +67,9 @@ class ContextualListener {
var node = calls[call]
var position = self.sourceMappingDecoder.decode(node.src)
var eventId = self._api.highlight(position, node)
self._events.push({ eventId, position, fileTarget: compilationResult.source.target })
if (eventId) {
self._events.push({ eventId, position, fileTarget: compilationResult.source.target })
}
}
}
}

Loading…
Cancel
Save