Hello, I wrote a plugin that displays some information in the commandline using the echon command when entering a buffer. This works fine, unless a buffer is entered for the second time and the 'set hidden' option is enabled - in this case vim overwrites the command line with info like:
"/tmp/file1" [readonly] 557 lines --0%-- (1 of 2) 1,1 Top I would like to understand why vim overwrites the commandline on some occasions, but not on others and if there is a possible workaround. The following code shows this behaviour: - save the following vimscript in ~/.vim/plugin/bla.vim: function! Bla() redraw echon "-- bla bla bla --" endfunction set hidden autocmd BufEnter * call Bla() - start vim with 2 filenames on the commandline - vim now displays the first file, and shows -- bla bla bla -- in the bottomline - go the the next buffer with :bnext - vim now displays the second file, and shows -- bla bla bla -- in the bottomline - go the the next buffer with :bnext - vim now displays the first file, but instead of showing the blablabla line, it now shows something like "filename" [readonly] 57 lines --0%-- (1 of 2) When the 'set hidden' line is omited from the script, the behaviour is consistent and the 'blablabla' line is always printed in the commandline, also when entering the first buffer for the second time. Can anybody explain to me why this is happening ? -- :wq ^X^Cy^K^X^C^C^C^C