Hello Kamaraju, The distributed ftplugin file for fortran sets a variable called 'b:fortran_fixed_source' to let the syntax file know how to highlight. The 'bad highlighting' is because the ftplugin file isn't being executed (for some reason?) and so the syntax defaults to using wrong highlighting (it's looking for numbers at the start of each line). Curiously, my Vim doesn't have a problem with opening a session and choosing the correct highlighting, so I wonder if something in your custom ftplugin or syntax files is preventing the distributed ftplugin file from detecting the fortran format correctly? Is there any chance you could paste the contents of your .vim/ftplugin/fortran.vim into an email?
At any rate, using ':setfiletype fortran' should fix the problem straight away. regards, Peter --- Kamaraju Kusumanchi <[EMAIL PROTECTED]> wrote: > When I save and load a session, the syntax highlighting is messed up. > > I am able to reproduce the problem as follows. Consider helloworld.f90 > > $cat helloworld.f90 > program helloworld > implicit none > > write(*,*) 'Hello World\n' > end program helloworld > > If I do > > $gvim helloworld.f90 > > I get something like shown in working.png ( > http://kamaraju.googlepages.com/vim_problems ). Now > inside the gvim session, I did > > :mksession! test.vim > > After this, exiting gvim and opening test.vim using > > gvim -S test.vim > > gave me something like shown in not_working.png > > Why is the syntax highlighting messed up in the second case? I have a bunch > of > configuration files > namely .vimrc, .gvimrc, .vim/ftplugin/fortran.vim, .vim/indent/fortran.vim > which ensure that the syntax highlighting is correct in the first case. But I > do not know why these files are not being loaded when I am restoring the > session using -S. Any ideas? > > PS: This mailing list does not seem to accept any attachments. That is why I > uploaded the screenshots to http://kamaraju.googlepages.com/vim_problems . > > thanks > raju > > -- > http://groups.google.com/group/ask-anything/about > ____________________________________________________ On Yahoo!7 Men's Health: What music do you want to hear on Men's Health Radio? http://www.menshealthmagazine.com.au/