Skip to content

Commit 2498f0b

Browse files
authored
[lldb] Add more command option mnemonics (llvm#155705)
Add a bunch of mnemonics to the command options now that they're highlighted in the help output. This uncovered two issues: - We had an instance where we weren't applying the ANSI formatting. - We had a place where we were now incorrectly computing the column width. Both are fixed by this PR.
1 parent b259dbd commit 2498f0b

File tree

5 files changed

+185
-151
lines changed

5 files changed

+185
-151
lines changed

lldb/include/lldb/Utility/AnsiTerminal.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ inline std::string TrimAndPad(llvm::StringRef str, size_t visible_length,
260260
return result;
261261
}
262262

263+
inline size_t ColumnWidth(llvm::StringRef str) {
264+
std::string stripped = ansi::StripAnsiTerminalCodes(str);
265+
return llvm::sys::locale::columnWidth(stripped);
266+
}
267+
263268
} // namespace ansi
264269
} // namespace lldb_private
265270

0 commit comments

Comments
 (0)