MCPcopy Create free account
hub / github.com/crawl/crawl / insert_char_at_cursor

Method insert_char_at_cursor

crawl-ref/source/ui.cc:2246–2265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2244}
2245
2246void TextEntry::LineReader::insert_char_at_cursor(int ch)
2247{
2248 if (wcwidth(ch) >= 0 && length + wclen(ch) < static_cast<int>(bufsz))
2249 {
2250 int len = wclen(ch);
2251 if (*cur)
2252 {
2253 char *c = buffer + length - 1;
2254 while (c >= cur)
2255 {
2256 c[len] = *c;
2257 c--;
2258 }
2259 }
2260 wctoutf8(cur, ch);
2261 cur += len;
2262 length += len;
2263 buffer[length] = 0;
2264 }
2265}
2266
2267#ifdef USE_TILE_LOCAL
2268void TextEntry::LineReader::clipboard_paste()

Callers

nothing calls this directly

Calls 3

wcwidthFunction · 0.85
wclenFunction · 0.85
wctoutf8Function · 0.85

Tested by

no test coverage detected