================
@@ -287,6 +287,79 @@ inline size_t ColumnWidth(llvm::StringRef str) {
   return llvm::sys::locale::columnWidth(stripped);
 }
 
+// This function converts an index into "visible" text (text with ANSI codes
+// removed) into an index into the actual data of the text (which includes ANSI
+// codes). That actual index should be used when printing the actual data.
+//
+// If a character is preceeded by an ANSI code, the returned actual index will
+// point to that ANSI code. As formatting that visible character requires the
+// code.
+//
+// This logic does not extend to whole words. This function assumes you are not
+// going to split up the words of whatever text you pass in here. Making sure
+// not to split words is the responsibility of the caller of this function.
+//
+// Returns a pair containing {visible index, actual index}. This may be passed
----------------
JDevlieghere wrote:

I assume this was written before you created the VisibleActualIdxPair struct.

https://github.com/llvm/llvm-project/pull/178653
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to