Lech Lorens wrote:

> Might be related to the other NFA bug reported today.
> The below script creates a file with 40 lines of the following format:
>   This is line 3 of block 2.
> (there are 10 blocks numbered from 0 to 9 with lines from 0 to 3).
> 
> It also tries to find all the last lines of the blocks (i.e. lines where 
> the following line has a different block number) and put the locations 
> into a location list.  The list is empty when re=2.  Obviously, for re=1 
> works as expected.
> 
> #v+
> set re=1
> belowright vert split
> enew
> setl bt=nofile
> for i in range(10)
>   for j in range(4)
>     call append(line('$'), printf('This is line %d of block %d.', j, i))
>   endfor
> endfor
> 1del _
> normal gg0
> let failingSearchPattern = '\vblock (\d+)\.\n.*\d+%(\1)@<!\.$'
> let qf = []
> let bufNr = bufnr('%')
> while 1
>   let lnum = search(failingSearchPattern, 'W')
>   if 0 == lnum
>     break
>   endif
>   call add(qf, {'bufnr': bufNr, 'lnum': lnum, 'text': getline(lnum)})
> endwhile
> let @/ = failingSearchPattern
> normal ggn
> 
> call setloclist(0, qf)
> lopen
> #v-

Thanks for the example, I'll add it in the todo list.

-- 
hundred-and-one symptoms of being an internet addict:
249. You've forgotten what the outside looks like.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui