Karsten Hopp f99b4a
To: vim_dev@googlegroups.com
Karsten Hopp f99b4a
Subject: Patch 7.3.940
Karsten Hopp f99b4a
Fcc: outbox
Karsten Hopp f99b4a
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp f99b4a
Mime-Version: 1.0
Karsten Hopp f99b4a
Content-Type: text/plain; charset=UTF-8
Karsten Hopp f99b4a
Content-Transfer-Encoding: 8bit
Karsten Hopp f99b4a
------------
Karsten Hopp f99b4a
Karsten Hopp f99b4a
Patch 7.3.940
Karsten Hopp f99b4a
Problem:    Python: Can't get position of window.
Karsten Hopp f99b4a
Solution:   Add window.row and window.col. (ZyX)
Karsten Hopp f99b4a
Files:	    runtime/doc/if_pyth.txt, src/if_py_both.h
Karsten Hopp f99b4a
Karsten Hopp f99b4a
Karsten Hopp f99b4a
*** ../vim-7.3.939/runtime/doc/if_pyth.txt	2013-05-12 19:00:36.000000000 +0200
Karsten Hopp f99b4a
--- runtime/doc/if_pyth.txt	2013-05-12 19:24:40.000000000 +0200
Karsten Hopp f99b4a
***************
Karsten Hopp f99b4a
*** 400,405 ****
Karsten Hopp f99b4a
--- 400,408 ----
Karsten Hopp f99b4a
  				This is zero in case it cannot be determined
Karsten Hopp f99b4a
  				(e.g. when the window object belongs to other
Karsten Hopp f99b4a
  				tab page).
Karsten Hopp f99b4a
+  	row, col (read-only)	On-screen window position in display cells.
Karsten Hopp f99b4a
+ 				First position is zero.
Karsten Hopp f99b4a
+ 
Karsten Hopp f99b4a
  The height attribute is writable only if the screen is split horizontally.
Karsten Hopp f99b4a
  The width attribute is writable only if the screen is split vertically.
Karsten Hopp f99b4a
  
Karsten Hopp f99b4a
*** ../vim-7.3.939/src/if_py_both.h	2013-05-12 19:09:46.000000000 +0200
Karsten Hopp f99b4a
--- src/if_py_both.h	2013-05-12 19:22:16.000000000 +0200
Karsten Hopp f99b4a
***************
Karsten Hopp f99b4a
*** 1839,1847 ****
Karsten Hopp f99b4a
--- 1839,1853 ----
Karsten Hopp f99b4a
      }
Karsten Hopp f99b4a
      else if (strcmp(name, "height") == 0)
Karsten Hopp f99b4a
  	return PyLong_FromLong((long)(this->win->w_height));
Karsten Hopp f99b4a
+ #ifdef FEAT_WINDOWS
Karsten Hopp f99b4a
+     else if (strcmp(name, "row") == 0)
Karsten Hopp f99b4a
+ 	return PyLong_FromLong((long)(this->win->w_winrow));
Karsten Hopp f99b4a
+ #endif
Karsten Hopp f99b4a
  #ifdef FEAT_VERTSPLIT
Karsten Hopp f99b4a
      else if (strcmp(name, "width") == 0)
Karsten Hopp f99b4a
  	return PyLong_FromLong((long)(W_WIDTH(this->win)));
Karsten Hopp f99b4a
+     else if (strcmp(name, "col") == 0)
Karsten Hopp f99b4a
+ 	return PyLong_FromLong((long)(W_WINCOL(this->win)));
Karsten Hopp f99b4a
  #endif
Karsten Hopp f99b4a
      else if (strcmp(name, "vars") == 0)
Karsten Hopp f99b4a
  	return DictionaryNew(this->win->w_vars);
Karsten Hopp f99b4a
***************
Karsten Hopp f99b4a
*** 1851,1858 ****
Karsten Hopp f99b4a
      else if (strcmp(name, "number") == 0)
Karsten Hopp f99b4a
  	return PyLong_FromLong((long) get_win_number(this->win));
Karsten Hopp f99b4a
      else if (strcmp(name,"__members__") == 0)
Karsten Hopp f99b4a
! 	return Py_BuildValue("[ssssss]", "buffer", "cursor", "height", "vars",
Karsten Hopp f99b4a
! 		"options", "number");
Karsten Hopp f99b4a
      else
Karsten Hopp f99b4a
  	return NULL;
Karsten Hopp f99b4a
  }
Karsten Hopp f99b4a
--- 1857,1864 ----
Karsten Hopp f99b4a
      else if (strcmp(name, "number") == 0)
Karsten Hopp f99b4a
  	return PyLong_FromLong((long) get_win_number(this->win));
Karsten Hopp f99b4a
      else if (strcmp(name,"__members__") == 0)
Karsten Hopp f99b4a
! 	return Py_BuildValue("[ssssssss]", "buffer", "cursor", "height", "vars",
Karsten Hopp f99b4a
! 		"options", "number", "row", "col");
Karsten Hopp f99b4a
      else
Karsten Hopp f99b4a
  	return NULL;
Karsten Hopp f99b4a
  }
Karsten Hopp f99b4a
*** ../vim-7.3.939/src/version.c	2013-05-12 19:09:46.000000000 +0200
Karsten Hopp f99b4a
--- src/version.c	2013-05-12 19:23:50.000000000 +0200
Karsten Hopp f99b4a
***************
Karsten Hopp f99b4a
*** 730,731 ****
Karsten Hopp f99b4a
--- 730,733 ----
Karsten Hopp f99b4a
  {   /* Add new patch number below this line */
Karsten Hopp f99b4a
+ /**/
Karsten Hopp f99b4a
+     940,
Karsten Hopp f99b4a
  /**/
Karsten Hopp f99b4a
Karsten Hopp f99b4a
-- 
Karsten Hopp f99b4a
A computer programmer is a device for turning requirements into
Karsten Hopp f99b4a
undocumented features.  It runs on cola, pizza and Dilbert cartoons.
Karsten Hopp f99b4a
					Bram Moolenaar
Karsten Hopp f99b4a
Karsten Hopp f99b4a
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp f99b4a
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp f99b4a
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp f99b4a
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///