mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-13 23:16:03 +08:00
Keep indentation when pasting code into the editor (#779)
This commit is contained in:
parent
973fc51c9d
commit
ee2602c932
1 changed files with 4 additions and 10 deletions
|
@ -164,6 +164,10 @@ class LiveEditor {
|
||||||
fontFamily: "JetBrains Mono, Droid Sans Mono, monospace",
|
fontFamily: "JetBrains Mono, Droid Sans Mono, monospace",
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
tabIndex: -1,
|
tabIndex: -1,
|
||||||
|
tabSize: 2,
|
||||||
|
autoIndent: true,
|
||||||
|
formatOnType: true,
|
||||||
|
formatOnPaste: true,
|
||||||
quickSuggestions:
|
quickSuggestions:
|
||||||
this.type === "elixir" && settings.editor_auto_completion,
|
this.type === "elixir" && settings.editor_auto_completion,
|
||||||
tabCompletion: "on",
|
tabCompletion: "on",
|
||||||
|
@ -176,16 +180,6 @@ class LiveEditor {
|
||||||
parameterHints: this.type === "elixir" && settings.editor_auto_signature,
|
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.
|
// Automatically adjust the editor size to fit the container.
|
||||||
const resizeObserver = new ResizeObserver((entries) => {
|
const resizeObserver = new ResizeObserver((entries) => {
|
||||||
entries.forEach((entry) => {
|
entries.forEach((entry) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue