On 2012-11-29 Thursday at 23:46 +0100 Andy Wokula wrote: > Am 29.11.2012 18:40, schrieb Roland Eggner: > > :h cmdline-ranges > >> 4. Ex command-line ranges *cmdline-ranges* *[range]* *E16* > >> > >> Some Ex commands accept a line range in front of them. This is noted as > >> [range]. It consists of one or more line specifiers, separated with ',' or > >> ';'. > >> > >> The basics are explained in section |10.3| of the user manual. > >> > >> *:,* *:;* > >> When separated with ';' the cursor position will be set to that line > >> before interpreting the next line specifier. This doesn't happen for ','. > > > > Why not reusing or enhancing already established commandline syntax? > > If “,” and “;” are not sufficient for all desired features of range > > specifications, why not just introducing a new separator between line > > specifications? E.g. two adjacent commas “,,”, or a caret character > > “^” would not clash with current commandline syntax AFAICS. This > > would be easier to learn from a user POV. Implementation might > > require more effort, though. > > AISI ... > > `,' versus `;' is a matter of how to get to the range boundaries. The > option to not move the cursor should work together with both of them.
Indeed … thank you for the clarification. To me it seems we can have it to “work together with both of them”. What about … 2,4fun() 2,,4fun() 2;4fun() 2;;4fun() Typing just one additional key is probably attractive for lazy typists. > To "not move the cursor" can (or should) mean two things: > - don't move the cursor initially (demand from function definition): > :func! MyFunc1() stay > - make sure the function call doesn't move the cursor at all (demand > from caller): > :KeepView [range]call MyFunc2() or > :[range]callkeepview MyFunc2() ... To specify “without cursormovement” at the function definition is an interesting additional variation. It could contribute to the target of maximum automation. Instead of “stay” I would suggest something easier to memorize, e.g. “keepcursor”. -- Roland
pgpZJQyIGlbWL.pgp
Description: PGP signature
