do_enter()
- Don't update the edit window until we set placewewant. (DLR)
break_line()
- - Fix problems where a line could be broken in the middle of
- a multibyte character, and goal could be miscalculated on lines
- containing tabs. (DLR)
+ - Fix a problem where a line could be broken in the middle of a
+ multibyte character. (DLR)
do_word_count()
- Rename to do_wordlinechar_count(), and expand to also count
the number of lines and characters in the file or selection,
* found with short enough display width. */
ssize_t cur_loc = 0;
/* Current index in line. */
- size_t pos = 0;
- /* Current column position in line. */
- size_t old_pos;
- /* Previous column position in line. */
int line_len;
assert(line != NULL);
while (*line != '\0' && goal >= 0) {
- old_pos = pos;
+ size_t pos = 0;
line_len = parse_mbchar(line, NULL, &pos);
break;
}
- goal -= pos - old_pos;
+ goal -= pos;
line += line_len;
cur_loc += line_len;
}