mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 20:18:32 +00:00

committed by
Justin M. Keyes

parent
8bbb28b973
commit
bddcbbb571
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user