control_mbrep(), control_wrep(), mbwidth(), mb_cur_max(), and
make_mbchar(); changes to is_blank_char() (moved to chars.c),
is_cntrl_char() (moved to chars.c), parse_char() (renamed
- parse_mbchar() and moved to chars.c), do_verbatim_input(),
- do_delete(), do_tab(), do_input(), do_output(), get_buffer(),
- unget_input(), unget_kbinput(), get_input(), parse_kbinput(),
- unparse_kbinput(), parse_verbatim_kbinput(),
- do_statusbar_input(), do_statusbar_verbatim_kbinput(),
+ parse_mbchar() and moved to chars.c), do_home(),
+ do_verbatim_input(), do_delete(), do_tab(), do_input(),
+ do_output(), get_buffer(), unget_input(), unget_kbinput(),
+ get_input(), parse_kbinput(), unparse_kbinput(),
+ parse_verbatim_kbinput(), do_statusbar_input(),
+ do_statusbar_home(), do_statusbar_verbatim_kbinput(),
do_statusbar_output(), and display_string(); removal of
buffer_to_keys() and keys_to_buffer(). (DLR)
- cut.c:
#ifndef NANO_SMALL
if (ISSET(SMART_HOME)) {
size_t current_x_save = current_x;
+ char *blank_mb = charalloc(mb_cur_max());
+ int blank_mb_len;
- for (current_x = 0; is_blank_char(current->data[current_x]) &&
- current->data[current_x] != '\0'; current_x++)
- ;
+ current_x = 0;
+
+ while (current->data[current_x] != '\0') {
+ blank_mb_len = parse_mbchar(current->data + current_x,
+ blank_mb
+#ifdef NANO_WIDE
+ , NULL
+#endif
+ , NULL);
+
+ if (!is_blank_mbchar(blank_mb))
+ break;
+
+ current_x += blank_mb_len;
+ }
+
+ free(blank_mb);
if (current_x == current_x_save ||
current->data[current_x] == '\0')
#ifndef NANO_SMALL
if (ISSET(SMART_HOME)) {
size_t statusbar_x_save = statusbar_x;
- for (statusbar_x = 0; is_blank_char(answer[statusbar_x]) &&
- statusbar_x < statusbar_xend; statusbar_x++)
- ;
+ char *blank_mb = charalloc(mb_cur_max());
+ int blank_mb_len;
+
+ statusbar_x = 0;
+
+ while (statusbar_x < statusbar_xend) {
+ blank_mb_len = parse_mbchar(answer + statusbar_x,
+ blank_mb
+#ifdef NANO_WIDE
+ , NULL
+#endif
+ , NULL);
+
+ if (!is_blank_mbchar(blank_mb))
+ break;
+
+ statusbar_x += blank_mb_len;
+ }
+
+ free(blank_mb);
+
if (statusbar_x == statusbar_x_save ||
statusbar_x == statusbar_xend)
statusbar_x = 0;