Marcin Szamotulski wrote: > > > Yeah, this is getting complicated. :wincmd can have different types of > > > ranges. Using the line count is actually also wrong. > > > There probably is no other solution than postponing the range check > > > until the argument has been parsed. That makes it difficult to give a > > > meaning to ":$wincmd". Depending on the argument it can mean the last > > > window or the maximum size. > > > > > Actually :wincmd <, >, and | are column oriented, not line oriented. > > So, sometimes its window oriented, line oriented, or column oriented. I > > guess that means we need new window commands that are buffer oriented > > and tab oriented just to make things maximally difficult! :) > > > > Regards, > > Chip > > Yes that's a problem. Bram maybe we should: > - add a special range type `ADDR_POSTPONED` > - for commands which have it we could store the range on `exarg_T` > struct > - parse it when we know how to do it, in this case inside the > `do_window` function; for that we could factor out the range > parsing code from `do_one_cmd` into a seprate function and use > inside `do_window`.
Hmm, passing the whole range to do_window() and parsing it there means the range parsing is spread out. Not nice. How about this: Use ADDR_SPECIAL and when found check the command, then call a function to parse the command to figure out the actual range type. It looks like the first character of the argument is sufficient to decide what the range should be, thus that's relatively simple. Could be done with a switch or with a table perhaps. Put this function next to do_window(), so that the code that knows all possible arguments is close together. -- hundred-and-one symptoms of being an internet addict: 70. ISDN lines are added to your house on a hourly basis /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ 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]. For more options, visit https://groups.google.com/d/optout.
