diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-12-27 22:49:44 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-12-27 22:49:44 +0100 |
commit | c1015121ec626cab6cb384f544bc0be1a1760c0e (patch) | |
tree | 6cc9a5d1899a4486a24c491e07d17a7dd01f9503 /runtime/plugin | |
parent | 4f030ec24e0e148bbb83aedaef7dd629e5fef130 (diff) | |
parent | e1876c7ad1b5e30c0a9919e2c4587d11550c8507 (diff) | |
download | rneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.tar.gz rneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.tar.bz2 rneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.zip |
Merge 'upstream/master' into pr-win-erw7
Diffstat (limited to 'runtime/plugin')
-rw-r--r-- | runtime/plugin/README.txt | 19 | ||||
-rw-r--r-- | runtime/plugin/matchit.vim | 12 | ||||
-rw-r--r-- | runtime/plugin/matchparen.vim | 34 | ||||
-rw-r--r-- | runtime/plugin/rrhelper.vim | 48 |
4 files changed, 31 insertions, 82 deletions
diff --git a/runtime/plugin/README.txt b/runtime/plugin/README.txt deleted file mode 100644 index 37e22e57c0..0000000000 --- a/runtime/plugin/README.txt +++ /dev/null @@ -1,19 +0,0 @@ -The plugin directory is for standard Vim plugin scripts. - -All files here ending in .vim will be sourced by Vim when it starts up. -Look in the file for hints on how it can be disabled without deleting it. - -getscriptPlugin.vim get latest version of Vim scripts -gzip.vim edit compressed files -matchparen.vim highlight paren matching the one under the cursor -netrwPlugin.vim edit files over a network and browse (remote) directories -rrhelper.vim used for --remote-wait editing -spellfile.vim download a spellfile when it's missing -tarPlugin.vim edit (compressed) tar files -tohtml.vim convert a file with syntax highlighting to HTML -vimballPlugin.vim create and unpack .vba files -zipPlugin.vim edit zip archives - -Note: the explorer.vim plugin is no longer here, the netrw.vim plugin has -taken over browsing directories (also for remote directories). - diff --git a/runtime/plugin/matchit.vim b/runtime/plugin/matchit.vim index e3171e5cbb..c160522f90 100644 --- a/runtime/plugin/matchit.vim +++ b/runtime/plugin/matchit.vim @@ -1,5 +1,5 @@ " matchit.vim: (global plugin) Extended "%" matching -" Last Change: 2017 Sep 15 +" Last Change: 2018 Jul 3 by Christian Brabandt " Maintainer: Benji Fisher PhD <benji@member.AMS.org> " Version: 1.13.3, for Vim 6.3+ " Fix from Tommy Allen included. @@ -268,7 +268,7 @@ function! s:Match_wrapper(word, forward, mode) range " execute "normal!" . curcol . "l" " endif if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on")) - let skip = "0" + let skip = '0' else execute "if " . skip . "| let skip = '0' | endif" endif @@ -708,10 +708,16 @@ fun! s:MultiMatch(spflag, mode) let openpat = substitute(openpat, ',', '\\|', 'g') let closepat = substitute(close, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g') let closepat = substitute(closepat, ',', '\\|', 'g') + if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on")) let skip = '0' else - execute "if " . skip . "| let skip = '0' | endif" + try + execute "if " . skip . "| let skip = '0' | endif" + catch /^Vim\%((\a\+)\)\=:E363/ + " We won't find anything, so skip searching, should keep Vim responsive. + return {} + endtry endif mark ' let level = v:count1 diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index 23d4beea87..65b9fe57bf 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -1,6 +1,6 @@ " Vim plugin for showing matching parens " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2018 Jun 23 +" Last Change: 2018 Jul 3 " Exit quickly when: " - this plugin was already loaded (or disabled) @@ -103,18 +103,28 @@ function! s:Highlight_Matching_Pair() call cursor(c_lnum, c_col - before) endif - " Build an expression that detects whether the current cursor position is in - " certain syntax types (string, comment, etc.), for use as searchpairpos()'s - " skip argument. - " We match "escape" for special items, such as lispEscapeSpecial. - let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . + if !has("syntax") || !exists("g:syntax_on") + let s_skip = "0" + else + " Build an expression that detects whether the current cursor position is + " in certain syntax types (string, comment, etc.), for use as + " searchpairpos()'s skip argument. + " We match "escape" for special items, such as lispEscapeSpecial. + let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . \ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))' - " If executing the expression determines that the cursor is currently in - " one of the syntax types, then we want searchpairpos() to find the pair - " within those syntax types (i.e., not skip). Otherwise, the cursor is - " outside of the syntax types and s_skip should keep its value so we skip any - " matching pair inside the syntax types. - execute 'if' s_skip '| let s_skip = 0 | endif' + " If executing the expression determines that the cursor is currently in + " one of the syntax types, then we want searchpairpos() to find the pair + " within those syntax types (i.e., not skip). Otherwise, the cursor is + " outside of the syntax types and s_skip should keep its value so we skip + " any matching pair inside the syntax types. + " Catch if this throws E363: pattern uses more memory than 'maxmempattern'. + try + execute 'if ' . s_skip . ' | let s_skip = "0" | endif' + catch /^Vim\%((\a\+)\)\=:E363/ + " We won't find anything, so skip searching, should keep Vim responsive. + return + endtry + endif " Limit the search to lines visible in the window. let stoplinebottom = line('w$') diff --git a/runtime/plugin/rrhelper.vim b/runtime/plugin/rrhelper.vim deleted file mode 100644 index b09cbc10b9..0000000000 --- a/runtime/plugin/rrhelper.vim +++ /dev/null @@ -1,48 +0,0 @@ -" Vim plugin with helper function(s) for --remote-wait -" Maintainer: Flemming Madsen <fma@cci.dk> -" Last Change: 2008 May 29 - -" Has this already been loaded? -if exists("loaded_rrhelper") || !has("clientserver") - finish -endif -let loaded_rrhelper = 1 - -" Setup answers for a --remote-wait client who will assume -" a SetupRemoteReplies() function in the command server - -function SetupRemoteReplies() - let cnt = 0 - let max = argc() - - let id = expand("<client>") - 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 - -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 : |