On Fri, August 2, 2013 04:46, richard emberson wrote:
> Interesting ...
>
> If you define a file XXX with the content:
> vvvvvvvvvvvvvvvvvv
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
>
> function! Load()
>    let list = [
>       \ {
>       \  'filename': 'XXX',
>       \  'lnum': 2,
>       \  'col': 5,
>       \  'vcol': 1,
>       \  'text': 'This is some line',
>       \  'kind': 'marker',
>       \  'type': 'r',
>       \  'nr': 1
>       \ }
>        \ ]
>    call setqflist(list)
> endfunction
>
> function! Show()
>    echo getqflist()
> endfunction
> ^^^^^^^^^^^^^^^^^^^
> And then
> :call Load()
> :call Show()
>
> I echos as expected.
> If you a lines before line 2 or delete line 1,
> calling Show() echos a "corrected" value for the
> lnum.
> But, it you delete line 2, the quickfix entry for
> line 2 is still echoed back by Show.

I think this is correct. Since you delete the line, the quickfix
entry refers to, I think it is ok to have the quickfix entry refer
to the next available line in that buffer.

> If you then add new lines to the top of the file,
> then Show echos back lnum as 2 + number of lines added.
>
> So, getqflist()/setqflist() work when removing lines
> before a line but not when the line itself is deleted.
> Or at least thats what I am seeing.
>
> Thanks.
>
> I assume, but have not tested, if one marks a line
> with a "normal" mark and then deletes the line,
> the mark also goes away.

If I remember correctly, lowercase marks get erased, while
uppercase marks also get adjusted and are
not removed. E.g. when you mark line 3 with 'A' and then delete
line 3, the mark 'A' moves to line 4.

regards,
Christian

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui