list - Compare numbers in a nested file -
example:
let list = [[23, '2'], [2, '3'], [55, '4'], [1, '5']]
i'm trying numeric sort of list (using 1st field): list[indexnr][0]
i've found function in files:
function! mycompare(i1, i2) return (a:i1 + 0) - (a:i2 + 0) endfunction
how can adapt nested list let work above example?
you have give index params:
function! mycompare(i1, i2) return a:i1[0] - a:i2[0] endfunction
Comments
Post a Comment