0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

Better implementation of creating the Color Scheme menu. (Juergen Kraemer)

This commit is contained in:
Bram Moolenaar 2010-07-17 15:20:30 +02:00
parent f91787cb9a
commit c5604bc165
4 changed files with 80 additions and 81 deletions

View File

@ -1091,14 +1091,6 @@ Before (beta) release 7.3:
Vim 7.3: Vim 7.3:
Patches to possibly include: 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 - 9 Make it possible to drag a tab page label to another position with the
mouse. mouse.
Patch by Paul B. Mahol, 2008 Aug 29. Patch by Paul B. Mahol, 2008 Aug 29.
@ -1107,19 +1099,14 @@ Patches to possibly include:
- Patch for adding "J" flag to 'cinoptions': placement of jump label. (Manuel - Patch for adding "J" flag to 'cinoptions': placement of jump label. (Manuel
Konig, 2010 Feb 19) Update by Lech Lorens, Feb 22. Konig, 2010 Feb 19) Update by Lech Lorens, Feb 22.
Need another name, "J" is now used for Javascript. Need another name, "J" is now used for Javascript.
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) - Patch for Python 3 support. (Roland Puntaier, 2009 Sep 22)
Includes changes for omnicompletion. Includes changes for omnicompletion.
Needs some more testing. Needs some more testing.
Update 2010 Apr 20, patch by Andy Kittner, May 16 Update 2010 Apr 20, patch by Andy Kittner, May 16
Build the MS-Windows version with Python 2.6.5 and 3.1.2? Build the MS-Windows version with Python 2.6.5 and 3.1.2?
- Easier/standard way to disable default plugins. Needs some work:
- ":{range}source": source the lines from the current file. - Have a look at patch to enable screen access from Python. (Marko Mahnic,
You can already yank lines and use :@" to execute them. 2010 Apr 12)
Most of do_source() would not be used, need a new function.
It's easy when not doing breakpoints or profiling.
More patches: More patches:
@ -1161,6 +1148,12 @@ More patches:
more friendly for the Vim distribution. more friendly for the Vim distribution.
New version received 2008 Jan 6. New version received 2008 Jan 6.
No maintenance in two years... 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: Awaiting updated patches:
@ -2670,6 +2663,12 @@ Built-in script language:
- Add ":let var ?= value", conditional assignment. Patch by Dave Eggum, - Add ":let var ?= value", conditional assignment. Patch by Dave Eggum,
2006 Dec 11. 2006 Dec 11.
- range for ":exec", pass it on to the executed command. (Webb) - 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? 7 ":include" command: just like ":source" but doesn't start a new scriptID?
Will be tricky for the list of script names. Will be tricky for the list of script names.
8 Have a look at VSEL. Would it be useful to include? (Bigham) 8 Have a look at VSEL. Would it be useful to include? (Bigham)

View File

@ -1711,15 +1711,23 @@ system administrator has dropped it in the system-wide plugin directory, but a
user has his own plugin he wants to use. Then the user must have a chance to 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: > disable loading this specific plugin. This will make it possible: >
6 if exists("loaded_typecorr") 6 if exists("g:loaded_typecorr")
7 finish 7 finish
8 endif 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 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 messages for redefining functions and cause trouble for autocommands that are
added twice. 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 MAPPING
@ -1896,10 +1904,10 @@ Here is the resulting complete example: >
3 " Maintainer: Bram Moolenaar <Bram@vim.org> 3 " Maintainer: Bram Moolenaar <Bram@vim.org>
4 " License: This file is placed in the public domain. 4 " License: This file is placed in the public domain.
5 5
6 if exists("loaded_typecorr") 6 if exists("g:loaded_typecorr")
7 finish 7 finish
8 endif 8 endif
9 let loaded_typecorr = 1 9 let g:loaded_typecorr = 1
10 10
11 let s:save_cpo = &cpo 11 let s:save_cpo = &cpo
12 set cpo&vim 12 set cpo&vim

View File

@ -337,27 +337,23 @@ fun! s:FileFormat()
endif endif
endfun endfun
" Setup the Edit.Color Scheme submenu " Setup the Edit.Color Scheme submenu
" get NL separated string with file names
let s:n = globpath(&runtimepath, "colors/*.vim") 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 let s:idx = 100
while strlen(s:n) > 0 for s:name in s:names
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', '')
exe "an 20.450." . s:idx . ' &Edit.C&olor\ Scheme.' . s:name . " :colors " . s:name . "<CR>" exe "an 20.450." . s:idx . ' &Edit.C&olor\ Scheme.' . s:name . " :colors " . s:name . "<CR>"
unlet s:name
unlet s:i
let s:idx = s:idx + 10 let s:idx = s:idx + 10
endwhile endfor
unlet s:n unlet s:name s:names s:n s:idx
unlet s:idx
" Setup the Edit.Keymap submenu " Setup the Edit.Keymap submenu
if has("keymap") if has("keymap")

View File

@ -3,7 +3,7 @@
" Last Change: 2008 May 29 " Last Change: 2008 May 29
" Has this already been loaded? " Has this already been loaded?
if exists("loaded_rrhelper") if exists("loaded_rrhelper") || !has("clientserver")
finish finish
endif endif
let loaded_rrhelper = 1 let loaded_rrhelper = 1
@ -11,7 +11,6 @@ let loaded_rrhelper = 1
" Setup answers for a --remote-wait client who will assume " Setup answers for a --remote-wait client who will assume
" a SetupRemoteReplies() function in the command server " a SetupRemoteReplies() function in the command server
if has("clientserver")
function SetupRemoteReplies() function SetupRemoteReplies()
let cnt = 0 let cnt = 0
let max = argc() let max = argc()
@ -46,7 +45,4 @@ if has("clientserver")
execute 'augroup! '.a:group execute 'augroup! '.a:group
endfunc endfunc
endif
" vim: set sw=2 sts=2 : " vim: set sw=2 sts=2 :