signs: fix crash in buf_addsign #10091

buf_signcols sorting breaks signlist structure.

Remove sorting in buf_signcols, because signlist is already kept
sorted and it did not correctly update the double linked list.

Fixes #10078
This commit is contained in:
Andrej Zieger
2019-06-01 12:03:59 +02:00
committed by Justin M. Keyes
parent ef33500e17
commit 95ece7d046
2 changed files with 16 additions and 78 deletions

View File

@@ -231,9 +231,11 @@ static void insert_sign_by_lnum_prio(
{
signlist_T *sign;
// keep signs sorted by lnum and by priority: insert new sign at
// keep signs sorted by lnum, priority and id: insert new sign at
// the proper position in the list for this lnum.
while (prev != NULL && prev->lnum == lnum && prev->priority <= prio) {
while (prev != NULL && prev->lnum == lnum
&& (prev->priority < prio
|| (prev->priority == prio && prev->id <= id))) {
prev = prev->prev;
}
if (prev == NULL) {