# HG changeset patch # User Bram Moolenaar # Date 1644004805 -3600 # Node ID f37561549ec28fba57d9526e84bd7412a57bce8d # Parent 063952f6859546af62b71d4b39ecddeab2ebd9b2 Update runtime files; use compiled functions Commit: https://github.com/vim/vim/commit/3e79c97c18c50f97797ab13ed81c4011eba9aba0 Author: Bram Moolenaar Date: Fri Feb 4 19:48:06 2022 +0000 Update runtime files; use compiled functions diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -893,4 +893,4 @@ enddef # Uncomment this line to check for compilation errors early -defcompile +# defcompile diff --git a/runtime/doc/uganda.txt b/runtime/doc/uganda.txt --- a/runtime/doc/uganda.txt +++ b/runtime/doc/uganda.txt @@ -1,4 +1,4 @@ -*uganda.txt* For Vim version 8.2. Last change: 2020 Jan 08 +*uganda.txt* For Vim version 8.2. Last change: 2022 Feb 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -11,9 +11,9 @@ Vim is Charityware. You can use and cop encouraged to make a donation for needy children in Uganda. Please see |kcc| below or visit the ICCF web site, available at these URLs: - http://iccf-holland.org/ - http://www.vim.org/iccf/ - http://www.iccf.nl/ + https://iccf-holland.org/ + https://www.vim.org/iccf/ + https://www.iccf.nl/ You can also sponsor the development of Vim. Vim sponsors can vote for features. See |sponsor|. The money goes to Uganda anyway. @@ -169,10 +169,11 @@ households are stimulated to build a pro production site for cement slabs. These are used to build a good latrine. They are sold below cost price. -There is a small clinic at the project, which provides children and their -family with medical help. When needed, transport to a hospital is offered. -Immunization programs are carried out and help is provided when an epidemic is -breaking out (measles and cholera have been a problem). +There is a clinic at the project, which provides children and their family +medical help. Since 2020 a maternity ward was added and 24/7 service is +available. When needed, transport to a hospital is offered. Immunization +programs are carried out and help is provided when an epidemic is breaking out +(measles and cholera have been a problem). *donate* Summer 1994 to summer 1995 I spent a whole year at the centre, working as a volunteer. I have helped to expand the centre and worked in the area of water @@ -214,44 +215,29 @@ Check the ICCF web site for the latest i USA: The methods mentioned below can be used. - Sending a check to the Nehemiah Group Outreach Society (NGOS) - is no longer possible, unfortunately. We are looking for - another way to get you an IRS tax receipt. - For sponsoring a child contact KCF in Canada (see below). US - checks can be sent to them to lower banking costs. + If you must send a check send it to our Canadian partner: + https://www.kuwasha.net/ -Canada: Contact Kibaale Children's Fund (KCF) in Surrey, Canada. They - take care of the Canadian sponsors for the children in - Kibaale. KCF forwards 100% of the money to the project in - Uganda. You can send them a one time donation directly. +Canada: Contact Kuwasha in Surrey, Canada. They take care of the + Canadian sponsors for the children in Kibaale. Kuwasha + forwards 100% of the money to the project in Uganda. You can + send them a one time donation directly. Please send me a note so that I know what has been donated - because of Vim. Ask KCF for information about sponsorship. - Kibaale Children's Fund c/o Pacific Academy - 10238-168 Street - Surrey, B.C. V4N 1Z4 - Canada - Phone: 604-581-5353 - If you make a donation to Kibaale Children's Fund (KCF) you - will receive a tax receipt which can be submitted with your - tax return. + because of Vim. Look on their for information about + sponsorship: https://www.kuwasha.net/ + If you make a donation to Kuwasha you will receive a tax + receipt which can be submitted with your tax return. -Holland: Transfer to the account of "Stichting ICCF Holland" in Lisse. - This will allow for tax deduction if you live in Holland. - Postbank, nr. 4548774 - IBAN: NL95 INGB 0004 5487 74 +Holland: Transfer to the account of "Stichting ICCF Holland" in + Amersfoort. This will allow for tax deduction if you live in + Holland. ING bank, IBAN: NL95 INGB 0004 5487 74 Germany: It is possible to make donations that allow for a tax return. Check the ICCF web site for the latest information: - http://iccf-holland.org/germany.html + https://iccf-holland.org/germany.html -World: Use a postal money order. That should be possible from any - country, mostly from the post office. Use this name (which is - in my passport): "Abraham Moolenaar". Use Euro for the - currency if possible. - -Europe: Use a bank transfer if possible. Your bank should have a form - that you can use for this. See "Others" below for the swift - code and IBAN number. +Europe: Use a bank transfer if possible. See "Others" below for the + swift code and IBAN number. Any other method should work. Ask for information about sponsorship. @@ -261,28 +247,12 @@ Credit Card: You can use PayPal to send https://www.paypal.com/en_US/mrb/pal=XAC62PML3GF8Q The e-mail address for sending the money to is: Bram@iccf-holland.org - For amounts above 400 Euro ($500) sending a check is - preferred. Others: Transfer to one of these accounts if possible: - Postbank, account 4548774 - Swift code: INGB NL 2A - IBAN: NL95 INGB 0004 5487 74 - under the name "stichting ICCF Holland", Lisse - If that doesn't work: - Rabobank Lisse, account 3765.05.117 - Swift code: RABO NL 2U - under the name "Bram Moolenaar", Lisse - Otherwise, send a check in euro or US dollars to the address - below. Minimal amount: $70 (my bank does not accept smaller - amounts for foreign check, sorry) + ING bank: IBAN: NL95 INGB 0004 5487 74 + Swift code: INGBNL2A + under the name "stichting ICCF Holland", Amersfoort + Checks are not accepted. -Address to send checks to: - Bram Moolenaar - Finsterruetihof 1 - 8134 Adliswil - Switzerland - -This address is expected to be valid for a long time. vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/ftplugin.vim b/runtime/ftplugin.vim --- a/runtime/ftplugin.vim +++ b/runtime/ftplugin.vim @@ -1,7 +1,7 @@ " Vim support file to switch on loading plugins for file types " " Maintainer: Bram Moolenaar -" Last change: 2006 Apr 30 +" Last change: 2022 Feb 04 if exists("did_load_ftplugin") finish @@ -10,26 +10,26 @@ let did_load_ftplugin = 1 augroup filetypeplugin au FileType * call s:LoadFTPlugin() +augroup END - func! s:LoadFTPlugin() - if exists("b:undo_ftplugin") - exe b:undo_ftplugin - unlet! b:undo_ftplugin b:did_ftplugin +def s:LoadFTPlugin() + if exists("b:undo_ftplugin") + exe b:undo_ftplugin + unlet! b:undo_ftplugin b:did_ftplugin + endif + + var s = expand("") + if s != "" + if &cpo =~# "S" && exists("b:did_ftplugin") + # In compatible mode options are reset to the global values, need to + # set the local values also when a plugin was already used. + unlet b:did_ftplugin endif - let s = expand("") - if s != "" - if &cpo =~# "S" && exists("b:did_ftplugin") - " In compatible mode options are reset to the global values, need to - " set the local values also when a plugin was already used. - unlet b:did_ftplugin - endif - - " When there is a dot it is used to separate filetype names. Thus for - " "aaa.bbb" load "aaa" and then "bbb". - for name in split(s, '\.') - exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim' - endfor - endif - endfunc -augroup END + # When there is a dot it is used to separate filetype names. Thus for + # "aaa.bbb" load "aaa" and then "bbb". + for name in split(s, '\.') + exe 'runtime! ftplugin/' .. name .. '.vim ftplugin/' .. name .. '_*.vim ftplugin/' .. name .. '/*.vim' + endfor + endif +enddef diff --git a/runtime/indent.vim b/runtime/indent.vim --- a/runtime/indent.vim +++ b/runtime/indent.vim @@ -1,7 +1,7 @@ " Vim support file to switch on loading indent files for file types " " Maintainer: Bram Moolenaar -" Last Change: 2008 Feb 22 +" Last Change: 2022 Feb 04 if exists("did_indent_on") finish @@ -10,22 +10,23 @@ let did_indent_on = 1 augroup filetypeindent au FileType * call s:LoadIndent() - func! s:LoadIndent() - if exists("b:undo_indent") - exe b:undo_indent - unlet! b:undo_indent b:did_indent +augroup END + +def s:LoadIndent() + if exists("b:undo_indent") + exe b:undo_indent + unlet! b:undo_indent b:did_indent + endif + var s = expand("") + if s != "" + if exists("b:did_indent") + unlet b:did_indent endif - let s = expand("") - if s != "" - if exists("b:did_indent") - unlet b:did_indent - endif - " When there is a dot it is used to separate filetype names. Thus for - " "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim". - for name in split(s, '\.') - exe 'runtime! indent/' . name . '.vim' - endfor - endif - endfunc -augroup END + # When there is a dot it is used to separate filetype names. Thus for + # "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim". + for name in split(s, '\.') + exe 'runtime! indent/' .. name .. '.vim' + endfor + endif +enddef diff --git a/runtime/makemenu.vim b/runtime/makemenu.vim --- a/runtime/makemenu.vim +++ b/runtime/makemenu.vim @@ -1,52 +1,54 @@ -" Script to define the syntax menu in synmenu.vim -" Maintainer: Bram Moolenaar -" Last Change: 2019 Dec 07 +vim9script -" This is used by "make menu" in the src directory. +# Script to define the syntax menu in synmenu.vim +# Maintainer: Bram Moolenaar +# Last Change: 2022 Feb 04 + +# This is used by "make menu" in the src directory. edit :p:h/synmenu.vim -/The Start Of The Syntax Menu/+1,/The End Of The Syntax Menu/-1d -let s:lnum = line(".") - 1 -call append(s:lnum, "") -let s:lnum = s:lnum + 1 +:/The Start Of The Syntax Menu/+1,/The End Of The Syntax Menu/-1d +var lnum = line(".") - 1 +call append(lnum, "") +lnum += 1 -" Use the SynMenu command and function to define all menu entries -command! -nargs=* SynMenu call Syn() +# Use the SynMenu command and function to define all menu entries +command! -nargs=* SynMenu call Syn() -let s:cur_menu_name = "" -let s:cur_menu_nr = 0 -let s:cur_menu_item = 0 -let s:cur_menu_char = "" +var cur_menu_name = "" +var cur_menu_nr = 0 +var cur_menu_item = 0 +var cur_menu_char = "" -fun! Syn(arg) - " isolate menu name: until the first dot - let i = match(a:arg, '\.') - let menu_name = strpart(a:arg, 0, i) - let r = strpart(a:arg, i + 1, 999) - " isolate submenu name: until the colon - let i = match(r, ":") - let submenu_name = strpart(r, 0, i) - " after the colon is the syntax name - let syntax_name = strpart(r, i + 1, 999) +def Syn(arg: string) + # isolate menu name: until the first dot + var i = match(arg, '\.') + var menu_name = strpart(arg, 0, i) + var r = strpart(arg, i + 1, 999) + # isolate submenu name: until the colon + i = match(r, ":") + var submenu_name = strpart(r, 0, i) + # after the colon is the syntax name + var syntax_name = strpart(r, i + 1, 999) - if s:cur_menu_name != menu_name - let s:cur_menu_name = menu_name - let s:cur_menu_nr = s:cur_menu_nr + 10 - let s:cur_menu_item = 100 - let s:cur_menu_char = submenu_name[0] + if cur_menu_name != menu_name + cur_menu_name = menu_name + cur_menu_nr += 10 + cur_menu_item = 100 + cur_menu_char = submenu_name[0] else - " When starting a new letter, insert a menu separator. - let c = submenu_name[0] + # When starting a new letter, insert a menu separator. + var c = submenu_name[0] if c != s:cur_menu_char - exe 'an 50.' . s:cur_menu_nr . '.' . s:cur_menu_item . ' &Syntax.' . menu_name . ".-" . c . '- ' - let s:cur_menu_item = s:cur_menu_item + 10 - let s:cur_menu_char = c + exe 'an 50.' .. s:cur_menu_nr .. '.' .. s:cur_menu_item .. ' &Syntax.' .. menu_name .. ".-" .. c .. '- ' + cur_menu_item += 10 + cur_menu_char = c endif endif - call append(s:lnum, 'an 50.' . s:cur_menu_nr . '.' . s:cur_menu_item . ' &Syntax.' . menu_name . "." . submenu_name . ' :cal SetSyn("' . syntax_name . '")') - let s:cur_menu_item = s:cur_menu_item + 10 - let s:lnum = s:lnum + 1 -endfun + append(lnum, 'an 50.' .. s:cur_menu_nr .. '.' .. s:cur_menu_item .. ' &Syntax.' .. menu_name .. "." .. submenu_name .. ' :cal SetSyn("' .. syntax_name .. '")') + cur_menu_item += 10 + lnum += 1 +enddef SynMenu AB.A2ps\ config:a2ps SynMenu AB.Aap:aap @@ -676,6 +678,6 @@ SynMenu WXYZ.YAML:yaml SynMenu WXYZ.Yacc:yacc SynMenu WXYZ.Zimbu:zimbu -call append(s:lnum, "") +append(lnum, "") wq diff --git a/runtime/menu.vim b/runtime/menu.vim --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -2,7 +2,7 @@ " You can also use this as a start for your own set of menus. " " Maintainer: Bram Moolenaar -" Last Change: 2021 Dec 22 +" Last Change: 2022 Feb 04 " Note that ":an" (short for ":anoremenu") is often used to make a menu work " in all modes and avoid side effects from mappings defined by the user. @@ -33,7 +33,7 @@ if exists("v:lang") || &langmenu != "" if strlen(s:lang) > 1 && s:lang !~? '^en_us' " When the language does not include the charset add 'encoding' if s:lang =~ '^\a\a$\|^\a\a_\a\a$' - let s:lang = s:lang . '.' . &enc + let s:lang = s:lang .. '.' .. &enc endif " We always use a lowercase name. @@ -49,26 +49,26 @@ if exists("v:lang") || &langmenu != "" " same menu file for them. let s:lang = substitute(s:lang, 'iso_8859-15\=$', "latin1", "") menutrans clear - exe "runtime! lang/menu_" . s:lang . ".vim" + exe "runtime! lang/menu_" .. s:lang .. ".vim" if !exists("did_menu_trans") " There is no exact match, try matching with a wildcard added " (e.g. find menu_de_de.iso_8859-1.vim if s:lang == de_DE). let s:lang = substitute(s:lang, '\.[^.]*', "", "") - exe "runtime! lang/menu_" . s:lang . "[^a-z]*vim" + exe "runtime! lang/menu_" .. s:lang .. "[^a-z]*vim" if !exists("did_menu_trans") && s:lang =~ '_' " If the language includes a region try matching without that region. " (e.g. find menu_de.vim if s:lang == de_DE). let langonly = substitute(s:lang, '_.*', "", "") - exe "runtime! lang/menu_" . langonly . "[^a-z]*vim" + exe "runtime! lang/menu_" .. langonly .. "[^a-z]*vim" endif if !exists("did_menu_trans") && strlen($LANG) > 1 && s:lang !~ '^en_us' " On windows locale names are complicated, try using $LANG, it might " have been set by set_init_1(). But don't do this for "en" or "en_us". " But don't match "slovak" when $LANG is "sl". - exe "runtime! lang/menu_" . tolower($LANG) . "[^a-z]*vim" + exe "runtime! lang/menu_" .. tolower($LANG) .. "[^a-z]*vim" endif endif endif @@ -104,19 +104,19 @@ if exists(':tlmenu') tlnoremenu 9999.90 &Help.&About :intro endif -fun! s:Helpfind() +def s:Helpfind() if !exists("g:menutrans_help_dialog") - let g:menutrans_help_dialog = "Enter a command or word to find help on:\n\nPrepend i_ for Input mode commands (e.g.: i_CTRL-X)\nPrepend c_ for command-line editing commands (e.g.: c_)\nPrepend ' for an option name (e.g.: 'shiftwidth')" + g:menutrans_help_dialog = "Enter a command or word to find help on:\n\nPrepend i_ for Input mode commands (e.g.: i_CTRL-X)\nPrepend c_ for command-line editing commands (e.g.: c_)\nPrepend ' for an option name (e.g.: 'shiftwidth')" endif - let h = inputdialog(g:menutrans_help_dialog) + var h = inputdialog(g:menutrans_help_dialog) if h != "" - let v:errmsg = "" - silent! exe "help " . h + v:errmsg = "" + silent! exe "help " .. h if v:errmsg != "" echo v:errmsg endif endif -endfun +enddef " File menu an 10.310 &File.&Open\.\.\.:e :browse confirm e @@ -154,16 +154,9 @@ an 10.600 &File.-SEP4- an 10.610 &File.Sa&ve-Exit:wqa :confirm wqa an 10.620 &File.E&xit:qa :confirm qa -func s:SelectAll() - exe "norm! gg" . (&slm == "" ? "VG" : "gH\G") -endfunc - -func s:FnameEscape(fname) - if exists('*fnameescape') - return fnameescape(a:fname) - endif - return escape(a:fname, " \t\n*?[{`$\\%#'\"|!<") -endfunc +def s:SelectAll() + exe "norm! gg" .. (&slm == "" ? "VG" : "gH\G") +enddef " Edit menu an 20.310 &Edit.&Undou u @@ -182,8 +175,8 @@ cnoremenu &Edit.&Paste"+gP + if exists(':tlmenu') tlnoremenu &Edit.&Paste"+gP "+ endif -exe 'vnoremenu