-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increment zero-padded decimal #172
Comments
Hi, Just passing by though, I am not a contributor of the project. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First of all, thanks for the great plugin! I'm using codemirror through the Joplin note taking application, which also includes the ability to enable this vim plugin.
What I've noticed, is that the <Ctrl+a> operator does not seem to like my zero-padded numbers very much, and skips from "07", directly to "010". I dug a little into the source code and found that here
https://github.com/replit/codemirror-vim/blob/master/src/vim.js#L3280 ,
zero-padded numbers are assumed to be octal numbers. I'm not familiar with this notation convention as to me it seems almost more common to encounter 0 padded decimals than to assume an octal number. For the other cases in the list
0b
and0x
the handling is obviously less ambiguous.Just wanted to share my thoughts on this issue. I completely understand if the behavior is intentional, but (based on my very limited experience) I believe a large number of people would find handling 0 padded numbers as decimals to be more intuitive than handling them as octals.
EDIT: After further research, I've found that this is absolutely in line with the way
vim
handles this operation by default. However,vim
allows the user to disable this byset nrformats-=octal
. Is there maybe a way to add such a setting to this plugin?The text was updated successfully, but these errors were encountered: