0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.1.0384: sign ordering depends on +netbeans feature

Problem:    Sign ordering depends on +netbeans feature.
Solution:   Also order signs without +netbeans. (Christian Brabandt,
            closes #3224)
This commit is contained in:
Bram Moolenaar
2018-09-13 18:33:05 +02:00
parent a214079008
commit 8aeb504fc6
3 changed files with 13 additions and 22 deletions

View File

@@ -5856,11 +5856,9 @@ insert_sign(
newsign->lnum = lnum; newsign->lnum = lnum;
newsign->typenr = typenr; newsign->typenr = typenr;
newsign->next = next; newsign->next = next;
#ifdef FEAT_NETBEANS_INTG
newsign->prev = prev; newsign->prev = prev;
if (next != NULL) if (next != NULL)
next->prev = newsign; next->prev = newsign;
#endif
if (prev == NULL) if (prev == NULL)
{ {
@@ -5905,38 +5903,29 @@ buf_addsign(
sign->typenr = typenr; sign->typenr = typenr;
return; return;
} }
else if ( else if (lnum < sign->lnum)
#ifndef FEAT_NETBEANS_INTG /* keep signs sorted by lnum */
id < 0 &&
#endif
lnum < sign->lnum)
{ {
#ifdef FEAT_NETBEANS_INTG /* insert new sign at head of list for this lnum */ // keep signs sorted by lnum: insert new sign at head of list for
/* XXX - GRP: Is this because of sign slide problem? Or is it // this lnum
* really needed? Or is it because we allow multiple signs per
* line? If so, should I add that feature to FEAT_SIGNS?
*/
while (prev != NULL && prev->lnum == lnum) while (prev != NULL && prev->lnum == lnum)
prev = prev->prev; prev = prev->prev;
if (prev == NULL) if (prev == NULL)
sign = buf->b_signlist; sign = buf->b_signlist;
else else
sign = prev->next; sign = prev->next;
#endif
insert_sign(buf, prev, sign, id, lnum, typenr); insert_sign(buf, prev, sign, id, lnum, typenr);
return; return;
} }
prev = sign; prev = sign;
} }
#ifdef FEAT_NETBEANS_INTG /* insert new sign at head of list for this lnum */
/* XXX - GRP: See previous comment */ // insert new sign at head of list for this lnum
while (prev != NULL && prev->lnum == lnum) while (prev != NULL && prev->lnum == lnum)
prev = prev->prev; prev = prev->prev;
if (prev == NULL) if (prev == NULL)
sign = buf->b_signlist; sign = buf->b_signlist;
else else
sign = prev->next; sign = prev->next;
#endif
insert_sign(buf, prev, sign, id, lnum, typenr); insert_sign(buf, prev, sign, id, lnum, typenr);
return; return;
@@ -6008,10 +5997,8 @@ buf_delsign(
if (sign->id == id) if (sign->id == id)
{ {
*lastp = next; *lastp = next;
#ifdef FEAT_NETBEANS_INTG
if (next != NULL) if (next != NULL)
next->prev = sign->prev; next->prev = sign->prev;
#endif
lnum = sign->lnum; lnum = sign->lnum;
vim_free(sign); vim_free(sign);
break; break;
@@ -6067,7 +6054,9 @@ buf_findsign_id(
# if defined(FEAT_NETBEANS_INTG) || defined(PROTO) # if defined(FEAT_NETBEANS_INTG) || defined(PROTO)
/* see if a given type of sign exists on a specific line */ /*
* See if a given type of sign exists on a specific line.
*/
int int
buf_findsigntype_id( buf_findsigntype_id(
buf_T *buf, /* buffer whose sign we are searching for */ buf_T *buf, /* buffer whose sign we are searching for */
@@ -6085,7 +6074,9 @@ buf_findsigntype_id(
# if defined(FEAT_SIGN_ICONS) || defined(PROTO) # if defined(FEAT_SIGN_ICONS) || defined(PROTO)
/* return the number of icons on the given line */ /*
* Return the number of icons on the given line.
*/
int int
buf_signcount(buf_T *buf, linenr_T lnum) buf_signcount(buf_T *buf, linenr_T lnum)
{ {

View File

@@ -704,9 +704,7 @@ struct signlist
linenr_T lnum; /* line number which has this sign */ linenr_T lnum; /* line number which has this sign */
int typenr; /* typenr of sign */ int typenr; /* typenr of sign */
signlist_T *next; /* next signlist entry */ signlist_T *next; /* next signlist entry */
# ifdef FEAT_NETBEANS_INTG
signlist_T *prev; /* previous entry -- for easy reordering */ signlist_T *prev; /* previous entry -- for easy reordering */
# endif
}; };
/* type argument for buf_getsigntype() */ /* type argument for buf_getsigntype() */

View File

@@ -794,6 +794,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
384,
/**/ /**/
383, 383,
/**/ /**/