Commit cc066314 authored by Phil Hughes's avatar Phil Hughes

Fixed empty editors in the IDE

Closes #46153
parent 9a54cb36
...@@ -14,12 +14,12 @@ export default class Model { ...@@ -14,12 +14,12 @@ export default class Model {
(this.originalModel = this.monaco.editor.createModel( (this.originalModel = this.monaco.editor.createModel(
head ? head.content : this.file.raw, head ? head.content : this.file.raw,
undefined, undefined,
new this.monaco.Uri(null, null, `original/${this.file.key}`), new this.monaco.Uri(null, null, `original/${this.path}`),
)), )),
(this.model = this.monaco.editor.createModel( (this.model = this.monaco.editor.createModel(
this.content, this.content,
undefined, undefined,
new this.monaco.Uri(null, null, this.file.key), new this.monaco.Uri(null, null, this.path),
)), )),
); );
if (this.file.mrChange) { if (this.file.mrChange) {
...@@ -27,7 +27,7 @@ export default class Model { ...@@ -27,7 +27,7 @@ export default class Model {
(this.baseModel = this.monaco.editor.createModel( (this.baseModel = this.monaco.editor.createModel(
this.file.baseRaw, this.file.baseRaw,
undefined, undefined,
new this.monaco.Uri(null, null, `target/${this.file.path}`), new this.monaco.Uri(null, null, `target/${this.path}`),
)), )),
); );
} }
......
...@@ -196,6 +196,8 @@ export const unstageChange = ({ commit }, path) => { ...@@ -196,6 +196,8 @@ export const unstageChange = ({ commit }, path) => {
}; };
export const openPendingTab = ({ commit, getters, dispatch, state }, { file, keyPrefix }) => { export const openPendingTab = ({ commit, getters, dispatch, state }, { file, keyPrefix }) => {
if (getters.activeFile && getters.activeFile.key === `${keyPrefix}-${file.key}`) return false;
state.openFiles.forEach(f => eventHub.$emit(`editor.update.model.dispose.${f.key}`)); state.openFiles.forEach(f => eventHub.$emit(`editor.update.model.dispose.${f.key}`));
commit(types.ADD_PENDING_TAB, { file, keyPrefix }); commit(types.ADD_PENDING_TAB, { file, keyPrefix });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment