MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / pop_cursor

Function pop_cursor

subprojects/llama.cpp/common/console.cpp:263–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)

Callers 3

replace_lastFunction · 0.85
readline_advancedFunction · 0.85
stopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected