version 1.16, 2016/09/17 15:06:41 |
version 1.17, 2019/05/15 18:06:09 |
|
|
} |
} |
|
|
/* |
/* |
* Display a string, usually as a prompt for input into the command buffer. |
* Display an ASCII string, usually as a prompt for input, |
|
* into the command buffer. |
*/ |
*/ |
void |
void |
cmd_putstr(char *s) |
cmd_putstr(char *s) |
{ |
{ |
LWCHAR prev_ch = 0; |
|
LWCHAR ch; |
|
char *endline = s + strlen(s); |
|
while (*s != '\0') { |
while (*s != '\0') { |
char *ns = s; |
putchr(*s++); |
ch = step_char(&ns, +1, endline); |
cmd_col++; |
while (s < ns) |
prompt_col++; |
putchr(*s++); |
|
if (!utf_mode) { |
|
cmd_col++; |
|
prompt_col++; |
|
} else if (!is_composing_char(ch) && |
|
!is_combining_char(prev_ch, ch)) { |
|
int width = is_wide_char(ch) ? 2 : 1; |
|
cmd_col += width; |
|
prompt_col += width; |
|
} |
|
prev_ch = ch; |
|
} |
} |
} |
} |
|
|