From ce9520ca87664acdaa5a7107c438c4dcd29dc5ef Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 15 Aug 2024 23:17:54 +0200 Subject: [PATCH] [stylus mode] Fix a crash in indentation code FIX: Fix a bug where the Stylus mode would crash when queried for indentation. Closes https://github.com/codemirror/dev/issues/1424 --- mode/stylus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mode/stylus.js b/mode/stylus.js index 0fb77f9..be81cec 100644 --- a/mode/stylus.js +++ b/mode/stylus.js @@ -694,7 +694,7 @@ export const stylus = { ch = textAfter && textAfter.charAt(0), indent = cx.indent, lineFirstWord = firstWordOfLine(textAfter), - lineIndent = iCx.lineIndent(iCx.pos), + lineIndent = cx.line.indent, prevLineFirstWord = state.context.prev ? state.context.prev.line.firstWord : "", prevLineIndent = state.context.prev ? state.context.prev.line.indent : lineIndent;