diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-11-12 22:33:45 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-11-12 22:33:45 +0100 |
commit | 4eb7dae255abc271cf313d4c75839577f1424183 (patch) | |
tree | 55738e6838d3de39c91541c21687990c8af5b113 /src/sign.c | |
parent | cbee635eee3007db97646ddb9f211a1d4966eb2a (diff) | |
download | vim-git-8.1.2295.tar.gz |
patch 8.1.2295: if buffer of popup is in another window cursorline sign showsv8.1.2295
Problem: If buffer of popup is in another window cursorline sign shows.
Solution: Check the group of the sign.
Diffstat (limited to 'src/sign.c')
-rw-r--r-- | src/sign.c | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/src/sign.c b/src/sign.c index ddf2ac6a2..134edf09f 100644 --- a/src/sign.c +++ b/src/sign.c @@ -467,10 +467,11 @@ buf_change_sign_type( * 'lnum', FALSE otherwise. */ int -buf_get_signattrs(buf_T *buf, linenr_T lnum, sign_attrs_T *sattr) +buf_get_signattrs(win_T *wp, linenr_T lnum, sign_attrs_T *sattr) { sign_entry_T *sign; sign_T *sp; + buf_T *buf = wp->w_buffer; vim_memset(sattr, 0, sizeof(sign_attrs_T)); @@ -481,7 +482,12 @@ buf_get_signattrs(buf_T *buf, linenr_T lnum, sign_attrs_T *sattr) // for signs after the specified line number 'lnum'. break; - if (sign->se_lnum == lnum) + if (sign->se_lnum == lnum +# ifdef FEAT_TEXT_PROP + && sign_in_group(sign, (char_u *)"popupmenu") + == (WIN_IS_POPUP(wp) ? TRUE : FALSE) +# endif + ) { sattr->sat_typenr = sign->se_typenr; sp = find_sign_by_typenr(sign->se_typenr); @@ -2633,6 +2639,42 @@ cleanup: return retval; } + sign_entry_T * +get_first_valid_sign(win_T *wp) +{ + sign_entry_T *sign = wp->w_buffer->b_signlist; + +# ifdef FEAT_TEXT_PROP + while (sign != NULL && sign_in_group(sign, (char_u *)"popupmenu") + == (WIN_IS_POPUP(wp) ? FALSE : TRUE)) + sign = sign->se_next; +# endif + return sign; +} + +/* + * Return TRUE when window "wp" has a column to draw signs in. + */ + int +signcolumn_on(win_T *wp) +{ + // If 'signcolumn' is set to 'number', signs are displayed in the 'number' + // column (if present). Otherwise signs are to be displayed in the sign + // column. + if (*wp->w_p_scl == 'n' && *(wp->w_p_scl + 1) == 'u') + return get_first_valid_sign(wp) != NULL && !wp->w_p_nu && !wp->w_p_rnu; + + if (*wp->w_p_scl == 'n') + return FALSE; + if (*wp->w_p_scl == 'y') + return TRUE; + return (get_first_valid_sign(wp) != NULL +# ifdef FEAT_NETBEANS_INTG + || wp->w_buffer->b_has_sign_column +# endif + ); +} + /* * "sign_unplace()" function */ |