signs: Add "numhl" argument #9113

close #9113
ref #9040
This commit is contained in:
Reto Schnyder
2018-10-13 19:33:08 +02:00
committed by Justin M. Keyes
parent 8bbb28b973
commit bddcbbb571
10 changed files with 127 additions and 53 deletions

View File

@@ -5084,13 +5084,16 @@ linenr_T buf_change_sign_type(
return (linenr_T)0;
}
int buf_getsigntype(
buf_T *buf,
linenr_T lnum,
int type /* SIGN_ICON, SIGN_TEXT, SIGN_ANY, SIGN_LINEHL */
)
/// Gets a sign from a given line.
/// In case of multiple signs, returns the most recently placed one.
///
/// @param buf Buffer in which to search
/// @param lnum Line in which to search
/// @param type Type of sign to look for
/// @return Identifier of the first matching sign, or 0
int buf_getsigntype(buf_T *buf, linenr_T lnum, SignType type)
{
signlist_T *sign; /* a sign in a b_signlist */
signlist_T *sign; // a sign in a b_signlist
for (sign = buf->b_signlist; sign != NULL; sign = sign->next) {
if (sign->lnum == lnum
@@ -5098,7 +5101,9 @@ int buf_getsigntype(
|| (type == SIGN_TEXT
&& sign_get_text(sign->typenr) != NULL)
|| (type == SIGN_LINEHL
&& sign_get_attr(sign->typenr, TRUE) != 0))) {
&& sign_get_attr(sign->typenr, SIGN_LINEHL) != 0)
|| (type == SIGN_NUMHL
&& sign_get_attr(sign->typenr, SIGN_NUMHL) != 0))) {
return sign->typenr;
}
}