Unverified Commit b6c4a4e6 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #2845 from ethereum/fix#2836

Make sure to highlight using internal path
parents ecdd1fbd 34b73c11
......@@ -39,8 +39,9 @@ class SourceHighlighter {
this.source = null
if (lineColumnPos) {
this.source = filePath
if (this._deps.config.get('currentFile') !== this.source) {
if (this._deps.fileManager.currentFile() !== this.source) {
await this._deps.fileManager.open(this.source)
this.source = this._deps.fileManager.currentFile()
}
const css = csjs`
......
......@@ -432,13 +432,16 @@ class FileManager extends Plugin {
openFile (file) {
const _openFile = (file) => {
this.saveCurrentFile()
const provider = this.fileProviderOf(file)
if (!provider) return console.error(`no provider for ${file}`)
file = provider.getPathFromUrl(file) || file // in case an external URL is given as input, we resolve it to the right internal path
this._deps.config.set('currentFile', file)
this.openedFiles[file] = file
this.fileProviderOf(file).get(file, (error, content) => {
provider.get(file, (error, content) => {
if (error) {
console.log(error)
} else {
if (this.fileProviderOf(file).isReadOnly(file)) {
if (provider.isReadOnly(file)) {
this.editor.openReadOnly(file, content)
} else {
this.editor.open(file, content)
......
......@@ -89,6 +89,14 @@ module.exports = class RemixDProvider {
return cb(null, result)
}
getNormalizedName (path) {
return path
}
getPathFromUrl (path) {
return path
}
get (path, cb) {
var unprefixedpath = this.removePrefix(path)
this._remixd.call('sharedfolder', 'get', {path: unprefixedpath}, (error, file) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment