| 263 | } |
| 264 | |
| 265 | static void pop_cursor() { |
| 266 | #if defined(_WIN32) |
| 267 | if (hConsole != NULL) { |
| 268 | CONSOLE_SCREEN_BUFFER_INFO bufferInfo; |
| 269 | GetConsoleScreenBufferInfo(hConsole, &bufferInfo); |
| 270 | |
| 271 | COORD newCursorPosition = bufferInfo.dwCursorPosition; |
| 272 | if (newCursorPosition.X == 0) { |
| 273 | newCursorPosition.X = bufferInfo.dwSize.X - 1; |
| 274 | newCursorPosition.Y -= 1; |
| 275 | } else { |
| 276 | newCursorPosition.X -= 1; |
| 277 | } |
| 278 | |
| 279 | SetConsoleCursorPosition(hConsole, newCursorPosition); |
| 280 | return; |
| 281 | } |
| 282 | #endif |
| 283 | putc('\b', out); |
| 284 | } |
| 285 | |
| 286 | static int estimateWidth(char32_t codepoint) { |
| 287 | #if defined(_WIN32) |
no outgoing calls
no test coverage detected