Marvin Renich wrote:

> In a thread started here [0] back in July I reported a problem I was
> having with messages not being displayed in the right order.  It was
> determined during that thread that there was a difference of behavior
> based on whether hidden was set or not.  Buried in one of the later
> messages, I asked you if this was intentional or a bug, but I haven't
> heard back from you.  You weren't active on the list at the time; I
> assume you were on vacation/moving.  I guess that my buried query didn't
> catch your attention when you were catching up on mail.
> 
> Here is the summary:
> 
> -----
> 
> vim -u NONE -U NONE somefile.txt
> :e testbuf.vim
> 
> " if testbuf.vim is new, paste the TestBuf function below and :w
> 
> :let g:testbuf = 2 " the buffer number of testbuf.vim
> :so %
> :b #
> 
> " we are now set up to demonstrate the problem
> 
> :call TestBuf()
> 
> " this should display  Done with TestBuf (found = 3)
> 
> :set hidden
> :call TestBuf()
> 
> " this displays  "somefile.txt" line 1 of...
> 
> :set nohidden
> :call TestBuf()
> 
> " this still displays  "somefile.txt"...
> " You must switch buffers at least once after :set nohidden before you
> " get the original (desired) behavior back.
> 
> ----- TestBuf
> 
> function! TestBuf()
>   let curbuf = bufnr("%")
>   exec "b" g:testbuf
>   let found = search('t.st')
>   exec "b" curbuf
> 
>   echomsg 'Done with TestBuf (found = '.found.')'
> endfunction
> 
> -----
> 
> A separate problem is that changing both occurrences of  exec "b"...  to
> silent exec "b"...  does not change anything; that is, the output of
> exec "b"...  is not suppressed (when hidden is set).
> 
> I feel that both of these are bugs, but I wanted to know if there was
> a reason that you thought these were the correct behaviors (or perhaps
> it is simply impractical to change).

After you do ":set nohidden" there still is one hidden buffer.  Thus the
first TestBuf() after that will work a bit different from the next ones.

I do see a problem: The info about the current buffer is displayed even
though you edited another buffer.  Thus the message should be given for
the un-hidden file but it's given for the other file, for which a
message was already given.  I'll fix that.

-- 
Have you heard about the new Barbie doll?  It's called Divorce
Barbie.  It comes with all of Ken's stuff.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Reply via email to