| 216 | } |
| 217 | |
| 218 | static void pop_cursor() { |
| 219 | #if defined(_WIN32) |
| 220 | if (hConsole != NULL) { |
| 221 | CONSOLE_SCREEN_BUFFER_INFO bufferInfo; |
| 222 | GetConsoleScreenBufferInfo(hConsole, &bufferInfo); |
| 223 | |
| 224 | COORD newCursorPosition = bufferInfo.dwCursorPosition; |
| 225 | if (newCursorPosition.X == 0) { |
| 226 | newCursorPosition.X = bufferInfo.dwSize.X - 1; |
| 227 | newCursorPosition.Y -= 1; |
| 228 | } else { |
| 229 | newCursorPosition.X -= 1; |
| 230 | } |
| 231 | |
| 232 | SetConsoleCursorPosition(hConsole, newCursorPosition); |
| 233 | return; |
| 234 | } |
| 235 | #endif |
| 236 | putc('\b', out); |
| 237 | } |
| 238 | |
| 239 | static int estimateWidth(char32_t codepoint) { |
| 240 | #if defined(_WIN32) |
no outgoing calls
no test coverage detected