summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-08-12 14:37:56 +0100
committerw0rp <devw0rp@gmail.com>2017-08-12 14:37:56 +0100
commitc14886e479988bb3d97bf19a344864e46b605ed1 (patch)
tree073b1879652ad91475e16efbe91a259202ac5e96 /autoload
parentc52a4910bf281f5e7851db455adf8939412308c1 (diff)
downloadale-c14886e479988bb3d97bf19a344864e46b605ed1.zip
#653 - Include the buffer number in sorting of items
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/util.vim16
1 files changed, 12 insertions, 4 deletions
diff --git a/autoload/ale/util.vim b/autoload/ale/util.vim
index 98fe53e8..8eda8a98 100644
--- a/autoload/ale/util.vim
+++ b/autoload/ale/util.vim
@@ -22,19 +22,27 @@ function! ale#util#GetFunction(string_or_ref) abort
endfunction
function! ale#util#LocItemCompare(left, right) abort
- if a:left['lnum'] < a:right['lnum']
+ if a:left.bufnr < a:right.bufnr
return -1
endif
- if a:left['lnum'] > a:right['lnum']
+ if a:left.bufnr > a:right.bufnr
return 1
endif
- if a:left['col'] < a:right['col']
+ if a:left.lnum < a:right.lnum
return -1
endif
- if a:left['col'] > a:right['col']
+ if a:left.lnum > a:right.lnum
+ return 1
+ endif
+
+ if a:left.col < a:right.col
+ return -1
+ endif
+
+ if a:left.col > a:right.col
return 1
endif