From 2010622ae35c6c2189aae0725d483c60402afbe0 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Mon, 3 Aug 2026 11:13:25 +0100 Subject: [PATCH] Handle missing state field in line wrapping indentation extension (#35442) GitOrigin-RevId: 7cc03042c42fbc4afe14438cd9347da7682815c6 --- .../source-editor/extensions/line-wrapping-indentation.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/source-editor/extensions/line-wrapping-indentation.ts b/services/web/frontend/js/features/source-editor/extensions/line-wrapping-indentation.ts index 0b1ce354b0..31f47b6003 100644 --- a/services/web/frontend/js/features/source-editor/extensions/line-wrapping-indentation.ts +++ b/services/web/frontend/js/features/source-editor/extensions/line-wrapping-indentation.ts @@ -48,7 +48,8 @@ export const lineWrappingIndentation = (visual: boolean) => { ) }, write(value: number, view: EditorView) { - if (view.state.field(field) !== value) { + const stateValue = view.state.field(field, false) + if (stateValue !== undefined && stateValue !== value) { window.setTimeout(() => { view.dispatch({ effects: setMaxIndentEffect.of(value),