2012/6/7 Bram Moolenaar <[email protected]>: > > David Pineau wrote: > >> While configuring my indentation, I came across a behaviour that seemed >> unintuitive to me (I did not manage to find anything related to this on the >> mailling lists, sorry if I missed it). >> >> When a value in the cinoptions string is described as a shiftwidth value, >> the value cannot be zero. >> This means that if I write "cino=n0s", the indentation behaves as if I >> wrote "cino=n1s". >> >> Reading the code (in the latest vim mercurial trunk), I found that if the >> value and the fraction were equal to 0 when the 's' character is present, >> then the value is set to 1 by default. I am aware that writing "n0s" >> instead of "n0" may be a stretch, but I found this behaviour disturbing. >> >> Is this behaviour intended, or is it a unlucky side-effect of the default 1 >> shiftwidth width when only the s is present ? >> >> In the second case, I wrote a little patch that should be easy to apply and >> check (Patch retrieved from a mercurial patch queue), that I will join to >> my next message if you deem it useful :) > > Why would anyone use "0s"? You can just use "0".
Well, it ranges from configuration artifacts to laziness: I only indent depending on my shiftwidth value, so while tweaking the values, I kept the 's' in case I was going to change the value. That's why I said that it may be a stretch to do as I did. > > I do agree it's counter intuitive. > I hope my little bit of feedback was useful. Thanks to both of you for addressing this issue as fast as you did. Cheers, -- David Pineau -- 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
