Hi Marc!

On Mo, 18 Feb 2013, Marc Weber wrote:

> > No, it is because "\n" is evaluated to a true line feed, so "[^\n]" 
> > matches anything but ASCII NUL and ASCII 10, while '[^\n]' matches 
> > anything but ASCII NUL (which is used internally by Vim to distinguish 
> > lines from each other (e.g. a line seperator), so that a . matches 
> > anyhing in the buffer but the line seperator)
> 
> Christian: Once and for all - I don't want anybody to explain me that
> [^\n] behaves in a wired way because '.' should behave the way it does.
> 
> I'm *not* talking about internals. I'm talking the user interface you
> and me and new users are faced with every day. So help me think about
> whether there is a way to improve the situation.
> 
> So why should anybody write [^\n] if you can use '.'? So why make [^\n]
> behave the same way? Why not make it raise an error such as:

Because [^\n] is perfectly valid?

> 
> E99999: For odd reasons you should try "[\n]" instead of '[^\n]' and be
>         done. True reason see long reply by Christian on ml ..
> 
> Trouble solved within 2 min. No debugging why vim does not behave the
> way you expect. This guard would be trival to implement. if []
> collections are negated and contain \n show the message.

If you don't want that, use :set cpo+=l

> And it would not break backward compatibility. Which is the use case for
> allowing '[^\n]' at all?

It is a perfect valid regular expression. What is the reason to forbid 
its use?

Anyway, I just made a patch, that should match your expectations.


regards,
Christian
-- 
Adam - der erste Entwurf für Eva.
                -- Jeanne Moreau

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to