# HG changeset patch # User Bram Moolenaar # Date 1279372830 -7200 # Node ID f177a6431514b775c8e3e14c67d5227abf856600 # Parent 0a258a67051d059ef9d5b06c7ee673b4baadff17 Better implementation of creating the Color Scheme menu. (Juergen Kraemer) diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1091,35 +1091,22 @@ Before (beta) release 7.3: Vim 7.3: Patches to possibly include: -6 In the quickfix window statusline add the command used to get the list of - errors, e.g. ":make foo", ":grep something *.c". - Patch by Lech Lorens, 2009 Mar 23. - Comments from Andreas Bernauer 24th, Dominique Pelle 24th - Docs patch by Dominique Pelle, Mar 25 - Update 2009 Mar 28. - Fix for invalid memory access. (Lech Lorens, 2009 Apr 17) -- Patch for colorscheme submenu. (Juergen Kraemer, 2008 Aug 20) - 9 Make it possible to drag a tab page label to another position with the mouse. - Patch by Paul B. Mahol, 2008 Aug 29. -- Mac: Patch to disable antialias. (LC Mi, 2008 Aug 23) Tested on 10.5 and - 10.4. -- Patch for adding "J" flag to 'cinoptions': placement of jump label. (Manuel - Konig, 2010 Feb 19) Update by Lech Lorens, Feb 22. - Need another name, "J" is now used for Javascript. + Patch by Paul B. Mahol, 2008 Aug 29. +- Mac: Patch to disable antialias. (LC Mi, 2008 Aug 23) Tested on 10.5 and + 10.4. +- Patch for adding "J" flag to 'cinoptions': placement of jump label. (Manuel + Konig, 2010 Feb 19) Update by Lech Lorens, Feb 22. + Need another name, "J" is now used for Javascript. +- Patch for Python 3 support. (Roland Puntaier, 2009 Sep 22) + Includes changes for omnicompletion. + Needs some more testing. + Update 2010 Apr 20, patch by Andy Kittner, May 16 + Build the MS-Windows version with Python 2.6.5 and 3.1.2? Needs some work: -- Have a look at patch to enable screen access from Python. (Marko Mahnic, - 2010 Apr 12) -- Patch for Python 3 support. (Roland Puntaier, 2009 Sep 22) - Includes changes for omnicompletion. - Needs some more testing. - Update 2010 Apr 20, patch by Andy Kittner, May 16 - Build the MS-Windows version with Python 2.6.5 and 3.1.2? -- Easier/standard way to disable default plugins. -- ":{range}source": source the lines from the current file. - You can already yank lines and use :@" to execute them. - Most of do_source() would not be used, need a new function. - It's easy when not doing breakpoints or profiling. +- Have a look at patch to enable screen access from Python. (Marko Mahnic, + 2010 Apr 12) More patches: @@ -1161,6 +1148,12 @@ More patches: more friendly for the Vim distribution. New version received 2008 Jan 6. No maintenance in two years... +6 In the quickfix window statusline add the command used to get the list of + errors, e.g. ":make foo", ":grep something *.c". + Patch by Lech Lorens, 2009 Apri 17. + Comments from Andreas Bernauer 24th, Dominique Pelle 24th + Docs patch by Dominique Pelle, Mar 25 + Can we put the strings in a window-local variable? Awaiting updated patches: @@ -2670,6 +2663,12 @@ 8 Add referring to key options with "& - Add ":let var ?= value", conditional assignment. Patch by Dave Eggum, 2006 Dec 11. - range for ":exec", pass it on to the executed command. (Webb) +8 ":{range}source": source the lines from the current file. + You can already yank lines and use :@" to execute them. + Most of do_source() would not be used, need a new function. + It's easy when not doing breakpoints or profiling. + Requires copying the lines into a list and then creating a function to + execute lines from the list. Similar to getnextac(). 7 ":include" command: just like ":source" but doesn't start a new scriptID? Will be tricky for the list of script names. 8 Have a look at VSEL. Would it be useful to include? (Bigham) diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1711,15 +1711,23 @@ system administrator has dropped it in t user has his own plugin he wants to use. Then the user must have a chance to disable loading this specific plugin. This will make it possible: > - 6 if exists("loaded_typecorr") + 6 if exists("g:loaded_typecorr") 7 finish 8 endif - 9 let loaded_typecorr = 1 + 9 let g:loaded_typecorr = 1 This also avoids that when the script is loaded twice it would cause error messages for redefining functions and cause trouble for autocommands that are added twice. +The name is recommended to start with "loaded_" and then the file name of the +plugin, literally. The "g:" is prepended just to avoid mistakes when using +the variable in a function (without "g:" it would be a variable local to the +function). + +Using "finish" stops Vim from reading the rest of the file, it's much quicker +than using if-endif around the whole file. + MAPPING @@ -1896,10 +1904,10 @@ Here is the resulting complete example: 3 " Maintainer: Bram Moolenaar 4 " License: This file is placed in the public domain. 5 - 6 if exists("loaded_typecorr") + 6 if exists("g:loaded_typecorr") 7 finish 8 endif - 9 let loaded_typecorr = 1 + 9 let g:loaded_typecorr = 1 10 11 let s:save_cpo = &cpo 12 set cpo&vim diff --git a/runtime/menu.vim b/runtime/menu.vim --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -337,27 +337,23 @@ fun! s:FileFormat() endif endfun + " Setup the Edit.Color Scheme submenu + +" get NL separated string with file names let s:n = globpath(&runtimepath, "colors/*.vim") + +" split at NL, Ignore case for VMS and windows, sort on name +let s:names = sort(map(split(s:n, "\n"), 'substitute(v:val, "\\c.*[/\\\\:\\]]\\([^/\\\\:]*\\)\\.vim", "\\1", "")'), 1) + +" define all the submenu entries let s:idx = 100 -while strlen(s:n) > 0 - let s:i = stridx(s:n, "\n") - if s:i < 0 - let s:name = s:n - let s:n = "" - else - let s:name = strpart(s:n, 0, s:i) - let s:n = strpart(s:n, s:i + 1, 19999) - endif - " Ignore case for VMS and windows - let s:name = substitute(s:name, '\c.*[/\\:\]]\([^/\\:]*\)\.vim', '\1', '') +for s:name in s:names exe "an 20.450." . s:idx . ' &Edit.C&olor\ Scheme.' . s:name . " :colors " . s:name . "" - unlet s:name - unlet s:i let s:idx = s:idx + 10 -endwhile -unlet s:n -unlet s:idx +endfor +unlet s:name s:names s:n s:idx + " Setup the Edit.Keymap submenu if has("keymap") diff --git a/runtime/plugin/rrhelper.vim b/runtime/plugin/rrhelper.vim --- a/runtime/plugin/rrhelper.vim +++ b/runtime/plugin/rrhelper.vim @@ -3,7 +3,7 @@ " Last Change: 2008 May 29 " Has this already been loaded? -if exists("loaded_rrhelper") +if exists("loaded_rrhelper") || !has("clientserver") finish endif let loaded_rrhelper = 1 @@ -11,42 +11,38 @@ let loaded_rrhelper = 1 " Setup answers for a --remote-wait client who will assume " a SetupRemoteReplies() function in the command server -if has("clientserver") - function SetupRemoteReplies() - let cnt = 0 - let max = argc() +function SetupRemoteReplies() + let cnt = 0 + let max = argc() - let id = expand("") - if id == 0 - return - endif - while cnt < max - " Handle same file from more clients and file being more than once - " on the command line by encoding this stuff in the group name - let uniqueGroup = "RemoteReply_".id."_".cnt + let id = expand("") + if id == 0 + return + endif + while cnt < max + " Handle same file from more clients and file being more than once + " on the command line by encoding this stuff in the group name + let uniqueGroup = "RemoteReply_".id."_".cnt - " Path separators are always forward slashes for the autocommand pattern. - " Escape special characters with a backslash. - let f = substitute(argv(cnt), '\\', '/', "g") - if exists('*fnameescape') - let f = fnameescape(f) - else - let f = escape(f, " \t\n*?[{`$\\%#'\"|!<") - endif - execute "augroup ".uniqueGroup - execute "autocmd ".uniqueGroup." BufUnload ". f ." call DoRemoteReply('".id."', '".cnt."', '".uniqueGroup."', '". f ."')" - let cnt = cnt + 1 - endwhile - augroup END - endfunc + " Path separators are always forward slashes for the autocommand pattern. + " Escape special characters with a backslash. + let f = substitute(argv(cnt), '\\', '/', "g") + if exists('*fnameescape') + let f = fnameescape(f) + else + let f = escape(f, " \t\n*?[{`$\\%#'\"|!<") + endif + execute "augroup ".uniqueGroup + execute "autocmd ".uniqueGroup." BufUnload ". f ." call DoRemoteReply('".id."', '".cnt."', '".uniqueGroup."', '". f ."')" + let cnt = cnt + 1 + endwhile + augroup END +endfunc - function DoRemoteReply(id, cnt, group, file) - call server2client(a:id, a:cnt) - execute 'autocmd! '.a:group.' BufUnload '.a:file - execute 'augroup! '.a:group - endfunc - -endif - +function DoRemoteReply(id, cnt, group, file) + call server2client(a:id, a:cnt) + execute 'autocmd! '.a:group.' BufUnload '.a:file + execute 'augroup! '.a:group +endfunc " vim: set sw=2 sts=2 :