From dae1213e57da36aaa805425636d11712c746fe49 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 28 Oct 2018 13:51:36 +0100 Subject: [PATCH] vim-patch:f0b03c4e98f8 Update runtime files https://github.com/vim/vim/commit/f0b03c4e98f8a7184d8b4a5d702cbcd602426923 Note: haskell changes were included in 942f3587c38a83cf6486a0b779765b54a1648493 --- runtime/autoload/dist/ft.vim | 8 +- runtime/doc/eval.txt | 27 +++++ runtime/doc/filetype.txt | 19 ++++ runtime/doc/repeat.txt | 4 + runtime/doc/usr_41.txt | 1 + runtime/filetype.vim | 3 + runtime/ftplugin/vim.vim | 32 +++--- runtime/ftplugin/zimbu.vim | 8 +- runtime/indent/javascript.vim | 183 +++++++++++++++++++-------------- runtime/syntax/apachestyle.vim | 8 +- runtime/syntax/html.vim | 14 +-- runtime/syntax/tex.vim | 23 ++--- runtime/syntax/vim.vim | 7 +- 13 files changed, 213 insertions(+), 124 deletions(-) diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 2603c6822f..81fdc9d956 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -1,7 +1,7 @@ " Vim functions for file type detection " " Maintainer: Bram Moolenaar -" Last Change: 2017 Nov 11 +" Last Change: 2017 Dec 05 " These functions are moved here from runtime/filetype.vim to make startup " faster. @@ -618,7 +618,11 @@ func dist#ft#FTperl() setf perl return 1 endif - if search('^use\s\s*\k', 'nc', 30) + let save_cursor = getpos('.') + call cursor(1,1) + let has_use = search('^use\s\s*\k', 'c', 30) + call setpos('.', save_cursor) + if has_use setf perl return 1 endif diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 6e678790bb..7b1857883b 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2194,6 +2194,8 @@ msgpackdump({list}) List dump a list of objects to msgpack msgpackparse({list}) List parse msgpack to a list of objects nextnonblank({lnum}) Number line nr of non-blank line >= {lnum} nr2char({expr}[, {utf8}]) String single char with ASCII/UTF8 value {expr} +option_restore({list}) none restore options saved by option_save() +option_save({list}) List save options values nvim_...({args}...) any call nvim |api| functions or({expr}, {expr}) Number bitwise OR pathshorten({expr}) String shorten directory names in a path @@ -5882,6 +5884,31 @@ nvim_...({...}) *nvim_...()* *eval-api* also take the numerical value 0 to indicate the current (focused) object. +option_restore({list}) *option_restore()* + Restore options previously saved by option_save(). + When buffer-local options have been saved, this function must + be called when the same buffer is the current buffer. + When window-local options have been saved, this function must + be called when the same window is the current window. + When in the wrong buffer and/or window an error is given and + the local options won't be restored. + NOT IMPLEMENTED YET! + +option_save({list}) *option_save()* + Saves the options named in {list}. The returned value can be + passed to option_restore(). Example: > + let s:saved_options = option_save([ + \ 'ignorecase', + \ 'iskeyword', + \ ]) + au BufLeave * + \ call option_restore(s:saved_options) +< The advantage over using `:let` is that global and local + values are handled and the script ID is restored, so that + `:verbose set` will show where the option was originally set, + not where it was restored. + NOT IMPLEMENTED YET! + or({expr}, {expr}) *or()* Bitwise OR on the two arguments. The arguments are converted to a number. A List, Dict or Float argument causes an error. diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 6ac14e4122..4d16a2eaf6 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -750,4 +750,23 @@ You can change the default by defining the variable g:tex_flavor to the format Currently no other formats are recognized. +VIM *ft-vim-plugin* + +The Vim filetype plugin defines mappings to move to the start and end of +functions with [[ and ]]. Move around comments with ]" and [". + +The mappings can be disabled with: > + let g:no_vim_maps = 1 + + +ZIMBU *ft-zimbu-plugin* + +The Zimbu filetype plugin defines mappings to move to the start and end of +functions with [[ and ]]. + +The mappings can be disabled with: > + let g:no_zimbu_maps = 1 +< + + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 42889cca50..b63ece7d2d 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -226,6 +226,10 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. If the directory pack/*/opt/{name}/after exists it is added at the end of 'runtimepath'. + If loading packages from "pack/*/start" was skipped, + then this directory is searched first: + pack/*/start/{name} ~ + Note that {name} is the directory name, not the name of the .vim file. All the files matching the pattern pack/*/opt/{name}/plugin/**/*.vim ~ diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 83d3106bf9..95d1813104 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -901,6 +901,7 @@ Vim server: *server-functions* Window size and position: *window-size-functions* winheight() get height of a specific window winwidth() get width of a specific window + win_screenpos() get screen position of a window winrestcmd() return command to restore window sizes winsaveview() get view of current window winrestview() restore saved view of current window diff --git a/runtime/filetype.vim b/runtime/filetype.vim index deab1f0f58..bb8d210539 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1924,6 +1924,9 @@ au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif " Most of these should call s:StarSetf() to avoid names ending in .gz and the " like are used. +" More Apache style config files +au BufNewFile,BufRead */etc/proftpd/*.conf*,*/etc/proftpd/conf.*/* call s:StarSetf('apachestyle') + " More Apache config files au BufNewFile,BufRead access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf* call s:StarSetf('apache') au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.d/*.conf* call s:StarSetf('apache') diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index f34655f330..59ea349710 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Vim " Maintainer: Bram Moolenaar -" Last Change: 2017 Nov 06 +" Last Change: 2017 Dec 05 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -42,21 +42,23 @@ setlocal commentstring=\"%s " Prefer Vim help instead of manpages. setlocal keywordprg=:help -" Move around functions. -nnoremap [[ m':call search('^\s*fu\%[nction]\>', "bW") -vnoremap [[ m':exe "normal! gv"call search('^\s*fu\%[nction]\>', "bW") -nnoremap ]] m':call search('^\s*fu\%[nction]\>', "W") -vnoremap ]] m':exe "normal! gv"call search('^\s*fu\%[nction]\>', "W") -nnoremap [] m':call search('^\s*endf*\%[unction]\>', "bW") -vnoremap [] m':exe "normal! gv"call search('^\s*endf*\%[unction]\>', "bW") -nnoremap ][ m':call search('^\s*endf*\%[unction]\>', "W") -vnoremap ][ m':exe "normal! gv"call search('^\s*endf*\%[unction]\>', "W") +if !exists("no_plugin_maps") && !exists("no_vim_maps") + " Move around functions. + nnoremap [[ m':call search('^\s*fu\%[nction]\>', "bW") + vnoremap [[ m':exe "normal! gv"call search('^\s*fu\%[nction]\>', "bW") + nnoremap ]] m':call search('^\s*fu\%[nction]\>', "W") + vnoremap ]] m':exe "normal! gv"call search('^\s*fu\%[nction]\>', "W") + nnoremap [] m':call search('^\s*endf*\%[unction]\>', "bW") + vnoremap [] m':exe "normal! gv"call search('^\s*endf*\%[unction]\>', "bW") + nnoremap ][ m':call search('^\s*endf*\%[unction]\>', "W") + vnoremap ][ m':exe "normal! gv"call search('^\s*endf*\%[unction]\>', "W") -" Move around comments -nnoremap ]" :call search('^\(\s*".*\n\)\@ -vnoremap ]" :exe "normal! gv"call search('^\(\s*".*\n\)\@ -nnoremap [" :call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW") -vnoremap [" :exe "normal! gv"call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW") + " Move around comments + nnoremap ]" :call search('^\(\s*".*\n\)\@ + vnoremap ]" :exe "normal! gv"call search('^\(\s*".*\n\)\@ + nnoremap [" :call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW") + vnoremap [" :exe "normal! gv"call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW") +endif " Let the matchit plugin know what items can be matched. if exists("loaded_matchit") diff --git a/runtime/ftplugin/zimbu.vim b/runtime/ftplugin/zimbu.vim index 558aea7df0..24674776cb 100644 --- a/runtime/ftplugin/zimbu.vim +++ b/runtime/ftplugin/zimbu.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Zimbu " Maintainer: Bram Moolenaar -" Last Change: 2012 Sep 08 +" Last Change: 2017 Dec 05 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -135,8 +135,10 @@ iabbr until GCUpperSpace("until") iabbr while GCUpperSpace("while") iabbr repeat GCUpper("repeat") -nnoremap [[ m`:call ZimbuGoStartBlock() -nnoremap ]] m`:call ZimbuGoEndBlock() +if !exists("no_plugin_maps") && !exists("no_zimbu_maps") + nnoremap [[ m`:call ZimbuGoStartBlock() + nnoremap ]] m`:call ZimbuGoEndBlock() +endif " Using a function makes sure the search pattern is restored func! ZimbuGoStartBlock() diff --git a/runtime/indent/javascript.vim b/runtime/indent/javascript.vim index 2861716287..f3bf96aa97 100644 --- a/runtime/indent/javascript.vim +++ b/runtime/indent/javascript.vim @@ -2,7 +2,7 @@ " Language: Javascript " Maintainer: Chris Paul ( https://github.com/bounceme ) " URL: https://github.com/pangloss/vim-javascript -" Last Change: September 18, 2017 +" Last Change: December 4, 2017 " Only load this indent file when no other was loaded. if exists('b:did_indent') @@ -10,10 +10,6 @@ if exists('b:did_indent') endif let b:did_indent = 1 -" indent correctly if inside