Changeset 08e103d4 in mainline for uspace/lib/clui/tinput.c
- Timestamp:
- 2019-02-05T18:26:05Z (5 years ago)
- Children:
- 1d2f85e
- Parents:
- d066259
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-05 16:16:55)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-05 18:26:05)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/clui/tinput.c
rd066259 r08e103d4 203 203 204 204 ti->prompt_coord = row0 * ti->con_cols + col0; 205 ti->text_coord = ti->prompt_coord + str_ length(ti->prompt);205 ti->text_coord = ti->prompt_coord + str_code_points(ti->prompt); 206 206 207 207 tinput_display_prompt(ti); … … 243 243 static void tinput_insert_string(tinput_t *ti, const char *str) 244 244 { 245 size_t ilen = min(str_ length(str), INPUT_MAX_SIZE - ti->nc);245 size_t ilen = min(str_code_points(str), INPUT_MAX_SIZE - ti->nc); 246 246 if (ilen == 0) 247 247 return; … … 467 467 { 468 468 str_to_wstr(ti->buffer, INPUT_MAX_SIZE, str); 469 ti->nc = wstr_ length(ti->buffer);469 ti->nc = wstr_code_points(ti->buffer); 470 470 ti->pos = ti->nc; 471 471 ti->sel_start = ti->pos; … … 579 579 ti->hpos += offs; 580 580 581 int pad = (int) ti->nc - str_ length(ti->history[ti->hpos]);581 int pad = (int) ti->nc - str_code_points(ti->history[ti->hpos]); 582 582 if (pad < 0) 583 583 pad = 0; … … 727 727 size_t cplen; 728 728 729 cplen = str_ length(compl[0]);729 cplen = str_code_points(compl[0]); 730 730 for (i = 1; i < cnum; i++) 731 731 cplen = min(cplen, common_pref_len(compl[0], compl[i])); 732 732 733 733 /* Compute how many bytes we should skip. */ 734 size_t istart = str_l size(compl[0], ti->pos - cstart);734 size_t istart = str_lbytes(compl[0], ti->pos - cstart); 735 735 736 736 if (cplen > istart) { … … 739 739 /* Copy remainder of common prefix. */ 740 740 char *cpref = str_ndup(compl[0] + istart, 741 str_l size(compl[0], cplen - istart));741 str_lbytes(compl[0], cplen - istart)); 742 742 743 743 /* Insert it. */ … … 759 759 760 760 /* Compute how many bytes of completion string we should skip. */ 761 size_t istart = str_l size(compl[0], ti->pos - cstart);761 size_t istart = str_lbytes(compl[0], ti->pos - cstart); 762 762 763 763 /* Insert remainder of completion string at current position. */
Note:
See TracChangeset
for help on using the changeset viewer.