2016-10-13 15:56:18 -04:00
|
|
|
Before:
|
|
|
|
let g:loclist = [
|
|
|
|
\ {'lnum': 5, 'col': 5},
|
|
|
|
\ {'lnum': 5, 'col': 4},
|
|
|
|
\ {'lnum': 2, 'col': 10},
|
|
|
|
\ {'lnum': 3, 'col': 2},
|
|
|
|
\]
|
|
|
|
|
|
|
|
Execute (Sort loclist with comparison function):
|
|
|
|
call sort(g:loclist, 'ale#util#LocItemCompare')
|
|
|
|
|
|
|
|
Then (loclist item should be sorted):
|
2016-10-14 15:34:21 -04:00
|
|
|
AssertEqual [
|
2016-10-13 15:56:18 -04:00
|
|
|
\ {'lnum': 2, 'col': 10},
|
|
|
|
\ {'lnum': 3, 'col': 2},
|
|
|
|
\ {'lnum': 5, 'col': 4},
|
|
|
|
\ {'lnum': 5, 'col': 5},
|
2016-10-14 15:34:21 -04:00
|
|
|
\], g:loclist
|
2016-10-13 15:56:18 -04:00
|
|
|
|
|
|
|
After:
|
|
|
|
unlet g:loclist
|