On Tue May 02, 2006 at 09:04:06PM +0200, Bram Moolenaar wrote:
> 
> Milan Berta wrote:
> 
> > I'm using vim70g at the time.
> > 
> > - After loading a keymap (and setting the b:keymap_name variable to
> >   anything), unloading it: 'set keymap=', the last command doesn't erase
> > the b:keymap_name variable. I think vim6 doesn't behave this way, but
> > I'm not sure, and I can't reproduce the problem with it. Logical would
> > be if the b:keymap_name variable would be erased with 'set keymap=',
> > wouldn't be.
> 
> I'll delete the b:keymap_name variable when 'keymap' is made empty.
> 
> > - Having '%k' as for the <keymap> in the 'statusline' and executing
> >   'unlet b:keymap_name', the statusline still shows the last
> > b:keymap_name value, and it doesn't disappear.
> 
> The statusline is redrawn when 'keymap' is changed.  In other (unlikely)
> situations you need to cause a redraw yourself.

After a little searching I find a solution for needless '<lang>':

function KeymapExists()
  if exists('b:keymap_name')
    return '<'.b:keymap_name.'>'
  else
    return ''
  endif
endfunction
set statusline=%f\ %{KeymapExists()}


Thanks for the great editor!

Best regards,
Milan

Reply via email to