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

Re: setloclist() doesn't work

Expand Messages
  • Christian Brabandt
    ... I saw that in the source. I was just wondering, whether you now, what could trigger a wipe of buffers. Anyway, the problem seems to have been disappeared
    Message 1 of 2 , Oct 12 10:42 PM
      On Wed, October 12, 2011 12:29 pm, Bram Moolenaar wrote:
      >
      > Christian Brabandt wrote:
      >
      >> CC-ing vim-dev
      >>
      >> On Tue, October 11, 2011 10:01 am, sinbad wrote:
      >> > On Oct 11, 11:07 am, Christian Brabandt <cbli...@...> wrote:
      >> >>
      >> >> Thanks for the detailed steps. Next time, please attach the plugin,
      >> so I
      >> >> don't have to fix all the linebreaks ;)
      >> >>
      >> >> Unfortunately, I can't reproduce the error. I even tried with a stock
      >> >> 7.3 vim version. Anyway, I noticed, that all your bufnr are always
      >> zero.
      >> >> I think that definitely shouldn't be. I guess, somehow all your
      >> buffers
      >> >> get wiped out. Check with :ls! if there are other buffers available.
      >> And
      >> >> can you please try this also when starting vim this way:
      >> >> vim -u NONE -U NONE -N -i NONE
      >> >> then do :so ~/.vim/plugin/gtags.vim
      >> >> and proceed as above.
      >> >
      >> > Thanks for Checking out.
      >> > I am still able to reproduce the problem.
      >> > I am not sure why it is not happening in your test.
      >> > I guess i am all alone in this :(
      >> >
      >> > vim -u NONE -U NONE -N -i NONE
      >> >
      >> > :ver
      >> > VIM - Vi IMproved 7.0 (2006 May 7, compiled Jun 12 2009 07:08:36)
      >> > Included patches: 1, 3-4, 7-9, 11, 13-17, 19-26, 29-31, 34-44, 47,
      >> > 50-56, 58-64, 66-73, 75, 77-92, 94-107, 109, 202, 234-237
      >> > Modified by <bugzilla@...>
      >> > Compiled by <bugzilla@...>
      >> > Huge version without GUI. Features included (+) or not (-):
      >> > +arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset
      >> > +cindent -clientserver -clipboard +cmdline_compl +cmdline_hist
      >> > +cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con
      >> > +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search
      >> > +farsi +file_in_path +find_in_path +folding -footer +fork() +gettext -
      >> > hangul_input +iconv +insert_expand +jumplist +keymap
      >> > +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
      >> > +mksession +modify_fname +mouse -mouseshape +mouse_dec +mouse_gpm -
      >> > mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte
      >> > +multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra +perl
      >> > +postscript +printer +profile +python +quickfix +reltime +rightleft -
      >> > ruby +scrollbind +signs +smartindent -sniff +statusline
      >> > -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl
      >> > +terminfo +termresponse +textobjects +title -toolbar +user_commands
      >> > +vertsplit +virtualedit +visual +visualextra +viminfo
      >> > +vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -
      >> > xim -xsmp -xterm_clipboard -xterm_save
      >> >
      >> > :so ~/.vim/plugin/gtags.vim
      >> > :scriptnames
      >> > 1: /home/sinbad/.vim/plugin/gtags.vim
      >> >
      >> > :e edit.c
      >> > :Gtags -r ResetRedobuff
      >> >
      >> > :lopen
      >> > edit.c|404| ResetRedobuff();
      >> > edit.c|6436| ResetRedobuff();
      >> > misc2.c|1176| ResetRedobuff();
      >> > misc2.c|1177| ResetRedobuff();
      >> > normal.c|1506| ResetRedobuff();
      >> > normal.c|3626| ResetRedobuff();
      >> > normal.c|7380| ResetRedobuff();
      >> > spell.c|10317| ResetRedobuff();
      >> >
      >> > :echo getloclist(0)
      >> > [{'lnum': 404, 'bufnr': 1, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1,
      >> > 'type': '', 'pattern': '', 'text': ' ResetRedobuff();'},
      >> > {'lnum': 6436, 'bufnr': 1, 'col': 0, 'valid': 1, 'vcol':
      >> > 0, 'nr': -1, 'type': '', 'pattern': '', 'text': '
      >> > ResetRedobuff();'}, {'lnum': 1176, 'bufnr': 3, 'col': 0, 'valid': 1,
      >> > 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': '
      >> > ResetRedobuff();'}, {'lnum': 1177, 'bufnr': 3, 'col': 0,
      >> > 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text':
      >> > ' ResetRedobuff();'}, {'lnum': 1506, 'bufnr': 4, 'col'
      >> > : 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '',
      >> > 'text': ' ResetRedobuff();'}, {'lnum': 3626,
      >> > 'bufnr': 4, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type':
      >> > '', 'pattern': '', 'text': ' ResetRedobuff();'}, {'lnum':
      >> > 7380, 'bufnr': 4, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type':
      >> > '', 'pattern': '', 'text': ' ResetRedobuff();'
      >> > }, {'lnum': 10317, 'bufnr': 5, 'col': 0, 'valid': 1, 'vcol': 0, 'nr':
      >> > -1, 'type': '', 'pattern': '', 'text': '
      >> > ResetRedobuff();'}]
      >> >
      >> > :let x = getloclist(0)
      >> >
      >> > :echo x
      >> >
      >> > [{'lnum': 404, 'bufnr': 1, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1,
      >> > 'type': '', 'pattern': '', 'text': ' ResetRedobuff();'},
      >> > {'lnum': 6436, 'bufnr': 1, 'col': 0, 'valid': 1, 'vcol':
      >> > 0, 'nr': -1, 'type': '', 'pattern': '', 'text': '
      >> > ResetRedobuff();'}, {'lnum': 1176, 'bufnr': 3, 'col': 0, 'valid': 1,
      >> > 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': '
      >> > ResetRedobuff();'}, {'lnum': 1177, 'bufnr': 3, 'col': 0,
      >> > 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text':
      >> > ' ResetRedobuff();'}, {'lnum': 1506, 'bufnr': 4, 'col'
      >> > : 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '',
      >> > 'text': ' ResetRedobuff();'}, {'lnum': 3626,
      >> > 'bufnr': 4, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type':
      >> > '', 'pattern': '', 'text': ' ResetRedobuff();'}, {'lnum':
      >> > 7380, 'bufnr': 4, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type':
      >> > '', 'pattern': '', 'text': ' ResetRedobuff();'
      >> > }, {'lnum': 10317, 'bufnr': 5, 'col': 0, 'valid': 1, 'vcol': 0, 'nr':
      >> > -1, 'type': '', 'pattern': '', 'text': '
      >> > ResetRedobuff();'}]
      >> >
      >> >
      >> > :call setloclist(0,[])
      >> > :call setloclist(0, x)
      >> >
      >> > :lopen " filenames are missing
      >> > |404| ResetRedobuff();
      >> > |6436| ResetRedobuff();
      >> > |1176| ResetRedobuff();
      >> > |1177| ResetRedobuff();
      >> > |1506| ResetRedobuff();
      >> > |3626| ResetRedobuff();
      >> > |7380| ResetRedobuff();
      >> > |10317| ResetRedobuff();
      >> > ~
      >> >
      >> > :ls!
      >> > 1 %a "edit.c" line 404
      >> > 2u - "~/vim7.3/vim73/src" line 1
      >> > 3u "misc2.c" line 0
      >> > 4u "normal.c" line 0
      >> > 5u "spell.c" line 0
      >> > 7 a- "[Location List]" line 0
      >> > 8 # "getchar.c" line 463
      >>
      >> Can you please output :echo getloclist(0) after you used :call
      >> setloclist(0,x)? The question is, why does the 'bufnr' key gets zero.
      >> Honestly, I don't have a clue in your case. Just to make sure, you did
      >> all
      >> this
      >> when calling vim using -u NONE -U NONE -N -i NONE and are note using
      >> any autocommand like BufUnload or something? Does setting 'hidden' help?
      >>
      >> BTW: Is there a reason, you are using this old version of vim? Can you
      >> please try this with the latest patchlevel of Vim?
      >>
      >> Bram, can you imagine, why the bufnr could become 0, e.g. all entries
      >> get
      >> invalid?
      >
      > The bufnr is set to 0 when the number used is invalid. That means the
      > buffer must have been wiped out. I can't think of another reason.

      I saw that in the source. I was just wondering, whether you now, what could
      trigger a wipe of buffers. Anyway, the problem seems to have been
      disappeared with a recent version of vim.

      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
    Your message has been successfully submitted and would be delivered to recipients shortly.