feat(decorations): support signs

Add the following options to extmarks:
  - sign_text
  - sign_hl_group
  - number_hl_group
  - line_hl_group
  - cursorline_hl_group

Note: ranges are unsupported and decorations are only applied to
start_row
This commit is contained in:
Lewis Russell
2022-01-03 12:22:13 +00:00
parent 83fc914337
commit 30e4cc3b3f
13 changed files with 589 additions and 17 deletions

View File

@@ -67,7 +67,9 @@ void extmark_set(buf_T *buf, uint32_t ns_id, uint32_t *idp, int row, colnr_T col
uint8_t decor_level = kDecorLevelNone; // no decor
if (decor) {
if (kv_size(decor->virt_text) || kv_size(decor->virt_lines)) {
if (kv_size(decor->virt_text)
|| kv_size(decor->virt_lines)
|| decor_has_sign(decor)) {
decor_full = true;
decor = xmemdup(decor, sizeof *decor);
}
@@ -142,6 +144,9 @@ revised:
if (kv_size(decor->virt_lines)) {
buf->b_virt_line_blocks++;
}
if (decor_has_sign(decor)) {
buf->b_signs++;
}
decor_redraw(buf, row, end_row > -1 ? end_row : row, decor);
}