diff options
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/help/TestHelp.py | 9 | ||||
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/help/TestHelp.py b/lldb/packages/Python/lldbsuite/test/help/TestHelp.py index 21eeb0bf63a..2b89b49a622 100644 --- a/lldb/packages/Python/lldbsuite/test/help/TestHelp.py +++ b/lldb/packages/Python/lldbsuite/test/help/TestHelp.py @@ -230,3 +230,12 @@ class HelpCommandTestCase(TestBase): 'command alias --long-help "I am a very friendly alias" -- averyfriendlyalias help') self.expect("help averyfriendlyalias", matching=True, substrs=['I am a very friendly alias']) + @no_debug_info_test + def test_help_format_output(self): + """Test that help output reaches TerminalWidth.""" + self.runCmd( + 'settings set term-width 108') + self.expect( + "help format", + matching=True, + substrs=['<format> -- One of the format names']) diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 986be7ffbf8..5efc6d1db27 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -2569,7 +2569,7 @@ void CommandInterpreter::OutputHelpText(Stream &strm, llvm::StringRef word_text, while (!text.empty()) { if (text.front() == '\n' || - (text.front() == ' ' && nextWordLength(text.ltrim(' ')) < chars_left)) { + (text.front() == ' ' && nextWordLength(text.ltrim(' ')) > chars_left)) { strm.EOL(); strm.Indent(); chars_left = max_columns - indent_size; |