Skip to content

Commit dccb6b2

Browse files
committed
fixup, should close #584
1 parent 17f80c2 commit dccb6b2

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

vterm-module.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,19 @@ static void refresh_lines(Term *term, emacs_env *env, int start_row,
339339
}
340340

341341
if (!compare_cells(&cell, &lastCell)) {
342-
// maybe the trailing whitespace should be rendered togther?
343-
emacs_value text = render_text(env, term, buffer, length, &lastCell);
344-
insert(env, text);
345-
// move the trailing whitespace to the start of buffer
346-
memmove(buffer, buffer + length, spacelength);
347-
length = 0;
342+
if (eol) {
343+
emacs_value text = render_text(env, term, buffer, length, &lastCell);
344+
insert(env, text);
345+
// move the trailing whitespace to the start of buffer
346+
memmove(buffer, buffer + length, spacelength);
347+
length = 0;
348+
} else {
349+
emacs_value text =
350+
render_text(env, term, buffer, length + spacelength, &lastCell);
351+
insert(env, text);
352+
spacelength = 0;
353+
length = 0;
354+
}
348355
}
349356
lastCell = cell;
350357

0 commit comments

Comments
 (0)