aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
authorAndrej Zieger <jerdna-regeiz@users.noreply.github.com>2019-05-22 22:41:05 +0200
committerAndrej Zieger <jerdna-regeiz@users.noreply.github.com>2019-05-26 19:32:32 +0200
commit7d43943e4ecf5bd82ffc041b1039e0b2db4d6d60 (patch)
treeed0a2c6068be2ab831e80ffe10bacd55b7f77840 /src/nvim/buffer.c
parentf2341164c661b007cf4fa3fa6605beb4579c5e8f (diff)
downloadrneovim-7d43943e4ecf5bd82ffc041b1039e0b2db4d6d60.tar.gz
rneovim-7d43943e4ecf5bd82ffc041b1039e0b2db4d6d60.tar.bz2
rneovim-7d43943e4ecf5bd82ffc041b1039e0b2db4d6d60.zip
Fixed ordering of signs to align vim and neovim behaviour
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 1f4a1e0cd1..39242b0575 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -5261,7 +5261,7 @@ static int sign_compare(const void *a1, const void *a2)
const signlist_T *s1 = *(const signlist_T **)a1;
const signlist_T *s2 = *(const signlist_T **)a2;
- // Sort by line number and the by id
+ // Sort by line number, priority and id
if (s1->lnum > s2->lnum) {
return 1;
@@ -5269,12 +5269,18 @@ static int sign_compare(const void *a1, const void *a2)
if (s1->lnum < s2->lnum) {
return -1;
}
- if (s1->id > s2->id) {
+ if (s1->priority > s2->priority) {
+ return -1;
+ }
+ if (s1->priority < s2->priority) {
return 1;
}
- if (s1->id < s2->id) {
+ if (s1->id > s2->id) {
return -1;
}
+ if (s1->id < s2->id) {
+ return 1;
+ }
return 0;
}