re_putc(): * Draw the character given */
| 161 | * Draw the character given |
| 162 | */ |
| 163 | protected void |
| 164 | re_putc(EditLine *el, Int c, int shift) |
| 165 | { |
| 166 | int i, w = Width(c); |
| 167 | ELRE_DEBUG(1, (__F, "printing %5x '%c'\r\n", c, c)); |
| 168 | |
| 169 | while (shift && (el->el_refresh.r_cursor.h + w > el->el_terminal.t_size.h)) |
| 170 | re_putc(el, ' ', 1); |
| 171 | |
| 172 | el->el_vdisplay[el->el_refresh.r_cursor.v] |
| 173 | [el->el_refresh.r_cursor.h] = c; |
| 174 | /* assumes !shift is only used for single-column chars */ |
| 175 | i = w; |
| 176 | while (--i > 0) |
| 177 | el->el_vdisplay[el->el_refresh.r_cursor.v] |
| 178 | [el->el_refresh.r_cursor.h + i] = MB_FILL_CHAR; |
| 179 | |
| 180 | if (!shift) |
| 181 | return; |
| 182 | |
| 183 | el->el_refresh.r_cursor.h += w; /* advance to next place */ |
| 184 | if (el->el_refresh.r_cursor.h >= el->el_terminal.t_size.h) { |
| 185 | /* assure end of line */ |
| 186 | el->el_vdisplay[el->el_refresh.r_cursor.v][el->el_terminal.t_size.h] |
| 187 | = '\0'; |
| 188 | re_nextline(el); |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | |
| 193 | /* re_refresh(): |
no test coverage detected