On Fri, Feb 5, 2010 at 10:12 AM, Ben Fritz <[email protected]> wrote: > I was editing a mapping I have that starts with <C-\><C-O>, and wanted > to change it to just <C-O>. So, I put my cursor on the first '-' and > typed, da< hoping to delete just <C-\>. I discovered that the > backslash acts as an escape character for the text object, and I ended > up deleting most of my buffer (until it found an unmatched >). No > harm, just had to press 'u', but the behavior surprised me.
This is based on the M flag of 'cpoptions'. The vi-compatible behavior (M included in 'cpo'), is ignorant of backslash escapes and would do what you had expected. It might be useful to add a hint to this effect for the brace-like text-objects. > I understand the usefulness of escaping things like double quotes, but > I don't believe I've ever seen a syntax where '\' escapes a '>'. I > believe there are few where it also escapes a single quote. Perhaps > this is common code, though? Yes, it is. It's the findmatchlimit function in search.c and it honors the % and M flags for 'cpoptions'. -- James GPG Key: 1024D/61326D40 2003-09-02 James Vega <[email protected]> -- You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php
