Hi Bram, The help states, "For numbers with leading zeros (including all octal and hexadecimal numbers), Vim preserves the number of characters in the number when possible". However, this isn't the case when representing 0 using two or more zeros (00, 000, etc.). These are always rewritten to just 0 even when 'nrformats' contains "octal".
Attached patch fixes this. Cheers, -- James GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <[email protected]>
diff --git a/src/charset.c b/src/charset.c --- a/src/charset.c +++ b/src/charset.c @@ -1830,7 +1830,7 @@ hex = 0; /* can't be octal */ break; } - if (ptr[n] > '0') + if (ptr[n] >= '0') hex = '0'; /* assume octal */ } }
signature.asc
Description: Digital signature
