On 10/23/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:
I'd suggest that 3rd arg for escape(), if it's neeed (well you always can brute-force escape things using substitute()), it would be code of the context (1-5) for which escaping is destined. Because Vim has at least 4-5 different escaping rules in different contexts: 1) escaping rules for double-quoted strings 2) escaping rules for single-quoted strings 3) escaping rules for :-command-line 4) escaping rules for regexes 5) escaping rules rules for rhs of the mapping. Escaping would be different for each of those contexts.
I'd say that escape() should take a third argument that specifies the character to escape with and instead add a new function that does this kind of more advanced escaping. That's just me though, and I have my own user-defined function for dealing with escaping rules. nikolai