(text: string, index: number)
| 1231 | |
| 1232 | // Convert string index to display width |
| 1233 | public stringIndexToDisplayWidth(text: string, index: number): number { |
| 1234 | if (index <= 0) return 0 |
| 1235 | if (index >= text.length) return stringWidth(text) |
| 1236 | return stringWidth(text.substring(0, index)) |
| 1237 | } |
| 1238 | |
| 1239 | // Convert display width to string index |
| 1240 | public displayWidthToStringIndex(text: string, targetWidth: number): number { |
no outgoing calls
no test coverage detected