Hi, Bram,

Another oddity I've recently discovered is that str2nr won't accept an 
explicitly 
positive number, such as '+3'.

This is unexpected. Would you be willing to adjust the behaviour? I can't think 
of 
any negative/compatibility-breaking side effects this would have, but I also 
don't 
know where the vim_str2nr function is used.

The attached patch does the job.

Cheers,

Ben.



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

diff -r 64942db7407d src/charset.c
--- a/src/charset.c	Sat Jun 21 23:24:54 2008 +1000
+++ b/src/charset.c	Tue Jun 24 03:24:33 2008 +1000
@@ -1799,6 +1799,7 @@
     unsigned long   un = 0;
     int		    n;
 
+    if (ptr[0] == '+') ++ptr;
     if (ptr[0] == '-')
     {
 	negative = TRUE;

Raspunde prin e-mail lui