summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/TextDocument.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibGUI/TextDocument.cpp')
-rw-r--r--Userland/Libraries/LibGUI/TextDocument.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/TextDocument.cpp b/Userland/Libraries/LibGUI/TextDocument.cpp
index 9d7b6a0bdb..5c7a1d92ac 100644
--- a/Userland/Libraries/LibGUI/TextDocument.cpp
+++ b/Userland/Libraries/LibGUI/TextDocument.cpp
@@ -786,6 +786,10 @@ void InsertTextCommand::perform_formatting(const TextDocument::Client& client)
for (auto input_char : m_text) {
if (input_char == '\n') {
+ size_t spaces_at_end = 0;
+ if (column < line_indentation)
+ spaces_at_end = line_indentation - column;
+ line_indentation -= spaces_at_end;
builder.append('\n');
column = 0;
if (should_auto_indent) {