kopia lustrzana https://github.com/c9/core
Merge pull request +6757 from c9/fix/collab
fix +5962 Cloned tab goes out of syncpull/51/merge
commit
619ef87c5d
|
@ -11,7 +11,7 @@ define(function(require, exports, module) {
|
||||||
function main(options, imports, register) {
|
function main(options, imports, register) {
|
||||||
var c9 = imports.c9;
|
var c9 = imports.c9;
|
||||||
var Plugin = imports.Plugin;
|
var Plugin = imports.Plugin;
|
||||||
var _ = require("lodash");
|
var normalize = require("path").normalize;
|
||||||
|
|
||||||
var plugin = new Plugin("Ajax.org", main.consumes);
|
var plugin = new Plugin("Ajax.org", main.consumes);
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ define(function(require, exports, module) {
|
||||||
var reHome = new RegExp("^" + plugin.escapeRegExp(c9.home || "/home/ubuntu"));
|
var reHome = new RegExp("^" + plugin.escapeRegExp(c9.home || "/home/ubuntu"));
|
||||||
plugin.normalizePath = function(path){
|
plugin.normalizePath = function(path){
|
||||||
if (!path || path.charAt(0) == "~") return path;
|
if (!path || path.charAt(0) == "~") return path;
|
||||||
return (path.replace(/^[\/]+/, "/")).replace(reHome, "~");
|
return normalize(path.replace(reHome, "~"));
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -64,7 +64,7 @@ define(function(require, exports, module) {
|
||||||
throw new Error("Missing callback for " + name);
|
throw new Error("Missing callback for " + name);
|
||||||
|
|
||||||
if (!/^[!~/]/.test(path)) {
|
if (!/^[!~/]/.test(path)) {
|
||||||
var e = new Error("Invalid path passed to fs");
|
var e = new Error("Invalid path passed to fs " + name);
|
||||||
e.data = { name: name, path: path };
|
e.data = { name: name, path: path };
|
||||||
setTimeout(function() { throw e });
|
setTimeout(function() { throw e });
|
||||||
return args[args.length - 1](e);
|
return args[args.length - 1](e);
|
||||||
|
|
|
@ -1004,6 +1004,11 @@ define(function(require, module, exports) {
|
||||||
&& t.document.title === options.title));
|
&& t.document.title === options.title));
|
||||||
})[0]);
|
})[0]);
|
||||||
|
|
||||||
|
// prevent opening of same tab twice in non cloned mode
|
||||||
|
// TODO move cloning into ace?
|
||||||
|
if (!tab)
|
||||||
|
tab = findTab(path);
|
||||||
|
|
||||||
// Clone Tab
|
// Clone Tab
|
||||||
if (((options.document || 0).meta || 0).cloned) {
|
if (((options.document || 0).meta || 0).cloned) {
|
||||||
if (!tab) {
|
if (!tab) {
|
||||||
|
|
Ładowanie…
Reference in New Issue