Hi all,
I appear to have found a bug and would be grateful for confirmation and/or
explanation.
I'm using the 'statusline' function to get a per-window status line (as you
would), however it appears that there is a difference between using '%{...}'
and '%!'. The latter appears to have a bug.
Take the following two lines of code and add to your .vimrc:
A) set statusline=%{fnamemodify(bufname('%'),':p')}
B) set statusline=%!fnamemodify(bufname('%'),':p')
To reproduce:
1) from shell, type "vi x.c" (or some other filename)
2) :split y.c
3) Continuously toggle between the two windows with <C-W>w and watch the
status lines.
With (A) above the status lines are correct all the time. With (B) above
the status line for BOTH files says "y.c" when "y.c" (the upper window) has
the focus, and when "x.c" as the focus they appear correct.
It appears that bufname() when used from '%!' is executing only within the
context of the active window, no matter which window's status line is being
drawn, whereas it actually executes within the context of the buffer for
which the status line is being drawn if using '%{...}'.
Any offers?
Thanks in advance
--
View this message in context:
http://vim.1045645.n5.nabble.com/Bug-Using-buffer-related-functions-during-statusline-tp4715316p4715316.html
Sent from the Vim - Dev mailing list archive at Nabble.com.
--
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