Commit caa1ccfb authored by Denys Mishunov's avatar Denys Mishunov

Renamed 'diff' to 'isDiff'

Done to highlight its boolean nature. As per review
parent 8a9e379a
......@@ -110,7 +110,7 @@ export default class EditorLite {
blobOriginalContent,
blobGlobalId,
instance,
diff,
isDiff,
} = {}) {
if (!instance) {
return null;
......@@ -119,7 +119,7 @@ export default class EditorLite {
const uri = Uri.file(uriFilePath);
const existingModel = monacoEditor.getModel(uri);
const model = existingModel || monacoEditor.createModel(blobContent, undefined, uri);
if (!diff) {
if (!isDiff) {
instance.setModel(model);
return model;
}
......@@ -198,12 +198,12 @@ export default class EditorLite {
blobOriginalContent = '',
blobGlobalId = uuids()[0],
extensions = [],
diff = false,
isDiff = false,
...instanceOptions
} = {}) {
EditorLite.prepareInstance(el);
const createEditorFn = diff ? 'createDiffEditor' : 'create';
const createEditorFn = isDiff ? 'createDiffEditor' : 'create';
const instance = EditorLite.convertMonacoToELInstance(
monacoEditor[createEditorFn].call(this, el, {
...this.options,
......@@ -219,7 +219,7 @@ export default class EditorLite {
blobPath,
blobContent,
instance,
diff,
isDiff,
});
}
......@@ -237,7 +237,7 @@ export default class EditorLite {
createDiffInstance(args) {
return this.createInstance({
...args,
diff: true,
isDiff: true,
});
}
......
......@@ -178,7 +178,7 @@ describe('Base editor', () => {
editor.createDiffInstance();
expect(spy).toHaveBeenCalledWith(
expect.objectContaining({
diff: true,
isDiff: true,
}),
);
});
......
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