| 2244 | } |
| 2245 | |
| 2246 | void 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 |
| 2268 | void TextEntry::LineReader::clipboard_paste() |