diff options
author | Andreas Kling <kling@serenityos.org> | 2020-12-21 09:26:31 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-21 09:26:31 +0100 |
commit | 09e069bc0b489284a46acac3f614235a473ecc3d (patch) | |
tree | ef31752909ce61baa6fd5b0d2727420d4bcd7617 /Libraries/LibGUI | |
parent | 02ea193630d321004622f742df97e59814ed5e35 (diff) | |
download | serenity-09e069bc0b489284a46acac3f614235a473ecc3d.zip |
LibGUI: Soft tab expansion should be based on insertion column
We were using the line length as the column, which worked as long as
you were at the end of the line, but not so well otherwise. :^)
Diffstat (limited to 'Libraries/LibGUI')
-rw-r--r-- | Libraries/LibGUI/TextDocument.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibGUI/TextDocument.cpp b/Libraries/LibGUI/TextDocument.cpp index 0c2003b891..986c4cd308 100644 --- a/Libraries/LibGUI/TextDocument.cpp +++ b/Libraries/LibGUI/TextDocument.cpp @@ -679,7 +679,7 @@ void InsertTextCommand::perform_formatting(const TextDocument::Client& client) const bool should_auto_indent = client.is_automatic_indentation_enabled(); StringBuilder builder; - size_t column = dest_line.length(); + size_t column = m_range.start().column(); size_t line_indentation = dest_line.leading_spaces(); bool at_start_of_line = line_indentation == column; |