Skip to content

Commit

Permalink
Change to linewrap
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten committed Jun 17, 2024
1 parent 95c15bd commit 01e74b5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/ha-code-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class HaCodeEditor extends ReactiveElement {

@property({ type: Boolean }) public readOnly = false;

@property({ type: Boolean }) public wrap = false;
@property({ type: Boolean }) public linewrap = false;

@property({ type: Boolean, attribute: "autocomplete-entities" })
public autocompleteEntities = false;
Expand Down Expand Up @@ -136,10 +136,10 @@ export class HaCodeEditor extends ReactiveElement {
),
});
}
if (changedProps.has("wrap")) {
if (changedProps.has("linewrap")) {
transactions.push({
effects: this._loadedCodeMirror!.linewrapCompartment!.reconfigure(
this.wrap ? this._loadedCodeMirror!.EditorView.lineWrapping : []
this.linewrap ? this._loadedCodeMirror!.EditorView.lineWrapping : []
),
});
}
Expand Down Expand Up @@ -191,7 +191,7 @@ export class HaCodeEditor extends ReactiveElement {
this._loadedCodeMirror.EditorView.editable.of(!this.readOnly)
),
this._loadedCodeMirror.linewrapCompartment.of(
this.wrap ? this._loadedCodeMirror.EditorView.lineWrapping : []
this.linewrap ? this._loadedCodeMirror.EditorView.lineWrapping : []
),
this._loadedCodeMirror.EditorView.updateListener.of(this._onUpdate),
];
Expand Down

0 comments on commit 01e74b5

Please sign in to comment.