(text: string, index: number)
| 1206 | |
| 1207 | // Convert string index to display width |
| 1208 | public stringIndexToDisplayWidth(text: string, index: number): number { |
| 1209 | if (index <= 0) return 0 |
| 1210 | if (index >= text.length) return stringWidth(text) |
| 1211 | return stringWidth(text.substring(0, index)) |
| 1212 | } |
| 1213 | |
| 1214 | // Convert display width to string index |
| 1215 | public displayWidthToStringIndex(text: string, targetWidth: number): number { |
no outgoing calls
no test coverage detected