From bce155b5a40f3e6b4b4c8f2420fe71a6bdf1a3b0 Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 25 Feb 2024 16:26:49 +0100 Subject: [PATCH] fix wrong indentation on new line --- vstgui/lib/ctexteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vstgui/lib/ctexteditor.cpp b/vstgui/lib/ctexteditor.cpp index 2a8bfb9ab..0c6dbc179 100644 --- a/vstgui/lib/ctexteditor.cpp +++ b/vstgui/lib/ctexteditor.cpp @@ -1321,7 +1321,7 @@ void TextEditorView::insertNewLine () const auto isWhiteSpace = [] (char16_t character) { return character == u'\t' || character == u' '; }; - for (auto index = currentLine->range.start; index < currentLine->range.end (); ++index) + for (auto index = currentLine->range.start; index < cursor; ++index) { if (isWhiteSpace (md.model.text[index])) {