From 75a98c3e33d22352e73c4ca66e72b4f50ee4e378 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 7 Sep 2018 17:21:36 +0200 Subject: [PATCH] add `currentFile` --- src/app/files/fileManager.js | 5 +++++ src/app/plugin/pluginAPI.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 17e13486f4..eea9461749 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -79,6 +79,11 @@ class FileManager { return null } + currentFile () { + var self = this + return self._deps.config.get('currentFile') + } + currentPath () { var self = this var currentFile = self._deps.config.get('currentFile') diff --git a/src/app/plugin/pluginAPI.js b/src/app/plugin/pluginAPI.js index c0d1f2f389..18faeb538d 100644 --- a/src/app/plugin/pluginAPI.js +++ b/src/app/plugin/pluginAPI.js @@ -67,7 +67,7 @@ module.exports = (pluginManager, fileProviders, fileManager, compiler, udapp) => }, editor: { getCurrentFile: (mod, cb) => { - var path = fileManager.currentPath() + var path = fileManager.currentFile() if (!path) { cb('no file selected') } else {