Skip to content

Commit

Permalink
v0.8.0 pt.19
Browse files Browse the repository at this point in the history
- update auto-completions upon switching version
- fixed undo/redo not marking a tab as unsaved
  • Loading branch information
solvedDev committed Feb 22, 2019
1 parent 3dd94a3 commit 7f3fc11
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/renderer/components/editor_shell/JsonEditor/JsonInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@
this.value = TabSystem.getCurrentNavContent();
EventBus.on("updateFileNavigation", this.updateValue);
EventBus.on("setWatcherInactive", () => this.watcher_active = false);
} else {
EventBus.on("updateAutoCompletions", () => this.updateAutoCompletions());
}
},
destroyed() {
if(this.type == "edit") {
EventBus.off("updateFileNavigation", this.updateValue);
EventBus.off("updateAutoCompletions", () => this.updateAutoCompletions());
}
},
watch: {
Expand Down Expand Up @@ -167,13 +170,12 @@
}
let current_node = TabSystem.getSelected().content.get(this.file_navigation);
let propose;
if(current_node) propose = current_node.propose(this.file_navigation);
if(current) propose = current.propose(this.file_navigation);
else propose = [];
//PLUGIN HOOK
PluginEnv.trigger("bridge:beforePropose", { propose, node: current_node });
PluginEnv.trigger("bridge:beforePropose", { propose, node: current });
propose = propose[this.type];
if(propose == undefined || propose.length == 0 || (typeof context == "string" && context != ""))
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/scripts/TabSystem/CommonHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class History {
this.redo_arr.unshift(undo.reverse());
undo.commit();
TabSystem.setCurrentFileNav("global");
TabSystem.setCurrentUnsaved();
return true;
}
/**
Expand All @@ -49,6 +50,7 @@ export class History {
this.undo_arr.unshift(redo.reverse());
redo.commit();
TabSystem.setCurrentFileNav("global");
TabSystem.setCurrentUnsaved();
return true;
}

Expand Down
6 changes: 4 additions & 2 deletions src/renderer/windows/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import TabWindow from "../scripts/commonWindows/TabWindow";
import Store from "../store/index";
import SETTINGS from "../store/Settings";
import { MINECRAFT_VERSIONS } from "../scripts/constants";
import EventBus from "../scripts/EventBus";

class ReactiveSwitch {
constructor(parent, watch_key, def) {
Expand Down Expand Up @@ -36,7 +37,7 @@ class ReactiveInput {
}

class ReactiveDropdown {
constructor(parent, watch_key, options, def) {
constructor(parent, watch_key, options, def, cb) {
this.type = "select";
this.input = parent.data[watch_key];
this.options = options;
Expand All @@ -48,6 +49,7 @@ class ReactiveDropdown {
this.input = val;
parent.data[watch_key] = val;
parent.save();
if(typeof cb == "function") cb(val);
};
}
}
Expand All @@ -67,7 +69,7 @@ export default class SettingsWindow extends TabWindow {
color: "grey",
text: "\nTarget Minecraft Version"
},
new ReactiveDropdown(this, "target_version", MINECRAFT_VERSIONS ,{ text: "Choose a version...", key: `settings.editor.tab.target_version.${Math.random()}` }),
new ReactiveDropdown(this, "target_version", MINECRAFT_VERSIONS ,{ text: "Choose a version...", key: `settings.editor.tab.target_version.${Math.random()}` }, () => EventBus.trigger("updateAutoCompletions")),
new ReactiveSwitch(this, "use_tabs", { color: "light-green", text: "Use Tabs", key: `settings.editor.tab.tabs.${Math.random()}` }),
new ReactiveSwitch(this, "line_wraps", { color: "light-green", text: "Word Wrap", key: `settings.editor.tab.tabs.${Math.random()}` }),
new ReactiveSwitch(this, "open_all_nodes", { color: "light-green", text: "Open All Nodes", key: `settings.editor.tab.open_all_nodes.${Math.random()}` }),
Expand Down

0 comments on commit 7f3fc11

Please sign in to comment.