Loading ...
Sorry, an error occurred while loading the content.

Re: quickfix hidden marks

Expand Messages
  • richard emberson
    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 ,
    Message 1 of 4 , Aug 1, 2013
    • 0 Attachment
      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.

      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.

      Richard



      On 08/01/2013 06:01 AM, Ben Fritz wrote:
      > On Wednesday, July 31, 2013 8:41:21 PM UTC-5, Richard wrote:
      >> If you insert or delete lines, mostly the correct error location is still
      >>
      >> found because hidden marks are used. Sometimes, when the mark has been
      >>
      >> deleted for some reason, the message "line changed" is shown to warn you
      >>
      >> that
      >>
      >> the error location may not be correct. If you quit Vim and start again the
      >>
      >> marks are lost and the error locations may not be correct anymore.
      >>
      >>
      >>
      >> What are the "hidden marks" mentioned above?
      >>
      >> Do they use some character (a-zA-Z)
      >
      > They do NOT use "marks" in the sense of being able to jump to them with ' or `
      >
      >> or do they use
      >>
      >> some internal capability (c code) that is not exposed in the
      >>
      >> Vim script language?
      >>
      >
      > It is internal, but you can access them with the getqflist()/setqflist() functions.
      >

      --
      Quis custodiet ipsos custodes

      --
      --
      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+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Christian Brabandt
      ... 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
      Message 2 of 4 , Aug 2, 2013
      • 0 Attachment
        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+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      Your message has been successfully submitted and would be delivered to recipients shortly.