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