Only modify prompt_kind in resize.c

This commit is contained in:
Kovid Goyal
2025-02-19 05:08:27 +05:30
parent a57cb3c1d1
commit 758817c3c8
2 changed files with 6 additions and 5 deletions

View File

@@ -638,9 +638,7 @@ historybuf_next_dest_line(HistoryBuf *self, ANSIBuf *as_ansi_buf, Line *src_line
history_buf_set_last_char_as_continuation(self, 0, continued);
bool needs_clear;
index_type idx = historybuf_push(self, as_ansi_buf, &needs_clear);
LineAttrs *a = attrptr(self, idx);
*a = src_line->attrs;
if (continued) a->prompt_kind = UNKNOWN_PROMPT_KIND;
*attrptr(self, idx) = src_line->attrs;
init_line(self, idx, dest_line);
if (needs_clear) {
zero_at_ptr_count(dest_line->cpu_cells, dest_line->xnum);

View File

@@ -87,8 +87,10 @@ init_src_line(Rewrap *r) {
static void
first_dest_line(Rewrap *r) {
if (r->src.hb_count) historybuf_next_dest_line(r->dest.hb, r->as_ansi_buf, &r->src.line, 0, &r->dest.line, false);
else {
if (r->src.hb_count) {
historybuf_next_dest_line(r->dest.hb, r->as_ansi_buf, &r->src.line, 0, &r->dest.line, false);
r->src.line.attrs.prompt_kind = UNKNOWN_PROMPT_KIND;
} else {
r->dest_line_from_linebuf = true;
linebuf_init_line_at(r->dest.lb, 0, &r->dest.line);
set_dest_line_attrs(0);
@@ -133,6 +135,7 @@ next_dest_line(Rewrap *r, bool continued) {
}
} else {
r->dest.y = historybuf_next_dest_line(r->dest.hb, r->as_ansi_buf, &r->src.line, r->dest.y, &r->dest.line, continued);
r->src.line.attrs.prompt_kind = UNKNOWN_PROMPT_KIND;
}
if (r->sb->line_attrs[0].has_dirty_text) {
CPUCell *cpu_cells; GPUCell *gpu_cells;