From 8dac6c264a3810c80c901ac7897dbffc17913379 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Fri, 28 Jun 2019 11:01:55 +0200 Subject: [PATCH] "save as" saves a copy with .vy extention and a number --- src/app/files/fileManager.js | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 7cb8206b53..6af34bb86b 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -5,6 +5,7 @@ const EventEmitter = require('events') var globalRegistry = require('../../global/registry') var CompilerImport = require('../compiler/compiler-imports') var toaster = require('../ui/tooltip') +var helper = require('../../lib/helper.js') import { FileSystemApi } from 'remix-plugin' import * as packageJson from '../../../package.json' @@ -136,19 +137,31 @@ class FileManager extends FileSystemApi { async setFile (path, content) { if (this.currentRequest) { let reject = false - let savedAsAnotherFile = false + let savedAsCopy = false let actions = (toaster) => { return yo`
- + + }}> + Save As Copy +
` } await toaster(yo` @@ -159,7 +172,7 @@ class FileManager extends FileSystemApi { `, actions, { time: 4000 }) if (reject) throw new Error(`set file operation on ${path} aborted by user.`) - if (savedAsAnotherFile) return + if (savedAsCopy) return } this._setFileInternal(path, content) }