diff --git a/configs/client-default.js b/configs/client-default.js
index 746f4a6b..c586565f 100644
--- a/configs/client-default.js
+++ b/configs/client-default.js
@@ -721,6 +721,8 @@ module.exports = function(options) {
"plugins/c9.ide.test.mocha/mocha",
+ "plugins/salesforce.sync/package.editor",
+
// git integration
"plugins/c9.ide.scm/scm",
"plugins/c9.ide.scm/scmpanel",
diff --git a/plugins/c9.ide.editors/tab.js b/plugins/c9.ide.editors/tab.js
index 11c18440..e841ebef 100644
--- a/plugins/c9.ide.editors/tab.js
+++ b/plugins/c9.ide.editors/tab.js
@@ -258,6 +258,8 @@ define(function(require, module, exports) {
);
return;
}
+
+ var currentValue = plugin.document.value;
editorType = type;
amlTab.setAttribute("type", "editor::" + type);
@@ -265,6 +267,11 @@ define(function(require, module, exports) {
if (amlPane.getPage() == amlTab) {
amlPane.activepage = -1;
amlPane.set(amlTab);
+
+ plugin.document.value = currentValue;
+ // TODO undo managers for different editors conflict
+ // however, resetting removes changed state
+ // plugin.document.undoManager.reset();
}
callback();
diff --git a/plugins/c9.ide.editors/undomanager.js b/plugins/c9.ide.editors/undomanager.js
index a275e5a5..2bfbe834 100644
--- a/plugins/c9.ide.editors/undomanager.js
+++ b/plugins/c9.ide.editors/undomanager.js
@@ -25,6 +25,7 @@ define(function(require, module, exports) {
return false;
var item = stack[position];
+ if (!item) return;
if (!item.undo)
item = stack[position] = findItem(item);
position--;
@@ -43,6 +44,7 @@ define(function(require, module, exports) {
position++;
var item = stack[position];
+ if (!item) return;
if (!item.redo)
item = stack[position] = findItem(item);
item.redo();
@@ -119,7 +121,7 @@ define(function(require, module, exports) {
stack: stack
.filter(function(item){ return item; })
.map(function(item) {
- return item.getState ? item.getState() : item;
+ return item && item.getState ? item.getState() : item;
})
};
}
@@ -141,7 +143,7 @@ define(function(require, module, exports) {
return emit("itemFind", { state: compressedItem });
}
- function reset(){
+ function reset(keepChange){
if (position == -1)
return;
diff --git a/plugins/c9.ide.ui/forms.js b/plugins/c9.ide.ui/forms.js
index 471a9e4a..0ab3e6f8 100644
--- a/plugins/c9.ide.ui/forms.js
+++ b/plugins/c9.ide.ui/forms.js
@@ -456,20 +456,25 @@ define(function(require, exports, module) {
case "dropdown":
var dropdown = el.lastChild;
- var data = item.items.map(function(item) {
- return " ";
- }).join("");
- if (data) {
- setTimeout(function(){
- dropdown.$model.load("" + data + "");
-
+ if (item.items) {
+ var data = item.items.map(function(item) {
+ return " ";
+ }).join("");
+ if (data) {
setTimeout(function(){
- var value = item.value || dropdown.value;
- dropdown.value = -999;
- dropdown.setAttribute("value", value);
+ dropdown.$model.load("" + data + "");
+
+ setTimeout(function(){
+ var value = item.value || dropdown.value;
+ dropdown.value = -999;
+ dropdown.setAttribute("value", value);
+ });
});
- });
+ }
+ }
+ else if (item.value) {
+ dropdown.setAttribute("value", item.value);
}
break;
default: