Loading ...
Sorry, an error occurred while loading the content.

Bug in 7.0.178? autocmd BufReadCmd * DoSomething expand(" ") fails if the filename contains %

Expand Messages
  • Thomas
    Hi, I have the following line in my source: exec autocmd BufReadCmd . pattern . call . rcmd . (1, expand( ), , % ) This fails if the filename
    Message 1 of 1 , Jan 2, 2007
    • 0 Attachment
      Hi,

      I have the following line in my source:

      exec 'autocmd BufReadCmd '. pattern .' call '. rcmd .'(1,
      expand("<afile>"), "", "%")'

      This fails if the filename contains % which is replaced with
      expand('%'). I can't seem to escape the % at any point, can I? Wrapping
      the exand("<afile>") in a escape(<>, "%") doesn't help.

      Regards,
      Thomas.
    Your message has been successfully submitted and would be delivered to recipients shortly.