> * Gurran <[email protected]> [230126 07:44]:
> > ### Steps to reproduce
> > 
> > In normal mode decrement (`Ctrl-X`) the following number
> > `000000000`
> > it returns 
> > `01777777777777777777777`
> > 
> > ### Expected behaviour
> > 
> > The result should preserve the length of the number and result in
> > `017777777` 
> 
> I'm not sure the current behavior is wrong.  Octal numbers are treated
> as unsigned, and 64-bit arithmetic is being used.
> 
> The help says "Vim preserves the number of characters in the number when
> possible."  Note that if you use Ctrl-A on 077 you get 0100.  The result
> of Ctrl-X on 0000 is (2*64)-1, which requires more digits to represent.
> 
> Bram should determine what he intended here, and what makes most sense,
> but I think the current behavior makes more sense and obeys the docs.

Changing the resulting value is not backwards compatible.  It might
cause problems (although I doubt more than a few users actually use
octal numbers these days).

There are a few alternatives to the current behavior, and I can't say
any of them is really better than the current behavior.  E.g., going to
minus one or considering the change to be an error (disallow wraparound).

We could perhaps make the help a bit clearer.  Any suggestions?

-- 
hundred-and-one symptoms of being an internet addict:
53. To find out what time it is, you send yourself an e-mail and check the
    "Date:" field.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230126203737.A847C1C0CAF%40moolenaar.net.

Raspunde prin e-mail lui