diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-02-19 17:13:04 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-02-19 17:13:04 +0100 |
commit | a2f6e42ded067df8ee682c15aa246491a389b1a0 (patch) | |
tree | 8eef72d8edf62e4f179d6408167ddc7d73d0f5b1 /src/sign.c | |
parent | 257cc5ee9593cd0653beca8b5945dc7fbf7f2d8d (diff) | |
download | vim-git-a2f6e42ded067df8ee682c15aa246491a389b1a0.tar.gz |
patch 8.2.0281: two placed signs in the same line are not combinedv8.2.0281
Problem: Two placed signs in the same line are not combined. E.g. in the
terminal debugger a breakpoint and the PC cannot be both be
displayed.
Solution: Combine the sign column and line highlight attributes.
Diffstat (limited to 'src/sign.c')
-rw-r--r-- | src/sign.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/sign.c b/src/sign.c index 9d8d7ac8a..1964c8308 100644 --- a/src/sign.c +++ b/src/sign.c @@ -514,6 +514,30 @@ buf_get_signattrs(win_T *wp, linenr_T lnum, sign_attrs_T *sattr) sattr->sat_texthl = syn_id2attr(sp->sn_text_hl); if (sp->sn_line_hl > 0) sattr->sat_linehl = syn_id2attr(sp->sn_line_hl); + + // If there is another sign next with the same priority, may + // combine the text and the line highlighting. + if (sign->se_next != NULL + && sign->se_next->se_priority == sign->se_priority + && sign->se_next->se_lnum == sign->se_lnum) + { + sign_T *next_sp = find_sign_by_typenr(sign->se_next->se_typenr); + + if (next_sp != NULL) + { + if (sattr->sat_icon == NULL && sattr->sat_text == NULL) + { +# ifdef FEAT_SIGN_ICONS + sattr->sat_icon = next_sp->sn_image; +# endif + sattr->sat_text = next_sp->sn_text; + } + if (sp->sn_text_hl <= 0 && next_sp->sn_text_hl > 0) + sattr->sat_texthl = syn_id2attr(next_sp->sn_text_hl); + if (sp->sn_line_hl <= 0 && next_sp->sn_line_hl > 0) + sattr->sat_linehl = syn_id2attr(next_sp->sn_line_hl); + } + } return TRUE; } } |