Make sure to highlight using internal path
pull/4/head
yann300 5 years ago committed by GitHub
commit b6c4a4e6e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/app/editor/sourceHighlighter.js
  2. 7
      src/app/files/fileManager.js
  3. 8
      src/app/files/remixDProvider.js

@ -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) => {

Loading…
Cancel
Save