Use a null to represent a blank rather than a space

This has performance benefits when clearing (can use a single
memset). Also allows detecting trailing whitespace on lines correctly.
This commit is contained in:
Kovid Goyal
2017-09-09 10:25:03 +05:30
parent 382daacb73
commit bc97cfa024
7 changed files with 79 additions and 60 deletions

View File

@@ -58,7 +58,7 @@ rewrap_inner(BufType *src, BufType *dest, const index_type src_limit, HistoryBuf
src_line_is_continued = is_src_line_continued(src_y);
src_x_limit = src->xnum;
if (!src_line_is_continued) {
// Trim trailing white-space since there is a hard line break at the end of this line
// Trim trailing blanks since there is a hard line break at the end of this line
while(src_x_limit && (src->line->cells[src_x_limit - 1].ch & CHAR_MASK) == BLANK_CHAR) src_x_limit--;
}