diff runtime/doc/if_pyth.txt @ 4323:f1eab4f77a6f v7.3.911

updated for version 7.3.911 Problem: Python: Access to Vim variables is not so easy. Solution: Define vim.vars and vim.vvars. (ZyX)
author Bram Moolenaar <bram@vim.org>
date Wed, 24 Apr 2013 14:07:45 +0200
parents 058f26a834c4
children 7eaccdaa5304
line wrap: on
line diff
--- a/runtime/doc/if_pyth.txt
+++ b/runtime/doc/if_pyth.txt
@@ -237,6 +237,11 @@ vim.current						*python-current*
 	"current range".  A range is a bit like a buffer, but with all access
 	restricted to a subset of lines.  See |python-range| for more details.
 
+vim.vars						*python-vars*
+vim.vvars						*python-vvars*
+	Dictionary-like objects holding dictionaries with global (|g:|) and 
+	vim (|v:|) variables respectively. Identical to `vim.bindeval("g:")`, 
+	but faster.
 
 Output from Python					*python-output*
 	Vim displays all Python code output in the Vim message area.  Normal
@@ -307,6 +312,7 @@ Examples (assume b is the current buffer
 	:py n = len(b)			# number of lines
 	:py (row,col) = b.mark('a')	# named mark
 	:py r = b.range(1,5)		# a sub-range of the buffer
+	:py b.vars["foo"] = "bar"	# assign b:foo variable
 
 ==============================================================================
 4. Range objects					*python-range*
@@ -354,6 +360,9 @@ Window attributes are:
 				This is a tuple, (row,col).
 	height (read-write)	The window height, in rows
 	width (read-write)	The window width, in columns
+	vars (read-only)	The window |w:| variables. Attribute is 
+				unassignable, but you can change window 
+				variables this way
 The height attribute is writable only if the screen is split horizontally.
 The width attribute is writable only if the screen is split vertically.