1
0
mirror of https://github.com/salexdv/bsl_console.git synced 2024-11-28 08:48:48 +02:00

Функция, возвращающая количество различий #173

This commit is contained in:
salexdv 2021-06-06 21:26:33 +03:00
parent bdc81dbd8f
commit 8966112d07

View File

@ -584,6 +584,7 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
this.getOriginalEditor().diffDecor.line = original_line;
}
this.diffEditorUpdateDecorations();
editor.diffCount = editor.getLineChanges().length;
}, 50);
};
editor.markDiffLines();
@ -603,6 +604,7 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
});
originalText = '';
editor.onKeyDown(e => editorOnKeyDown(e));
editor.diffCount = 0;
}
editor.updateOptions({ readOnly: readOnlyMode });
}
@ -1226,6 +1228,7 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
editor.calculateDiff = (originalText || setEmptyOriginalText);
if (!editor.calculateDiff) {
editor.diffCount = 0;
editor.removeDiffWidget();
editor.diff_decorations = [];
}
@ -1260,6 +1263,12 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
return { errorDescription: e.message };
}
}
getDiffCount = function() {
return editor.diffCount ? editor.diffCount : 0;
}
// #endregion
@ -1493,6 +1502,7 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
editor.getOriginalEditor().diffDecor.position = 0;
getActiveDiffEditor().diffDecor.position = e.position.lineNumber;
editor.diffEditorUpdateDecorations();
editor.diffCount = editor.getLineChanges().length;
}
}
@ -1950,6 +1960,7 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
if (Array.isArray(changes)) {
editor.diffCount = changes.length;
editor.diff_decorations = [];
changes.forEach(function (e) {