diff --git a/plugin/python.vim b/plugin/python.vim index 78d7156..b0d071a 100644 --- a/plugin/python.vim +++ b/plugin/python.vim @@ -1,8 +1,8 @@ " -*- vim -*- " FILE: python.vim -" LAST MODIFICATION: 2001/07/07 +" LAST MODIFICATION: 2001/09/05 " (C) Copyright 2001 Mikael Berthe -" Version: 1.1 +" Version: 1.4 " USAGE: " @@ -55,11 +55,14 @@ map ] :call PythonNextLine(1) " Menu entries +nmenu &Python.Update\ IM-Python\ Menu + \:call UpdateMenu() +nmenu &Python.-Sep1- : nmenu &Python.Beginning\ of\ Block[[ \[[ nmenu &Python.End\ of\ Block]] \]] -nmenu &Python.-Sep1- : +nmenu &Python.-Sep2- : nmenu &Python.Shift\ Block\ Left]< \]< vmenu &Python.Shift\ Block\ Left]< @@ -68,7 +71,7 @@ nmenu &Python.Shift\ Block\ Right]> \]> vmenu &Python.Shift\ Block\ Right]> \]> -nmenu &Python.-Sep2- : +nmenu &Python.-Sep3- : vmenu &Python.Comment\ Selection \:call PythonCommentSelection() nmenu &Python.Comment\ Selection @@ -77,7 +80,7 @@ vmenu &Python.Uncomment\ Selection \:call PythonUncommentSelection() nmenu &Python.Uncomment\ Selection \:call PythonUncommentSelection() -nmenu &Python.-Sep3- : +nmenu &Python.-Sep4- : nmenu &Python.Previous\ Class \:call PythonDec("class", -1) nmenu &Python.Next\ Class @@ -86,14 +89,14 @@ nmenu &Python.Previous\ Function \:call PythonDec("function", -1) nmenu &Python.Next\ Function \:call PythonDec("function", 1) -nmenu &Python.-Sep4- : +nmenu &Python.-Sep5- : nmenu &Python.Select\ Block]v \]v nmenu &Python.Select\ Function]f \]f nmenu &Python.Select\ Class]c \]c -nmenu &Python.-Sep5- : +nmenu &Python.-Sep6- : nmenu &Python.Previous\ Line\ wrt\ indent] \] nmenu &Python.Next\ Line\ wrt\ indent] @@ -102,7 +105,7 @@ nmenu &Python.Next\ Line\ wrt\ indent] :com! PBoB execute "normal ".PythonBoB(line('.'), -1, 1)."G" :com! PEoB execute "normal ".PythonBoB(line('.'), 1, 1)."G" - +:com! UpdateMenu call UpdateMenu() " Go to a block boundary (-1: previous, 1: next) @@ -276,14 +279,15 @@ function! PythonNextLine(direction) execute "normal ".ln."G" endfunction + " update the IM-Python menu, that holds Classes and Functions function! UpdateMenu() + let cline=line('.') call MakeClassStructure () call MakeFuncStructure () + execute "normal ".cline."Gzz" endfunction -command UpdateMenu call UpdateMenu () - " make a menu that holds all of the classes function! MakeClassStructure () norm mpgg0 @@ -301,7 +305,7 @@ function! MakeClassStructure () norm 'p endfunction -"make a menu that holds all of the function deffinitions +" make a menu that holds all of the function definitions function! MakeFuncStructure () norm mpgg0 while line(".") <= line("$")