"( ) => {",
"\t",
"\tGLib.debug(\"undo clicked\");",
- "\t",
+ "\tif (_this.windowstate.file.xtype == \"PlainFile\") {",
+ "\t\t_this.codeeditviewbox.view.el.undo();",
+ "\t}",
"\tif (!_this.windowstate.file.undoStep(-1)) {",
"\t\treturn;",
"\t}",
"\t",
- "\tif (_this.windowstate.file.xtype == \"PlainFile\") {",
- "\t\t_this.codeeditviewbox.el.show();",
- "\t\t_this.windowstate.switchState (WindowState.State.CODEONLY); ",
"\t ",
- "\t\t_this.windowstate.code_editor_tab.show(_this.windowstate.file, null, null);",
- "\t\t ",
- "\t} else {",
- "\t",
- "\t\t_this.windowstate.switchState (WindowState.State.PREVIEW); ",
- "\t\t// this triggers loadItems..",
- "\t\t_this.windowstate.left_tree.model.loadFile(",
- "\t\t\t_this.windowstate.file);",
- "\t\t ",
+ "\t_this.windowstate.switchState (WindowState.State.PREVIEW); ",
+ "\t// this triggers loadItems..",
+ "\t_this.windowstate.left_tree.model.loadFile(",
+ "\t\t_this.windowstate.file);",
+ "\t ",
"",
- "\t}",
+ "\t",
" ",
"",
"\t// load it everywhere",
this.el.clicked.connect( ( ) => {
GLib.debug("undo clicked");
-
+ if (_this.windowstate.file.xtype == "PlainFile") {
+ _this.codeeditviewbox.view.el.undo();
+ }
if (!_this.windowstate.file.undoStep(-1)) {
return;
}
- if (_this.windowstate.file.xtype == "PlainFile") {
- _this.codeeditviewbox.el.show();
- _this.windowstate.switchState (WindowState.State.CODEONLY);
- _this.windowstate.code_editor_tab.show(_this.windowstate.file, null, null);
-
- } else {
-
- _this.windowstate.switchState (WindowState.State.PREVIEW);
- // this triggers loadItems..
- _this.windowstate.left_tree.model.loadFile(
- _this.windowstate.file);
-
+ _this.windowstate.switchState (WindowState.State.PREVIEW);
+ // this triggers loadItems..
+ _this.windowstate.left_tree.model.loadFile(
+ _this.windowstate.file);
+
- }
+
// load it everywhere