mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-07 04:06:07 -05:00
selection: reset ‘empty_count’ after we’ve emitted the empty cells
When marking and unmarking cells, we don’t highlight trailing empty cells. We do however highlight empty cells if they are followed by non-empty cells. I think this was an intentional choice. If one row ended with trailing empty cells, but *no* hard linebreak, then we’d continue on the next row, and emit all the empty cells once we hit a non-emtpy cell on the second row. But this is something that shouldn’t happen in any real-world use cases.
This commit is contained in:
parent
dfbe8297f7
commit
0de55182ac
1 changed files with 2 additions and 0 deletions
|
|
@ -489,6 +489,7 @@ premark_selected(struct terminal *term, struct row *row, struct cell *cell,
|
|||
for (int i = 0; i < ctx->empty_count + 1; i++)
|
||||
row->cells[col - i].attrs.selected |= 2;
|
||||
|
||||
ctx->empty_count = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -520,6 +521,7 @@ mark_selected(struct terminal *term, struct row *row, struct cell *cell,
|
|||
}
|
||||
}
|
||||
|
||||
ctx->empty_count = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue