Figured it out: function! MyPlugin#Shutdown() let &statusline=s:saved_statusline endfunction
Now statusline can be restored! :) Reference: http://www.adp-gmbh.ch/vim/let_vs_set.html On Jan 1, 8:45 pm, ashres <ash...@gmail.com> wrote: > Hey all, > I'm working on my first vimscript plugin. One of the things I want to > do in the plugin is to customize the statusline, but then, at a later > time, be able to restore it. > > I've a function called Startup that saves the current statusline: > > function! MyPlugin#Startup() > let s:saved_statusline = &statusline > " modify the statusline for plugin purposes here > " .... > endfunction > > And, I've got a function called Shutdown, that reverts the statusline > back: > > function! MyPlugin#Shutdown() > set statusline=%{s:saved_statusline} > endfunction > > I call Startup first, then Shutdown next. I get these errors: > > E121: Undefined variable: s:saved_statusline > E15: Invalid expression: s:saved_statusline > > Any help would be greatly appreciated! -- You received this message from the "vim_mac" 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