Hi,
Trying this
let file = readfile(expand("%:p"),'b')
let g:file=map(copy(file),'v:val.":".index(copy(file), v:val)')
returns -1 for each v:val of list 'file' out of 0, 1 , 2 etc..
Thank you
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply bel
2017-06-11 18:36 GMT+03:00 Ni Va :
> Hi,
>
> Trying this
>
>
> let file = readfile(expand("%:p"),'b')
> let g:file=map(copy(file),'v:val.":".index(copy(file), v:val)')
>
> returns -1 for each v:val of list 'file' out of 0, 1 , 2 etc..
There is `v:key`, do not use `index()` here; and using `copy()`
Ni Va wrote:
> Trying this
>
>
> let file = readfile(expand("%:p"),'b')
> let g:file=map(copy(file),'v:val.":".index(copy(file), v:val)')
>
> returns -1 for each v:val of list 'file' out of 0, 1 , 2 etc..
Works fine for me (spaces added for readability):
let file = ['aaa', 'bbb', 'cc
Le dimanche 11 juin 2017 18:35:59 UTC+2, Bram Moolenaar a écrit :
> Ni Va wrote:
>
> > Trying this
> >
> >
> > let file = readfile(expand("%:p"),'b')
> > let g:file=map(copy(file),'v:val.":".index(copy(file), v:val)')
> >
> > returns -1 for each v:val of list 'file' out of 0, 1 , 2 etc..
>
> W
Le dimanche 11 juin 2017 18:35:59 UTC+2, Bram Moolenaar a écrit :
> Ni Va wrote:
>
> > Trying this
> >
> >
> > let file = readfile(expand("%:p"),'b')
> > let g:file=map(copy(file),'v:val.":".index(copy(file), v:val)')
> >
> > returns -1 for each v:val of list 'file' out of 0, 1 , 2 etc..
>
> W
Le dimanche 11 juin 2017 20:09:19 UTC+2, Ni Va a écrit :
> Le dimanche 11 juin 2017 18:35:59 UTC+2, Bram Moolenaar a écrit :
> > Ni Va wrote:
> >
> > > Trying this
> > >
> > >
> > > let file = readfile(expand("%:p"),'b')
> > > let g:file=map(copy(file),'v:val.":".index(copy(file), v:val)')
> > >