MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / re_refresh

Function re_refresh

extern/editline/src/refresh.c:199–337  ·  view source on GitHub ↗

re_refresh(): * draws the new virtual screen image from the current input * line, then goes line-by-line changing the real image to the new * virtual image. The routine to re-draw a line can be replaced * easily in hopes of a smarter one being placed there. */

Source from the content-addressed store, hash-verified

197 * easily in hopes of a smarter one being placed there.
198 */
199protected void
200re_refresh(EditLine *el)
201{
202 int i, rhdiff;
203 Char *cp, *st;
204 coord_t cur;
205#ifdef notyet
206 size_t termsz;
207#endif
208
209 ELRE_DEBUG(1, (__F, "el->el_line.buffer = :%s:\r\n",
210 el->el_line.buffer));
211
212 /* reset the Drawing cursor */
213 el->el_refresh.r_cursor.h = 0;
214 el->el_refresh.r_cursor.v = 0;
215
216 /* temporarily draw rprompt to calculate its size */
217 prompt_print(el, EL_RPROMPT);
218
219 /* reset the Drawing cursor */
220 el->el_refresh.r_cursor.h = 0;
221 el->el_refresh.r_cursor.v = 0;
222
223 if (el->el_line.cursor >= el->el_line.lastchar) {
224 if (el->el_map.current == el->el_map.alt
225 && el->el_line.lastchar != el->el_line.buffer)
226 el->el_line.cursor = el->el_line.lastchar - 1;
227 else
228 el->el_line.cursor = el->el_line.lastchar;
229 }
230
231 cur.h = -1; /* set flag in case I'm not set */
232 cur.v = 0;
233
234 prompt_print(el, EL_PROMPT);
235
236 /* draw the current input buffer */
237#if notyet
238 termsz = el->el_terminal.t_size.h * el->el_terminal.t_size.v;
239 if (el->el_line.lastchar - el->el_line.buffer > termsz) {
240 /*
241 * If line is longer than terminal, process only part
242 * of line which would influence display.
243 */
244 size_t rem = (el->el_line.lastchar-el->el_line.buffer)%termsz;
245
246 st = el->el_line.lastchar - rem
247 - (termsz - (((rem / el->el_terminal.t_size.v) - 1)
248 * el->el_terminal.t_size.v));
249 } else
250#endif
251 st = el->el_line.buffer;
252
253 for (cp = st; cp < el->el_line.lastchar; cp++) {
254 if (cp == el->el_line.cursor) {
255 int w = Width(*cp);
256 /* save for later */

Callers 11

sig_handlerFunction · 0.85
vi_comment_outFunction · 0.85
el_setFunction · 0.85
ed_insertFunction · 0.85
FUN(el,set)Function · 0.85
ce_inc_searchFunction · 0.85
cv_searchFunction · 0.85
c_getsFunction · 0.85
read_prepareFunction · 0.85
FUN(el,gets)Function · 0.85
re_fastaddcFunction · 0.85

Calls 11

prompt_printFunction · 0.85
WidthFunction · 0.85
re_addcFunction · 0.85
re_putcFunction · 0.85
ct_encode_stringFunction · 0.85
re_update_lineFunction · 0.85
re__copy_and_padFunction · 0.85
terminal_move_to_lineFunction · 0.85
terminal_move_to_charFunction · 0.85
terminal_clear_EOLFunction · 0.85
terminal_overwriteFunction · 0.85

Tested by

no test coverage detected