diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-05-01 14:08:19 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-05-01 14:08:19 +0200 |
commit | bcb9898eba8c7dd7ed9a909c7055b2ab49cd8f6c (patch) | |
tree | 7d95c6873ee62f9afeb7300f4d66b890b7ba9c19 | |
parent | b96c69d80e626f1f06ed8646c679968af1a1d923 (diff) | |
download | vim-bcb9898eba8c7dd7ed9a909c7055b2ab49cd8f6c.zip |
Runtime file updates.
-rw-r--r-- | runtime/doc/digraph.txt | 4 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 25 | ||||
-rw-r--r-- | runtime/doc/indent.txt | 15 | ||||
-rw-r--r-- | runtime/doc/options.txt | 6 | ||||
-rw-r--r-- | runtime/doc/tags | 8 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 52 | ||||
-rw-r--r-- | runtime/indent/php.vim | 113 | ||||
-rw-r--r-- | runtime/syntax/dnsmasq.vim | 10 |
8 files changed, 163 insertions, 70 deletions
diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt index be94b370e..cb9cd48ef 100644 --- a/runtime/doc/digraph.txt +++ b/runtime/doc/digraph.txt @@ -1,4 +1,4 @@ -*digraph.txt* For Vim version 7.4. Last change: 2013 Dec 12 +*digraph.txt* For Vim version 7.4. Last change: 2014 Apr 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1077,7 +1077,7 @@ char digraph hex dec official name ~ ⊥ -T 22A5 8869 UP TACK ⋅ .P 22C5 8901 DOT OPERATOR ⋮ :3 22EE 8942 VERTICAL ELLIPSIS -⋯ .3 22EF 8943 MIDLINE HORIZONTAL ELLIPSIS +⋯ .3 22EF 8943 MIDLINE HORIZONTAL ELLIPSIS ⌂ Eh 2302 8962 HOUSE ⌈ <7 2308 8968 LEFT CEILING ⌉ >7 2309 8969 RIGHT CEILING diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index fb6bc1fb9..a3dd518ec 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.4. Last change: 2014 Apr 06 +*eval.txt* For Vim version 7.4. Last change: 2014 Apr 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2735,7 +2735,8 @@ exists({expr}) The result is a Number, which is non-zero if {expr} is string) *funcname built-in function (see |functions|) or user defined function (see - |user-functions|). + |user-functions|). Also works for a + variable that is a Funcref. varname internal variable (see |internal-variables|). Also works for |curly-braces-names|, |Dictionary| @@ -6464,10 +6465,11 @@ There are three types of features: included. 4. Beyond a certain version or at a certain version and including a specific - patch. The "patch-7.4.123" feature means that the Vim version is 7.5 or - later, or it is version 7.4 and patch 123 was included. - The example above can be simplified to: > - :if has("patch-6.2.148") + patch. The "patch-7.4.237" feature means that the Vim version is 7.5 or + later, or it is version 7.4 and patch 237 was included. + Note that this only works for patch 7.4.237 and later, before that you + need to use the example above that checks v:version. Example: > + :if has("patch-7.4.248") < Note that it's possible for patch 147 to be omitted even though 148 is included. @@ -6690,6 +6692,8 @@ can only be called from within the script and from functions, user commands and autocommands defined in the script. It is also possible to call the function from a mapping defined in the script, but then |<SID>| must be used instead of "s:" when the mapping is expanded outside of the script. +There are only script-local functions, no buffer-local or window-local +functions. *:fu* *:function* *E128* *E129* *E123* :fu[nction] List all functions and their arguments. @@ -6713,12 +6717,15 @@ last defined. Example: > < See |:verbose-cmd| for more information. - *E124* *E125* *E853* + *E124* *E125* *E853* *E884* :fu[nction][!] {name}([arguments]) [range] [abort] [dict] Define a new function by the name {name}. The name must be made of alphanumeric characters and '_', and - must start with a capital or "s:" (see above). When - using a capital "g:" be prepended. + must start with a capital or "s:" (see above). Note + that using "b:" or "g:" is not allowed. (since patch + 7.4.260 E884 is given if the function name has a colon + in the name, e.g. for "foo:bar()". Before that patch + no error was given). {name} can also be a |Dictionary| entry that is a |Funcref|: > diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index 5bf60894d..fc16b1a7e 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -1,4 +1,4 @@ -*indent.txt* For Vim version 7.4. Last change: 2013 Nov 05 +*indent.txt* For Vim version 7.4. Last change: 2014 Apr 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -812,7 +812,7 @@ OPTIONS: ~ PHP indenting can be altered in several ways by modifying the values of some global variables: - *php-comment* + *php-comment* *PHP_autoformatcomment* To not enable auto-formating of comments by default (if you want to use your own 'formatoptions'): > :let g:PHP_autoformatcomment = 0 @@ -821,6 +821,7 @@ Else, 't' will be removed from the 'formatoptions' string and "qrowcb" will be added, see |fo-table| for more information. ------------- + *PHP_outdentSLComments* To add extra indentation to single-line comments: > :let g:PHP_outdentSLComments = N @@ -832,6 +833,7 @@ Only single-line comments will be affected such as: > /* Comment */ ------------- + *PHP_default_indenting* To add extra indentation to every PHP lines with N being the number of 'shiftwidth' to add: > :let g:PHP_default_indenting = N @@ -851,14 +853,18 @@ For example, with N = 1, this will give: (Notice the extra indentation between the PHP container markers and the code) ------------- -To indent PHP tags as the surrounding code: > - :let g:PHP_outdentphpescape = 0 + *PHP_outdentphpescape* +To indent PHP escape tags as the surrounding non-PHP code (only affects the +PHP escape tags): > +:let g:PHP_outdentphpescape = 0 ------------- + *PHP_removeCRwhenUnix* To automatically remove '\r' characters when the 'fileformat' is set to Unix: > :let g:PHP_removeCRwhenUnix = 1 ------------- + *PHP_BracesAtCodeLevel* To indent braces at the same level than the code they contain: > :let g:PHP_BracesAtCodeLevel = 1 @@ -877,6 +883,7 @@ NOTE: Indenting will be a bit slower if this option is used because some optimizations won't be available. ------------- + *PHP_vintage_case_default_indent* To indent 'case:' and 'default:' statements in switch() blocks: > :let g:PHP_vintage_case_default_indent = 1 diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index dc33b8ae7..8b2ee6d44 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.4. Last change: 2014 Mar 23 +*options.txt* For Vim version 7.4. Last change: 2014 Apr 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -6619,6 +6619,10 @@ A jump table for the options with a short description can be found at |Q_op|. top of the suggestion list with the internal methods. Lines without a slash are ignored, use this for comments. + The word in the second column must be correct, + otherwise it will not be used. Add the word to an + ".add" file if it is currently flagged as a spelling + mistake. The file is used for all languages. expr:{expr} Evaluate expression {expr}. Use a function to avoid diff --git a/runtime/doc/tags b/runtime/doc/tags index 79d32320b..9b9552e33 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -4312,6 +4312,7 @@ E880 if_pyth.txt /*E880* E881 autocmd.txt /*E881* E882 eval.txt /*E882* E883 eval.txt /*E883* +E884 eval.txt /*E884* E89 message.txt /*E89* E90 message.txt /*E90* E91 options.txt /*E91* @@ -4441,6 +4442,13 @@ Operator-pending-mode intro.txt /*Operator-pending-mode* OverTheSpot mbyte.txt /*OverTheSpot* P change.txt /*P* PATHEXT eval.txt /*PATHEXT* +PHP_BracesAtCodeLevel indent.txt /*PHP_BracesAtCodeLevel* +PHP_autoformatcomment indent.txt /*PHP_autoformatcomment* +PHP_default_indenting indent.txt /*PHP_default_indenting* +PHP_outdentSLComments indent.txt /*PHP_outdentSLComments* +PHP_outdentphpescape indent.txt /*PHP_outdentphpescape* +PHP_removeCRwhenUnix indent.txt /*PHP_removeCRwhenUnix* +PHP_vintage_case_default_indent indent.txt /*PHP_vintage_case_default_indent* Pattern pattern.txt /*Pattern* Perl if_perl.txt /*Perl* Posix intro.txt /*Posix* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index b44f528f3..0587c0fcf 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.4. Last change: 2014 Apr 05 +*todo.txt* For Vim version 7.4. Last change: 2014 Apr 30 VIM REFERENCE MANUAL by Bram Moolenaar @@ -35,8 +35,6 @@ not be repeated below, unless there is extra information. -------------------- Known bugs and current work ----------------------- Regexp problems: -- Crash when using cpp syntax file with raw string. (Havard Garnes) - Edit "~/tmp/test.cc" and source "~/tmp/cpp.vim". - NFA regexp doesn't count tab matches correctly. (Urtica Dioica / gaultheria Shallon, 2013 Nov 18) - After patch 7.4.100 there is still a difference between NFA and old engine. @@ -53,40 +51,31 @@ Regexp problems: - Bug with back references. (Lech Lorens, 2014 Feb 3) - Bug when using \>. (Ramel, 2014 Feb 2) (Aaron Bohannon, 2014 Feb 13) +Update for documentation of 'ttymouse' option. (Hayaki Saito, 2014 Apr 30) +Typo: s/support/supports/ + Problem that a previous silent ":throw" causes a following try/catch not to work. (ZyX, 2013 Sep 28) ":cd C:\Windows\System32\drivers\etc*" does not work, even though the directory exists. (Sergio Gallelli, 2013 Dec 29) -It is possible to define a function with a colon in the name. -"g:" is not recognized as it should. (zyx, 2014 Mar 16) -Do some plugins use names with a colon? Disallow it, but ignore the error -when an option is set? - -":lunmap" cannot be abbrevated to ":lu". (ZyX) +Patch to fix positioning in tabs. (Nobuhiro Takasaki, 2014 Apr 25) +New way to reproduce it: 2014 Apr 29 Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15) Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) -Crash in setqflist(). (Benoit Mortgat, 2010 Nov 18) - MS-Windows: Crash opening very long file name starting with "\\". (Christian Brock, 2012 Jun 29) -Crash in autocmd that unloads buffers in a BufUnload event. (Andrew Pimlott, -2012 Aug 11) Disallow :new when BufUnload is being handled? - -Spell files use a latin single quote. Unicode also has another single quote. -Adjust spell file scripts to duplicate words to support both quotes. -(Ron Aaron, 2014 Apr 4) +Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21) -Problem with 'spellsuggest' file, only works for some words. -(Cesar Romani, 2013 Aug 20) Depends on file name? (Aug 24) -Additional remark by glts: the suggested words are marked bad? +Inconsistant error messages when comparing dict and when comparing list. +(ZyX, 2014 Apr 19) -Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21) +Add #ifdef around struct members not used by GTK. (Cade Forester, 2014 Apr 10) Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19) @@ -95,6 +84,8 @@ Feb 24) Add digraph for Rouble: =P. What's the Unicode? +Include .hgignore in the distribution, so that patches for it work. + Issue 174: Detect Mason files. No error for missing endwhile. (ZyX, 2014 Mar 20) @@ -103,6 +94,14 @@ Phpcomplete.vim update. (Complex, 2014 Jan 15) PHP syntax is extremely slow. (Anhad Jai Singh, 2014 Jan 19) +After setting 'spellfile' the screen is not redrawn. (issue 221) +Patch from Christian Brabandt on the issu. + +Spell files use a latin single quote. Unicode also has another single quote: +0x2019. (Ron Aaron, 2014 Apr 4) +New OpenOffice spell files support this with ICONV. But they are not +compatible with Vim spell files. The old files can no longer be downloaded. + Win32: use different args for SearchPath()? (Yasuhiro Matsumoto, 2009 Jan 30) Also fixes wrong result from executable(). Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3. @@ -110,6 +109,9 @@ Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3. Can we make ":unlet $VAR" use unsetenv() to delete the env var? What for systems that don't have unsetenv()? +Patch for problem that v:register is set to '_' after deleting into the black +hole register. + This does not give an error: (Andre Sihera, 2014 Mar 21) vim -u NONE 1 2 3 -c 'bufdo if 1 | echo 1' This neither: (ZyX) @@ -119,6 +121,9 @@ This neither: (ZyX) Change 'viewdir' to "$HOME/vimfiles/view" and use 'viewdiralt' to also read from? +Patch to add arglistid(), get the ID of the currently used argument list. +(Marcin Szamotulski, 2014 Apr 27) + Include a plugin manager with Vim? Neobundle seems to be the best currently. Long message about this from ZyX, 2014 Mar 23. And following replies. Also see http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html @@ -156,6 +161,9 @@ Out of scope: Setting the spell file in a session only reads the local additions, not the normal spell file. (Enno Nagel, 2014 Mar 29) +When typing the first character of a command, e.g. "f", then using a menu, the +menu item doesn't work. Clear typeahead when using a menu? + Editing an ascii file as ucs-2 or ucs-4 causes display errors. (ZyX, 2014 Mar 30) @@ -1154,6 +1162,7 @@ is executed. ":pedit %" with a BufReadPre autocommand causes the cursor to move to the first line. (Ingo Karkat, 2008 Jul 1) Ian Kelling is working on this. +Similar problem with ":e". (Marc Montu, 2014 Apr 22) Wildmenu not deleted: "gvim -u NONE", ":set nocp wildmenu cmdheight=3 laststatus=2", CTRL-D CTRL-H CTRL-H CTRL-H. (A.Politz, 2008 April 1) @@ -1501,6 +1510,7 @@ Engelke, 2007 Dec 20 - 2008 Jan 17) Win64: Seek error in swap file for a very big file (3 Gbyte). Check storing pointer in long and seek offset in 64 bit var. +Patches from Ken Takata might help (2014 Apr 17) Win32: patch for fullscreen mode. (Liushaolin, 2008 April 17) diff --git a/runtime/indent/php.vim b/runtime/indent/php.vim index fd1866430..b83a1923e 100644 --- a/runtime/indent/php.vim +++ b/runtime/indent/php.vim @@ -3,8 +3,8 @@ " Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr> " URL: http://www.2072productions.com/vim/indent/php.vim " Home: https://github.com/2072/PHP-Indenting-for-VIm -" Last Change: 2014 Jan 21 -" Version: 1.39 +" Last Change: 2014 April 3rd +" Version: 1.49 " " " Type :help php-indent for available options @@ -39,7 +39,8 @@ " " or simply 'let' the option PHP_removeCRwhenUnix to 1 and the script will " silently remove them when VIM load this script (at each bufread). -" + + if exists("b:did_indent") finish @@ -126,14 +127,26 @@ if exists("*GetPhpIndent") finish " XXX -- comment this line for easy dev endif + +let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)' +let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|\%(}\s*\)\?else\>\|do\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|trait\>\|use\>\|interface\>\|abstract\>\|final\>\|try\>\|\%(}\s*\)\=catch\>\|\%(}\s*\)\=finally\>\)' +let s:functionDecl = '\<function\>\%(\s\+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\)\=\s*(.*' let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$' +let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<''\=\a\w*''\=$\|^\s*}\)'.s:endline.'\)\|^[^''"`]*[''"`]$' let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!' + +let s:escapeDebugStops = 0 function! DebugPrintReturn(scriptLine) - echo "debug:" . a:scriptLine - call getchar() + if ! s:escapeDebugStops + echo "debug:" . a:scriptLine + let c = getchar() + if c == "\<Del>" + let s:escapeDebugStops = 1 + end + endif endfunction @@ -190,6 +203,11 @@ function! GetLastRealCodeLNum(startline) " {{{ while getline(lnum) !~? tofind && lnum > 1 let lnum = lnum - 1 endwhile + elseif lastline =~ '^[^''"`]*[''"`][;,]'.s:endline + let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$', '') + while getline(lnum) !~? tofind && lnum > 1 + let lnum = lnum - 1 + endwhile else break endif @@ -211,9 +229,9 @@ function! Skippmatch2() let line = getline(".") if line =~ "\\([\"']\\).*/\\*.*\\1" || line =~ '\%(//\|#\).*/\*' - return 1 + return 1 else - return 0 + return 0 endif endfun @@ -226,9 +244,23 @@ function! Skippmatch() " {{{ endif endfun " }}} -function! FindOpenBracket(lnum) " {{{ +function! FindOpenBracket(lnum, blockStarter) " {{{ call cursor(a:lnum, 1) - return searchpair('{', '', '}', 'bW', 'Skippmatch()') + let line = searchpair('{', '', '}', 'bW', 'Skippmatch()') + + if a:blockStarter == 1 + while line > 1 + let linec = getline(line) + + if linec =~ s:terminated || linec =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline + break + endif + + let line = GetLastRealCodeLNum(line - 1) + endwhile + endif + + return line endfun " }}} function! FindTheIfOfAnElse (lnum, StopAfterFirstPrevElse) " {{{ @@ -248,7 +280,7 @@ function! FindTheIfOfAnElse (lnum, StopAfterFirstPrevElse) " {{{ endif if getline(beforeelse) =~ '^\s*}' - let beforeelse = FindOpenBracket(beforeelse) + let beforeelse = FindOpenBracket(beforeelse, 0) if getline(beforeelse) =~ '^\s*{' let beforeelse = GetLastRealCodeLNum(beforeelse - 1) @@ -285,13 +317,13 @@ function! FindTheSwitchIndent (lnum) " {{{ return indent(1) - &sw * b:PHP_vintage_case_default_indent end - if getline(test) =~ '^\s*}' - let test = FindOpenBracket(test) + while getline(test) =~ '^\s*}' && test > 1 + let test = GetLastRealCodeLNum(FindOpenBracket(test, 0) - 1) - if getline(test) =~ '^\s*{' - let test = GetLastRealCodeLNum(GetLastRealCodeLNum(test - 1) - 1) + if getline(test) =~ '^\s*switch\>' + let test = GetLastRealCodeLNum(test - 1) endif - endif + endwhile if getline(test) =~# '^\s*switch\>' return indent(test) @@ -308,7 +340,7 @@ function! IslinePHP (lnum, tofind) " {{{ let cline = getline(a:lnum) if a:tofind=="" - let tofind = "^\\s*[\"']*\\s*\\zs\\S" + let tofind = "^\\s*[\"'`]*\\s*\\zs\\S" else let tofind = a:tofind endif @@ -319,6 +351,14 @@ function! IslinePHP (lnum, tofind) " {{{ let synname = synIDattr(synID(a:lnum, coltotest, 0), "name") + if synname == 'phpStringSingle' || synname == 'phpStringDouble' || synname == 'phpBacktick' + if cline !~ '^\s*[''"`]' + return "" + else + return synname + end + end + if get(s:SynPHPMatchGroups, synname) || synname =~ '^php' || synname =~? '^javaScript' return synname else @@ -326,9 +366,6 @@ function! IslinePHP (lnum, tofind) " {{{ endif endfunction " }}} -let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)' -let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|else\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|interface\>\|abstract\>\|try\>\|catch\>\)' - let s:autoresetoptions = 0 if ! s:autoresetoptions let s:autoresetoptions = 1 @@ -344,7 +381,6 @@ function! ResetPhpOptions() setlocal formatoptions+=q setlocal formatoptions+=r setlocal formatoptions+=o - setlocal formatoptions+=w setlocal formatoptions+=c setlocal formatoptions+=b endif @@ -443,6 +479,7 @@ function! GetPhpIndent() " Test if we are indenting PHP code {{{ let lnum = prevnonblank(v:lnum - 1) let last_line = getline(lnum) + let endline= s:endline if b:InPHPcode_tofind!="" if cline =~? b:InPHPcode_tofind @@ -483,6 +520,9 @@ function! GetPhpIndent() let b:InPHPcode_and_script = 1 endif + elseif last_line =~ '^[^''"`]\+[''"`]$' " a string identifier with nothing after it and no other string identifier before + let b:InPHPcode = 0 + let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '') elseif last_line =~? '<<<''\=\a\w*''\=$' let b:InPHPcode = 0 let b:InPHPcode_tofind = substitute( last_line, '^.*<<<''\=\(\a\w*\)''\=$', '^\\s*\1;\\=$', '') @@ -545,7 +585,7 @@ function! GetPhpIndent() return 0 endif - if cline =~? '^\s*\a\w*;$\|^\a\w*$' && cline !~? s:notPhpHereDoc + if cline =~? '^\s*\a\w*;$\|^\a\w*$\|^\s*[''"`][;,]' && cline !~? s:notPhpHereDoc return 0 endif " }}} @@ -555,7 +595,6 @@ function! GetPhpIndent() let last_line = getline(lnum) let ind = indent(lnum) - let endline= s:endline if ind==0 && b:PHP_default_indenting let ind = b:PHP_default_indenting @@ -567,7 +606,7 @@ function! GetPhpIndent() if cline =~ '^\s*}\%(}}\)\@!' - let ind = indent(FindOpenBracket(v:lnum)) + let ind = indent(FindOpenBracket(v:lnum, 1)) let b:PHP_CurrentIndentLevel = b:PHP_default_indenting return ind endif @@ -599,7 +638,7 @@ function! GetPhpIndent() let LastLineClosed = 0 - let terminated = '\%(;\%(\s*\%(?>\|}\)\)\=\|<<<''\=\a\w*''\=$\|^\s*}\)'.endline + let terminated = s:terminated let unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.endline @@ -614,7 +653,7 @@ function! GetPhpIndent() while last_line_num > 1 - if previous_line =~ '^\s*\%(' . s:blockstart . '\|\%([a-zA-Z]\s*\)*function\)' + if previous_line =~ terminated || previous_line =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . endline let ind = indent(last_line_num) @@ -625,7 +664,7 @@ function! GetPhpIndent() return ind endif - let last_line_num = last_line_num - 1 + let last_line_num = GetLastRealCodeLNum(last_line_num - 1) let previous_line = getline(last_line_num) endwhile @@ -638,22 +677,29 @@ function! GetPhpIndent() let last_line_num = lnum let LastLineClosed = 1 + let isSingleLineBlock = 0 while 1 - if previous_line =~ '^\s*}\|;\s*}'.endline " XXX + if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline " XXX call cursor(last_line_num, 1) - call search('}\|;\s*}'.endline, 'cW') + if previous_line !~ '^}' + call search('}\|;\s*}'.endline, 'W') + end let oldLastLine = last_line_num let last_line_num = searchpair('{', '', '}', 'bW', 'Skippmatch()') - if oldLastLine == last_line_num || getline(last_line_num) =~ '^\s*{' + if getline(last_line_num) =~ '^\s*{' let last_line_num = GetLastRealCodeLNum(last_line_num - 1) + elseif oldLastLine == last_line_num + let isSingleLineBlock = 1 + continue endif let previous_line = getline(last_line_num) continue else + let isSingleLineBlock = 0 if getline(last_line_num) =~# '^\s*else\%(if\)\=\>' let last_line_num = FindTheIfOfAnElse(last_line_num, 0) @@ -711,7 +757,12 @@ function! GetPhpIndent() if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(]'.endline - if !b:PHP_BracesAtCodeLevel || last_line !~# '^\s*{' + let dontIndent = 0 + if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline + let dontIndent = 1 + endif + + if !dontIndent && (!b:PHP_BracesAtCodeLevel || last_line !~# '^\s*{') let ind = ind + &sw endif @@ -723,7 +774,7 @@ function! GetPhpIndent() elseif last_line =~ '\S\+\s*),'.endline call cursor(lnum, 1) - call search('),'.endline, 'W') + call search('),'.endline, 'W') " line never begins with ) so no need for 'c' flag let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()') if openedparent != lnum let ind = indent(openedparent) diff --git a/runtime/syntax/dnsmasq.vim b/runtime/syntax/dnsmasq.vim index 7ef767d39..2a31aed77 100644 --- a/runtime/syntax/dnsmasq.vim +++ b/runtime/syntax/dnsmasq.vim @@ -4,8 +4,8 @@ " :3s+-foo++g " Description: highlight dnsmasq configuration files " File: runtime/syntax/dnsmasq.vim -" Version: 2.67 -" Last Change: 2013 Nov 03 +" Version: 2.70 +" Last Change: 2014 Apr 30 " Modeline: vim: ts=8:sw=2:sts=2: " " License: VIM License @@ -132,6 +132,9 @@ syn match DnsmasqKeyword "^\s*dhcp-subscrid\>" syn match DnsmasqKeyword "^\s*dhcp-userclass\>" syn match DnsmasqKeyword "^\s*dhcp-vendorclass\>" syn match DnsmasqKeyword "^\s*dns-rr\>" +syn match DnsmasqKeyword "^\s*dnssec\>" +syn match DnsmasqKeyword "^\s*dnssec-check-unsigned\>" +syn match DnsmasqKeyword "^\s*dnssec-no-timecheck\>" syn match DnsmasqKeyword "^\s*dns-forward-max\>" syn match DnsmasqKeyword "^\s*domain\>" syn match DnsmasqKeyword "^\s*domain-needed\>" @@ -153,6 +156,7 @@ syn match DnsmasqKeyword "^\s*listen-address\>" syn match DnsmasqKeyword "^\s*local\>" syn match DnsmasqKeyword "^\s*localmx\>" syn match DnsmasqKeyword "^\s*local-ttl\>" +syn match DnsmasqKeyword "^\s*local-service\>" syn match DnsmasqKeyword "^\s*localise-queries\>" syn match DnsmasqKeyword "^\s*log-async\>" syn match DnsmasqKeyword "^\s*log-dhcp\>" @@ -187,8 +191,10 @@ syn match DnsmasqKeyword "^\s*read-ethers\>" syn match DnsmasqKeyword "^\s*rebind-domain-ok\>" syn match DnsmasqKeyword "^\s*rebind-localhost-ok\>" syn match DnsmasqKeyword "^\s*resolv-file\>" +syn match DnsmasqKeyword "^\s*rev-server\>" syn match DnsmasqKeyword "^\s*selfmx\>" syn match DnsmasqKeyword "^\s*server\>" +syn match DnsmasqKeyword "^\s*servers-file\>" syn match DnsmasqKeyword "^\s*srv-host\>" syn match DnsmasqKeyword "^\s*stop-dns-rebind\>" syn match DnsmasqKeyword "^\s*strict-order\>" |