Keep indentation when pasting code into the editor (#779)

This commit is contained in:
Jonatan Kłosko 2021-12-09 12:18:41 +01:00 committed by GitHub
parent 973fc51c9d
commit ee2602c932
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -164,6 +164,10 @@ class LiveEditor {
fontFamily: "JetBrains Mono, Droid Sans Mono, monospace",
fontSize: 14,
tabIndex: -1,
tabSize: 2,
autoIndent: true,
formatOnType: true,
formatOnPaste: true,
quickSuggestions:
this.type === "elixir" && settings.editor_auto_completion,
tabCompletion: "on",
@ -176,16 +180,6 @@ class LiveEditor {
parameterHints: this.type === "elixir" && settings.editor_auto_signature,
});
this.editor.getModel().updateOptions({
tabSize: 2,
});
this.editor.updateOptions({
autoIndent: true,
tabSize: 2,
formatOnType: true,
});
// Automatically adjust the editor size to fit the container.
const resizeObserver = new ResizeObserver((entries) => {
entries.forEach((entry) => {