Yegappan wrote:

> Currently there is no way to determine the layout of the windows on the
> screen. I needed this while developing a test for the "vert topleft copen"
> command to check whether the window is opened at the left most part of
> the screen.
> 
> What do you think about adding a new winlayout() function that returns
> the layout of windows in the specified tab page?
> 
> If there is only one window in the tab page, then this function will return a
> list with a window identifier.
> 
> If there is more than one window in the tab page, then this function will
> return a list where the first item is either "row" (for vertically
> split windows)
> or "col" (for horizontally split windows). The second item is a list of
> window identifiers or additional lists.
> 
> For example, for two horizontally split windows, this function will return
> ['col', [1000, 1001]]
> 
> For two vertically split windows, this function will return ['row',
> [1000, 1001]]
> 
> For three horizontally split windows, with two vertically split windows
> in the middle window, this function will return:
> ['col', [1002, ['row', [1003, 1001]], 1000]]
> 
> Do you think this function will be useful?

Yes, this can be useful.  It should already be possible to figure out
the window position and size, but that doesn't show the hierarchy.
A nested list of lists seems appropriate.

Restoring might work if the same windows are still existing.  E.g. after
temporary opening a window and closing it.

-- 
Rule #1: Don't give somebody a tool that he's going to hurt himself with.

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui