[Lldb-commits] [lldb] [lldb] Fix output of `help format` (PR #190409)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 3 18:19:53 PDT 2026


================
@@ -3173,14 +3173,14 @@ void CommandInterpreter::OutputHelpText(Stream &strm, llvm::StringRef word_text,
 
   uint32_t chars_left = max_columns;
 
-  auto nextWordLength = [](llvm::StringRef S) {
-    size_t pos = S.find(' ');
+  auto next_chunk_length = [](llvm::StringRef S) {
+    size_t pos = S.find_first_of(" \n", S.find_first_not_of(' '));
----------------
JDevlieghere wrote:

The signature of `find_first_of` isn't super trivial and the nesting makes it even more counterintuitive. I'd have a local or a `/*From=*/`.
```suggestion
	const size_t from = S.find_first_not_of(' ');
    const size_t pos = S.find_first_of(" \n", front);
```

https://github.com/llvm/llvm-project/pull/190409


More information about the lldb-commits mailing list