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