Monday, October 25, 2010

Re: Statusline with %b, %B and %O matching ga

Reply to message «Re: Statusline with %b, %B and %O matching ga»,
sent 05:02:46 26 October 2010, Tuesday
by Fernando Basso:

> It is giving the the message:
> E540: Unclosed expression sequence: statusline=%f\ Buffer=%n\ %m\ %h\
> %r\ %=Filetype=%y\ Dec=%b\ Hex=%B\ %{printf(
>
> :help E540 was not enough for me to understand what is wrong. I think
>
> I'm using that printf line wrongly.
You probably forgot to escape some space or something like that. I cannot debug
this with your autowrap, but try to replace `set' with `let':
let &statusline="%f Buffer=%n %m %h %r %=Filetype=%y ".
\"Dec=%b Hex=%B %{printf('Oct=%03o', ".
\"char2nr(matchstr(getline('.'), '.', col('.')-1)))} ".
\"Line=%l Col=%c %P"
I tested this and it works.

No comments: