From 25a6e8a769aa1c0d308b5f871132961f37986d0a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 30 Mar 2018 12:27:32 +0200 Subject: [PATCH 01/26] Small runtime update --- runtime/doc/todo.txt | 3 + runtime/syntax/forth.vim | 142 ++++++++++--------------------------- runtime/syntax/haskell.vim | 16 ++--- 3 files changed, 48 insertions(+), 113 deletions(-) diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index e6622af96a..f9fa06b42e 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -107,6 +107,9 @@ Brabandt, #2743) Cursor in wrong position when line wraps. (#2540) +Add an option similar to 'lazyredraw' to skip redrawing while executing a +script or function. + Alternative manpager.vim. (Enno, 2018 Jan 5, #2529) Patch to add more flags to :ls. (Marcin Szamotulski, #2751) diff --git a/runtime/syntax/forth.vim b/runtime/syntax/forth.vim index 35fafd4349..a1912461e6 100644 --- a/runtime/syntax/forth.vim +++ b/runtime/syntax/forth.vim @@ -1,84 +1,10 @@ " Vim syntax file " Language: FORTH -" Maintainer: Christian V. J. Brüssow -" Last Change: So 27 Mai 2012 15:56:28 CEST +" Current Maintainer: Johan Kotlinski +" Previous Maintainer: Christian V. J. Brüssow +" Last Change: 2018-03-29 " Filenames: *.fs,*.ft -" URL: http://www.cvjb.de/comp/vim/forth.vim - -" $Id: forth.vim,v 1.14 2012/05/27 15:57:22 bruessow Exp $ - -" The list of keywords is incomplete, compared with the official ANS -" wordlist. If you use this language, please improve it, and send me -" the patches. -" -" Before sending me patches, please download the newest version of this file -" from http://www.cvjb.de/comp/vim/forth.vim or http://www.vim.org/ (search -" for forth.vim). - -" Many Thanks to... -" -" 2012-05-13: -" Dominique Pellé for sending the -" patch to allow spellchecking of strings, comments, ... -" -" 2012-01-07: -" Thilo Six send a patch for cpoptions. -" See the discussion at http://thread.gmane.org/gmane.editors.vim.devel/32151 -" -" 2009-06-28: -" Josh Grams send a patch to allow the parenthesis comments at the -" beginning of a line. That patch also fixed a typo in one of the -" comments. -" -" 2008-02-09: -" Shawn K. Quinn send a big patch with -" new words commonly used in Forth programs or defined by GNU Forth. -" -" 2007-07-11: -" Benjamin Krill send me a patch -" to highlight space errors. -" You can toggle this feature on through setting the -" flag forth_space_errors in you vimrc. If you have switched it on, -" you can turn off highlighting of trailing spaces in comments by -" setting forth_no_trail_space_error in your vimrc. If you do not want -" the highlighting of a tabulator following a space in comments, you -" can turn this off by setting forth_no_tab_space_error. -" -" 2006-05-25: -" Bill McCarthy and Ilya Sher -" Who found a bug in the ccomment line in 2004!!! -" I'm really very sorry, that it has taken two years to fix that -" in the official version of this file. Shame on me. -" I think my face will be red the next ten years... -" -" 2006-05-21: -" Thomas E. Vaughan send me a patch -" for the parenthesis comment word, so words with a trailing -" parenthesis will not start the highlighting for such comments. -" -" 2003-05-10: -" Andrew Gaul send me a patch for -" forthOperators. -" -" 2003-04-03: -" Ron Aaron made updates for an -" improved Win32Forth support. -" -" 2002-04-22: -" Charles Shattuck helped me to settle up with the -" binary and hex number highlighting. -" -" 2002-04-20: -" Charles Shattuck send me some code for correctly -" highlighting char and [char] followed by an opening paren. He also added -" some words for operators, conditionals, and definitions; and added the -" highlighting for s" and c". -" -" 2000-03-28: -" John Providenza made improvements for the -" highlighting of strings, and added the code for highlighting hex numbers. -" - +" URL: https://github.com/jkotlinski/forth.vim " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -129,7 +55,10 @@ syn keyword forthOperators F~REL F~ABS F~ syn keyword forthOperators 0< 0<= 0<> 0= 0> 0>= < <= <> = > >= U< U<= syn keyword forthOperators U> U>= D0< D0<= D0<> D0= D0> D0>= D< D<= D<> syn keyword forthOperators D= D> D>= DU< DU<= DU> DU>= WITHIN ?NEGATE -syn keyword forthOperators ?DNEGATE +syn keyword forthOperators ?DNEGATE TRUE FALSE + +" various words that take an input and do something with it +syn keyword forthFunction . U. .R U.R " stack manipulations syn keyword forthStack DROP NIP DUP OVER TUCK SWAP ROT -ROT ?DUP PICK ROLL @@ -141,7 +70,7 @@ syn keyword forthRstack 4>R 4R> 4R@ 4RDROP syn keyword forthFStack FDROP FNIP FDUP FOVER FTUCK FSWAP FROT " stack pointer manipulations -syn keyword forthSP SP@ SP! FP@ FP! RP@ RP! LP@ LP! +syn keyword forthSP SP@ SP! FP@ FP! RP@ RP! LP@ LP! DEPTH " address operations syn keyword forthMemory @ ! +! C@ C! 2@ 2! F@ F! SF@ SF! DF@ DF! @@ -150,7 +79,7 @@ syn keyword forthAdrArith FLOAT+ FLOAT FALIGN FALIGNED SFLOATS SFLOAT+ syn keyword forthAdrArith SFALIGN SFALIGNED DFLOATS DFLOAT+ DFALIGN DFALIGNED syn keyword forthAdrArith MAXALIGN MAXALIGNED CFALIGN CFALIGNED syn keyword forthAdrArith ADDRESS-UNIT-BITS ALLOT ALLOCATE HERE -syn keyword forthMemBlks MOVE ERASE CMOVE CMOVE> FILL BLANK +syn keyword forthMemBlks MOVE ERASE CMOVE CMOVE> FILL BLANK UNUSED " conditionals syn keyword forthCond IF ELSE ENDIF THEN CASE OF ENDOF ENDCASE ?DUP-IF @@ -159,7 +88,7 @@ syn keyword forthCond ?DUP-0=-IF AHEAD CS-PICK CS-ROLL CATCH THROW WITHIN " iterations syn keyword forthLoop BEGIN WHILE REPEAT UNTIL AGAIN syn keyword forthLoop ?DO LOOP I J K +DO U+DO -DO U-DO DO +LOOP -LOOP -syn keyword forthLoop UNLOOP LEAVE ?LEAVE EXIT DONE FOR NEXT +syn keyword forthLoop UNLOOP LEAVE ?LEAVE EXIT DONE FOR NEXT RECURSE " new words syn match forthClassDef '\<:class\s*[^ \t]\+\>' @@ -174,8 +103,8 @@ syn keyword forthDefine COMPILE-ONLY COMPILE RESTRICT INTERPRET POSTPONE EXECUTE syn keyword forthDefine LITERAL CREATE-INTERPRET/COMPILE INTERPRETATION> syn keyword forthDefine INT NAME?INT NAME>COMP -syn keyword forthDefine NAME>STRING STATE C; CVARIABLE -syn keyword forthDefine , 2, F, C, +syn keyword forthDefine NAME>STRING STATE C; CVARIABLE BUFFER: MARKER +syn keyword forthDefine , 2, F, C, COMPILE, syn match forthDefine "\[IFDEF]" syn match forthDefine "\[IFUNDEF]" syn match forthDefine "\[THEN]" @@ -196,6 +125,7 @@ syn match forthDefine "'" syn match forthDefine '\<\[\>' syn match forthDefine "\[']" syn match forthDefine '\[COMPILE]' +syn match forthDefine '\[CHAR]' " debugging syn keyword forthDebug PRINTDEBUGDATA PRINTDEBUGLINE @@ -206,7 +136,7 @@ syn keyword forthAssembler ASSEMBLER CODE END-CODE ;CODE FLUSH-ICACHE C, " basic character operations syn keyword forthCharOps (.) CHAR EXPECT FIND WORD TYPE -TRAILING EMIT KEY -syn keyword forthCharOps KEY? TIB CR +syn keyword forthCharOps KEY? TIB CR BL COUNT SPACE SPACES " recognize 'char (' or '[char] (' correctly, so it doesn't " highlight everything after the paren as a comment till a closing ')' syn match forthCharOps '\ #>> #S (NUMBER) (NUMBER?) CONVERT D>F syn keyword forthConversion D>S DIGIT DPL F>D HLD HOLD NUMBER S>D SIGN >NUMBER -syn keyword forthConversion F>S S>F +syn keyword forthConversion F>S S>F HOLDS " interpreter, wordbook, compiler syn keyword forthForth (LOCAL) BYE COLD ABORT >BODY >NEXT >LINK CFA >VIEW HERE syn keyword forthForth PAD WORDS VIEW VIEW> N>LINK NAME> LINK> L>NAME FORGET syn keyword forthForth BODY> ASSERT( ASSERT0( ASSERT1( ASSERT2( ASSERT3( ) +syn keyword forthForth >IN ACCEPT ENVIRONMENT? EVALUATE QUIT SOURCE ACTION-OF +syn keyword forthForth DEFER! DEFER@ PARSE PARSE-NAME REFILL RESTORE-INPUT +syn keyword forthForth SAVE-INPUT SOURCE-ID syn region forthForth start=+ABORT"\s+ skip=+\\"+ end=+"+ " vocabularies @@ -236,16 +169,17 @@ syn keyword forthFileWords KEY?-FILE WRITE-FILE WRITE-LINE EMIT-FILE syn keyword forthFileWords FLUSH-FILE FILE-STATUS FILE-POSITION syn keyword forthFileWords REPOSITION-FILE FILE-SIZE RESIZE-FILE syn keyword forthFileWords SLURP-FILE SLURP-FID STDIN STDOUT STDERR +syn keyword forthFileWords INCLUDE-FILE INCLUDED REQUIRED syn keyword forthBlocks OPEN-BLOCKS USE LOAD --> BLOCK-OFFSET syn keyword forthBlocks GET-BLOCK-FID BLOCK-POSITION LIST SCR BLOCK syn keyword forthBlocks BUFER EMPTY-BUFFERS EMPTY-BUFFER UPDATE UPDATED? syn keyword forthBlocks SAVE-BUFFERS SAVE-BUFFER FLUSH THRU +LOAD +THRU -syn keyword forthBlocks BLOCK-INCLUDED +syn keyword forthBlocks BLOCK-INCLUDED BLK " numbers syn keyword forthMath DECIMAL HEX BASE -syn match forthInteger '\<-\=[0-9.]*[0-9.]\+\>' -syn match forthInteger '\<&-\=[0-9.]*[0-9.]\+\>' +syn match forthInteger '\<-\=[0-9]\+.\=\>' +syn match forthInteger '\<&-\=[0-9]\+.\=\>' " recognize hex and binary numbers, the '$' and '%' notation is for gforth syn match forthInteger '\<\$\x*\x\+\>' " *1* --- dont't mess syn match forthInteger '\<\x*\d\x*\>' " *2* --- this order! @@ -253,28 +187,29 @@ syn match forthInteger '\<%[0-1]*[0-1]\+\>' syn match forthFloat '\<-\=\d*[.]\=\d\+[DdEe]\d\+\>' syn match forthFloat '\<-\=\d*[.]\=\d\+[DdEe][-+]\d\+\>' -" XXX If you find this overkill you can remove it. This has to come after the +" XXX If you find this overkill you can remove it. this has to come after the " highlighting for numbers otherwise it has no effect. syn region forthComment start='0 \[if\]' end='\[endif\]' end='\[then\]' contains=forthTodo " Strings -syn region forthString start=+\.*\"+ end=+"+ end=+$+ contains=@Spell +syn region forthString start=+\.*\"+ end=+"+ end=+$+ " XXX -syn region forthString start=+s\"+ end=+"+ end=+$+ contains=@Spell -syn region forthString start=+c\"+ end=+"+ end=+$+ contains=@Spell +syn region forthString start=+s\"+ end=+"+ end=+$+ +syn region forthString start=+s\\\"+ end=+"+ end=+$+ +syn region forthString start=+c\"+ end=+"+ end=+$+ " Comments -syn match forthComment '\\\s.*$' contains=@Spell,forthTodo,forthSpaceError -syn region forthComment start='\\S\s' end='.*' contains=@Spell,forthTodo,forthSpaceError -syn match forthComment '\.(\s[^)]*)' contains=@Spell,forthTodo,forthSpaceError -syn region forthComment start='\(^\|\s\)\zs(\s' skip='\\)' end=')' contains=@Spell,forthTodo,forthSpaceError -syn region forthComment start='/\*' end='\*/' contains=@Spell,forthTodo,forthSpaceError +syn match forthComment '\\\s.*$' contains=forthTodo,forthSpaceError +syn region forthComment start='\\S\s' end='.*' contains=forthTodo,forthSpaceError +syn match forthComment '\.(\s[^)]*)' contains=forthTodo,forthSpaceError +syn region forthComment start='\(^\|\s\)\zs(\s' skip='\\)' end=')' contains=forthTodo,forthSpaceError +syn region forthComment start='/\*' end='\*/' contains=forthTodo,forthSpaceError " Include files syn match forthInclude '^INCLUDE\s\+\k\+' -syn match forthInclude '^require\s\+\k\+' -syn match forthInclude '^fload\s\+' -syn match forthInclude '^needs\s\+' +syn match forthInclude '^REQUIRE\s\+\k\+' +syn match forthInclude '^FLOAD\s\+' +syn match forthInclude '^NEEDS\s\+' " Locals definitions syn region forthLocals start='{\s' start='{$' end='\s}' end='^}' @@ -282,9 +217,6 @@ syn match forthLocals '{ }' " otherwise, at least two spaces between syn region forthDeprecated start='locals|' end='|' " Define the default highlighting. -" Only when an item doesn't have highlighting yet - -" The default methods for highlighting. Can be overridden later. hi def link forthTodo Todo hi def link forthOperators Operator hi def link forthMath Number @@ -318,11 +250,11 @@ hi def link forthInclude Include hi def link forthLocals Type " nothing else uses type and locals must stand out hi def link forthDeprecated Error " if you must, change to Type hi def link forthFileMode Function +hi def link forthFunction Function hi def link forthFileWords Statement hi def link forthBlocks Statement hi def link forthSpaceError Error - let b:current_syntax = "forth" let &cpo = s:cpo_save diff --git a/runtime/syntax/haskell.vim b/runtime/syntax/haskell.vim index 1adb7ab78d..e5128a12ab 100644 --- a/runtime/syntax/haskell.vim +++ b/runtime/syntax/haskell.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Haskell " Maintainer: Haskell Cafe mailinglist -" Last Change: 2017 Dec 16 +" Last Change: 2018 Mar 29 by Marcin Szamotulski " Original Author: John Williams " " Thanks to Ryan Crumley for suggestions and John Meacham for @@ -38,8 +38,8 @@ if exists("b:current_syntax") endif " (Qualified) identifiers (no default highlighting) -syn match ConId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[A-Z][a-zA-Z0-9_']*\>" -syn match VarId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[a-z][a-zA-Z0-9_']*\>" +syn match ConId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[A-Z][a-zA-Z0-9_']*\>" contains=@NoSpell +syn match VarId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[a-z][a-zA-Z0-9_']*\>" contains=@NoSpell " Infix operators--most punctuation characters and any (qualified) identifier " enclosed in `backquotes`. An operator starting with : is a constructor, @@ -56,7 +56,7 @@ syn match hsDelimiter "(\|)\|\[\|\]\|,\|;\|_\|{\|}" syn match hsSpecialChar contained "\\\([0-9]\+\|o[0-7]\+\|x[0-9a-fA-F]\+\|[\"\\'&\\abfnrtv]\|^[A-Z^_\[\\\]]\)" syn match hsSpecialChar contained "\\\(NUL\|SOH\|STX\|ETX\|EOT\|ENQ\|ACK\|BEL\|BS\|HT\|LF\|VT\|FF\|CR\|SO\|SI\|DLE\|DC1\|DC2\|DC3\|DC4\|NAK\|SYN\|ETB\|CAN\|EM\|SUB\|ESC\|FS\|GS\|RS\|US\|SP\|DEL\)" syn match hsSpecialCharError contained "\\&\|'''\+" -syn region hsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=hsSpecialChar +syn region hsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=hsSpecialChar,@NoSpell syn match hsCharacter "[^a-zA-Z0-9_']'\([^\\]\|\\[^']\+\|\\'\)'"lc=1 contains=hsSpecialChar,hsSpecialCharError syn match hsCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=hsSpecialChar,hsSpecialCharError syn match hsNumber "\v<[0-9]%(_*[0-9])*>|<0[xX]_*[0-9a-fA-F]%(_*[0-9a-fA-F])*>|<0[oO]_*%(_*[0-7])*>|<0[bB]_*[01]%(_*[01])*>" @@ -66,8 +66,8 @@ syn match hsFloat "\v<[0-9]%(_*[0-9])*\.[0-9]%(_*[0-9])*%(_*[eE][-+]?[0-9]%(_ " because otherwise they would match as keywords at the start of a " "literate" comment (see lhs.vim). syn match hsModule "\" -syn match hsImport "\.*"he=s+6 contains=hsImportMod,hsLineComment,hsBlockComment -syn match hsImportMod contained "\<\(as\|qualified\|hiding\)\>" +syn match hsImport "\.*"he=s+6 contains=hsImportMod,hsLineComment,hsBlockComment,@NoSpell +syn match hsImportMod contained "\<\(as\|qualified\|hiding\)\>" contains=@NoSpell syn match hsInfix "\<\(infix\|infixl\|infixr\)\>" syn match hsStructure "\<\(class\|data\|deriving\|instance\|default\|where\)\>" syn match hsTypedef "\<\(type\|newtype\)\>" @@ -97,8 +97,8 @@ endif " Comments -syn match hsLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" -syn region hsBlockComment start="{-" end="-}" contains=hsBlockComment +syn match hsLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=@Spell +syn region hsBlockComment start="{-" end="-}" contains=hsBlockComment,@Spell syn region hsPragma start="{-#" end="#-}" " C Preprocessor directives. Shamelessly ripped from c.vim and trimmed From 8b31a6ff7a0a8184ddc9997a0cc4aa5f2350b279 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 3 Apr 2018 12:17:25 +0200 Subject: [PATCH 02/26] patch 8.0.1656: no option to have xxd produce upper case variable names Problem: No option to have xxd produce upper case variable names. Solution: Add the -C argument. (Matt Panaro closes #2772) --- src/version.c | 2 ++ src/xxd/xxd.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/version.c b/src/version.c index 8403bf4ae2..1c2d802d0b 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1656, /**/ 1655, /**/ diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c index f89f4d3b03..bbd9c08a37 100644 --- a/src/xxd/xxd.c +++ b/src/xxd/xxd.c @@ -215,6 +215,8 @@ char hexxa[] = "0123456789abcdef0123456789ABCDEF", *hexx = hexxa; #define HEX_BITS 3 /* not hex a dump, but bits: 01111001 */ #define HEX_LITTLEENDIAN 4 +#define CONDITIONAL_CAPITALIZE(c) (capitalize ? toupper((int)c) : c) + static char *pname; static void @@ -225,6 +227,7 @@ exit_with_usage(void) fprintf(stderr, "Options:\n"); fprintf(stderr, " -a toggle autoskip: A single '*' replaces nul-lines. Default off.\n"); fprintf(stderr, " -b binary digit dump (incompatible with -ps,-i,-r). Default hex.\n"); + fprintf(stderr, " -C capitalize variable names in C include file style (-i).\n"); fprintf(stderr, " -c cols format octets per line. Default 16 (-i: 12, -ps: 30).\n"); fprintf(stderr, " -E show characters in EBCDIC. Default ASCII.\n"); fprintf(stderr, " -e little-endian dump (incompatible with -ps,-i,-r).\n"); @@ -459,7 +462,7 @@ main(int argc, char *argv[]) { FILE *fp, *fpo; int c, e, p = 0, relseek = 1, negseek = 0, revert = 0; - int cols = 0, nonzero = 0, autoskip = 0, hextype = HEX_NORMAL; + int cols = 0, nonzero = 0, autoskip = 0, hextype = HEX_NORMAL, capitalize = 0; int ebcdic = 0; int octspergrp = -1; /* number of octets grouped in output */ int grplen; /* total chars per octet group */ @@ -495,6 +498,7 @@ main(int argc, char *argv[]) else if (!STRNCMP(pp, "-u", 2)) hexx = hexxa + 16; else if (!STRNCMP(pp, "-p", 2)) hextype = HEX_POSTSCRIPT; else if (!STRNCMP(pp, "-i", 2)) hextype = HEX_CINCLUDE; + else if (!STRNCMP(pp, "-C", 2)) capitalize = 1; else if (!STRNCMP(pp, "-r", 2)) revert++; else if (!STRNCMP(pp, "-E", 2)) ebcdic++; else if (!STRNCMP(pp, "-v", 2)) @@ -722,7 +726,7 @@ main(int argc, char *argv[]) if (fprintf(fpo, "unsigned char %s", isdigit((int)argv[1][0]) ? "__" : "") < 0) die(3); for (e = 0; (c = argv[1][e]) != 0; e++) - if (putc(isalnum(c) ? c : '_', fpo) == EOF) + if (putc(isalnum(c) ? CONDITIONAL_CAPITALIZE(c) : '_', fpo) == EOF) die(3); if (fputs("[] = {\n", fpo) == EOF) die(3); @@ -750,9 +754,9 @@ main(int argc, char *argv[]) if (fprintf(fpo, "unsigned int %s", isdigit((int)argv[1][0]) ? "__" : "") < 0) die(3); for (e = 0; (c = argv[1][e]) != 0; e++) - if (putc(isalnum(c) ? c : '_', fpo) == EOF) + if (putc(isalnum(c) ? CONDITIONAL_CAPITALIZE(c) : '_', fpo) == EOF) die(3); - if (fprintf(fpo, "_len = %d;\n", p) < 0) + if (fprintf(fpo, "_%s = %d;\n", capitalize ? "LEN" : "len", p) < 0) die(3); } From 9af9778209cd0cbb284f6ff7e88f707418089975 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 3 Apr 2018 12:51:01 +0200 Subject: [PATCH 03/26] patch 8.0.1657: crash when reading a channel Problem: Crash when reading a channel. Solution: Clear the write flag before writing. (idea by Shinya Ohyanagi, closes #2769). --- src/channel.c | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/channel.c b/src/channel.c index 3b71472fdc..38e639224c 100644 --- a/src/channel.c +++ b/src/channel.c @@ -4150,8 +4150,9 @@ channel_select_check(int ret_in, void *rfds_in, void *wfds_in) if (ret > 0 && in_part->ch_fd != INVALID_FD && FD_ISSET(in_part->ch_fd, wfds)) { - channel_write_input(channel); + /* Clear the flag first, ch_fd may change in channel_write_input(). */ FD_CLR(in_part->ch_fd, wfds); + channel_write_input(channel); --ret; } } diff --git a/src/version.c b/src/version.c index 1c2d802d0b..1178d9b2a2 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1657, /**/ 1656, /**/ From 79cf7c0d4574f15cfad5ad706f175e226c528f2a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 3 Apr 2018 14:21:16 +0200 Subject: [PATCH 04/26] patch 8.0.1658: capitalize argument not available in long form Problem: Capitalize argument not available in long form. Solution: Recognize -capitalize. Update man page. --- runtime/doc/xxd.1 | 27 ++++++++------- runtime/doc/xxd.man | 82 ++++++++++++++++++++++++--------------------- src/version.c | 2 ++ src/xxd/xxd.c | 2 ++ 4 files changed, 62 insertions(+), 51 deletions(-) diff --git a/runtime/doc/xxd.1 b/runtime/doc/xxd.1 index 5a49e057a2..46bfedc1e8 100644 --- a/runtime/doc/xxd.1 +++ b/runtime/doc/xxd.1 @@ -57,7 +57,7 @@ are all equivalent. .PP .TP .IR \-a " | " \-autoskip -toggle autoskip: A single '*' replaces nul-lines. Default off. +Toggle autoskip: A single '*' replaces nul-lines. Default off. .TP .IR \-b " | " \-bits Switch to bits (binary digits) dump, rather than hexdump. @@ -67,10 +67,13 @@ followed by an ascii (or ebcdic) representation. The command line switches \-r, \-p, \-i do not work with this mode. .TP .IR "\-c cols " | " \-cols cols" -format +Format .RI < cols > octets per line. Default 16 (\-i: 12, \-ps: 30, \-b: 6). Max 256. .TP +.IR \-C " | " \-capitalize +Capitalize variable names in C include file style, when using \-i. +.TP .IR \-E " | " \-EBCDIC Change the character encoding in the righthand column from ASCII to EBCDIC. This does not change the hexadecimal representation. The option is @@ -87,7 +90,7 @@ The command line switches \-r, \-p, \-i do not work with this mode. .TP .IR "\-g bytes " | " \-groupsize bytes" -separate the output of every +Separate the output of every .RI < bytes > bytes (two hex characters or eight bit-digits each) by a whitespace. Specify @@ -98,28 +101,28 @@ in normal mode, \fI4\fP in little-endian mode and \fI1\fP in bits mode. Grouping does not apply to postscript or include style. .TP .IR \-h " | " \-help -print a summary of available commands and exit. No hex dumping is performed. +Print a summary of available commands and exit. No hex dumping is performed. .TP .IR \-i " | " \-include -output in C include file style. A complete static array definition is written +Output in C include file style. A complete static array definition is written (named after the input file), unless xxd reads from stdin. .TP .IR "\-l len " | " \-len len" -stop after writing +Stop after writing .RI < len > octets. .TP .I \-o offset -add +Add .RI < offset > to the displayed file position. .TP .IR \-p " | " \-ps " | " \-postscript " | " \-plain -output in postscript continuous hexdump style. Also known as plain hexdump +Output in postscript continuous hexdump style. Also known as plain hexdump style. .TP .IR \-r " | " \-revert -reverse operation: convert (or patch) hexdump into binary. +Reverse operation: convert (or patch) hexdump into binary. If not writing to stdout, xxd writes into its output file without truncating it. Use the combination .I \-r \-p @@ -135,7 +138,7 @@ revert with added to file positions found in hexdump. .TP .I \-s [+][\-]seek -start at +Start at .RI < seek > bytes abs. (or rel.) infile offset. \fI+ \fRindicates that the seek is relative to the current stdin file position @@ -145,10 +148,10 @@ should be that many characters from the end of the input (or if combined with Without \-s option, xxd starts at the current file position. .TP .I \-u -use upper case hex letters. Default is lower case. +Use upper case hex letters. Default is lower case. .TP .IR \-v " | " \-version -show version string. +Show version string. .SH CAVEATS .PP .I xxd \-r diff --git a/runtime/doc/xxd.man b/runtime/doc/xxd.man index 7e1097fa99..607db8aa99 100644 --- a/runtime/doc/xxd.man +++ b/runtime/doc/xxd.man @@ -30,7 +30,7 @@ OPTIONS notation. Thus -c8, -c 8, -c 010 and -cols 8 are all equivalent. -a | -autoskip - toggle autoskip: A single '*' replaces nul-lines. Default off. + Toggle autoskip: A single '*' replaces nul-lines. Default off. -b | -bits Switch to bits (binary digits) dump, rather than hexdump. This @@ -41,9 +41,13 @@ OPTIONS mode. -c cols | -cols cols - format octets per line. Default 16 (-i: 12, -ps: 30, -b: + Format octets per line. Default 16 (-i: 12, -ps: 30, -b: 6). Max 256. + -C | -capitalize + Capitalize variable names in C include file style, when using + -i. + -E | -EBCDIC Change the character encoding in the righthand column from ASCII to EBCDIC. This does not change the hexadecimal representation. @@ -52,41 +56,41 @@ OPTIONS -e Switch to little-endian hexdump. This option treats byte groups as words in little-endian byte order. The default grouping of 4 bytes may be changed using -g. This option only applies to hex‐ - dump, leaving the ASCII (or EBCDIC) representation unchanged. + dump, leaving the ASCII (or EBCDIC) representation unchanged. The command line switches -r, -p, -i do not work with this mode. -g bytes | -groupsize bytes - separate the output of every bytes (two hex characters + Separate the output of every bytes (two hex characters or eight bit-digits each) by a whitespace. Specify -g 0 to sup‐ press grouping. defaults to 2 in normal mode, 4 in lit‐ - tle-endian mode and 1 in bits mode. Grouping does not apply to + tle-endian mode and 1 in bits mode. Grouping does not apply to postscript or include style. -h | -help - print a summary of available commands and exit. No hex dumping + Print a summary of available commands and exit. No hex dumping is performed. -i | -include - output in C include file style. A complete static array defini‐ - tion is written (named after the input file), unless xxd reads + Output in C include file style. A complete static array defini‐ + tion is written (named after the input file), unless xxd reads from stdin. -l len | -len len - stop after writing octets. + Stop after writing octets. -o offset - add to the displayed file position. + Add to the displayed file position. -p | -ps | -postscript | -plain - output in postscript continuous hexdump style. Also known as + Output in postscript continuous hexdump style. Also known as plain hexdump style. -r | -revert - reverse operation: convert (or patch) hexdump into binary. If - not writing to stdout, xxd writes into its output file without + Reverse operation: convert (or patch) hexdump into binary. If + not writing to stdout, xxd writes into its output file without truncating it. Use the combination -r -p to read plain hexadeci‐ mal dumps without line number information and without a particu‐ - lar column layout. Additional Whitespace and line-breaks are + lar column layout. Additional Whitespace and line-breaks are allowed anywhere. -seek offset @@ -94,34 +98,34 @@ OPTIONS found in hexdump. -s [+][-]seek - start at bytes abs. (or rel.) infile offset. + indicates - that the seek is relative to the current stdin file position + Start at bytes abs. (or rel.) infile offset. + indicates + that the seek is relative to the current stdin file position (meaningless when not reading from stdin). - indicates that the - seek should be that many characters from the end of the input + seek should be that many characters from the end of the input (or if combined with +: before the current stdin file position). Without -s option, xxd starts at the current file position. - -u use upper case hex letters. Default is lower case. + -u Use upper case hex letters. Default is lower case. -v | -version - show version string. + Show version string. CAVEATS xxd -r has some builtin magic while evaluating line number information. - If the output file is seekable, then the linenumbers at the start of - each hexdump line may be out of order, lines may be missing, or over‐ - lapping. In these cases xxd will lseek(2) to the next position. If the - output file is not seekable, only gaps are allowed, which will be + If the output file is seekable, then the linenumbers at the start of + each hexdump line may be out of order, lines may be missing, or over‐ + lapping. In these cases xxd will lseek(2) to the next position. If the + output file is not seekable, only gaps are allowed, which will be filled by null-bytes. xxd -r never generates parse errors. Garbage is silently skipped. - When editing hexdumps, please note that xxd -r skips everything on the + When editing hexdumps, please note that xxd -r skips everything on the input line after reading enough columns of hexadecimal data (see option - -c). This also means, that changes to the printable ascii (or ebcdic) - columns are always ignored. Reverting a plain (or postscript) style - hexdump with xxd -r -p does not depend on the correct number of col‐ - umns. Here anything that looks like a pair of hex-digits is inter‐ + -c). This also means, that changes to the printable ascii (or ebcdic) + columns are always ignored. Reverting a plain (or postscript) style + hexdump with xxd -r -p does not depend on the correct number of col‐ + umns. Here anything that looks like a pair of hex-digits is inter‐ preted. Note the difference between @@ -129,28 +133,28 @@ CAVEATS and % xxd -i < file - xxd -s +seek may be different from xxd -s seek, as lseek(2) is used to + xxd -s +seek may be different from xxd -s seek, as lseek(2) is used to "rewind" input. A '+' makes a difference if the input source is stdin, - and if stdin's file position is not at the start of the file by the - time xxd is started and given its input. The following examples may + and if stdin's file position is not at the start of the file by the + time xxd is started and given its input. The following examples may help to clarify (or further confuse!)... - Rewind stdin before reading; needed because the `cat' has already read + Rewind stdin before reading; needed because the `cat' has already read to the end of stdin. % sh -c "cat > plain_copy; xxd -s 0 > hex_copy" < file - Hexdump from file position 0x480 (=1024+128) onwards. The `+' sign + Hexdump from file position 0x480 (=1024+128) onwards. The `+' sign means "relative to the current position", thus the `128' adds to the 1k where dd left off. - % sh -c "dd of=plain_snippet bs=1k count=1; xxd -s +128 > hex_snippet" + % sh -c "dd of=plain_snippet bs=1k count=1; xxd -s +128 > hex_snippet" < file Hexdump from file position 0x100 ( = 1024-768) on. % sh -c "dd of=plain_snippet bs=1k count=1; xxd -s +-768 > hex_snippet" < file - However, this is a rare situation and the use of `+' is rarely needed. - The author prefers to monitor the effect of xxd with strace(1) or + However, this is a rare situation and the use of `+' is rarely needed. + The author prefers to monitor the effect of xxd with strace(1) or truss(1), whenever -s is used. EXAMPLES @@ -194,7 +198,7 @@ EXAMPLES % xxd -s 0x36 -l 13 -c 13 xxd.1 0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996 - Create a 65537 byte file with all bytes 0x00, except for the last one + Create a 65537 byte file with all bytes 0x00, except for the last one which is 'A' (hex 0x41). % echo "010000: 41" | xxd -r > file @@ -204,7 +208,7 @@ EXAMPLES * 000fffc: 0000 0000 40 ....A - Create a 1 byte file containing a single 'A' character. The number + Create a 1 byte file containing a single 'A' character. The number after '-r -s' adds to the linenumbers found in the file; in effect, the leading bytes are suppressed. % echo "010000: 41" | xxd -r -s -0x10000 > file @@ -245,7 +249,7 @@ SEE ALSO uuencode(1), uudecode(1), patch(1) WARNINGS - The tools weirdness matches its creators brain. Use entirely at your + The tools weirdness matches its creators brain. Use entirely at your own risk. Copy files. Trace it. Become a wizard. VERSION diff --git a/src/version.c b/src/version.c index 1178d9b2a2..ac06f387a4 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1658, /**/ 1657, /**/ diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c index bbd9c08a37..d102db451b 100644 --- a/src/xxd/xxd.c +++ b/src/xxd/xxd.c @@ -510,6 +510,8 @@ main(int argc, char *argv[]) { if (pp[2] && STRNCMP("ols", pp + 2, 3)) cols = (int)strtol(pp + 2, NULL, 0); + else if (pp[2] && STRNCMP("apitalize", pp + 2, 9)) + capitalize = 1; else { if (!argv[2]) From 1f8495cf48888ff3a8ab3d0eb22db92389191a60 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 4 Apr 2018 21:53:11 +0200 Subject: [PATCH 05/26] patch 8.0.1659: scroll events not recognized for some xterm emulators Problem: Scroll events not recognized for some xterm emulators. Solution: Recognize mouse codes 0x40 and 0x41 as scroll events. --- src/term.c | 9 ++++++--- src/version.c | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/term.c b/src/term.c index c74e14f44b..3a27fa691d 100644 --- a/src/term.c +++ b/src/term.c @@ -5195,10 +5195,13 @@ check_termcode( # ifdef FEAT_GUI && !gui.in_use # endif - && (mouse_code == 0x23 || mouse_code == 0x24)) + && (mouse_code == 0x23 || mouse_code == 0x24 + || mouse_code == 0x40 || mouse_code == 0x41)) { - /* Apparently used by rxvt scroll wheel. */ - wheel_code = mouse_code - 0x23 + MOUSEWHEEL_LOW; + /* Apparently 0x23 and 0x24 are used by rxvt scroll wheel. + * And 0x40 and 0x41 are used by some xterm emulator. */ + wheel_code = mouse_code - (mouse_code >= 0x40 ? 0x40 : 0x23) + + MOUSEWHEEL_LOW; } # endif diff --git a/src/version.c b/src/version.c index ac06f387a4..cdd8b418de 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1659, /**/ 1658, /**/ From 333b80acf3a44e462456e6d5730e47ffa449c83d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 4 Apr 2018 22:57:29 +0200 Subject: [PATCH 06/26] patch 8.0.1660: the terminal API "drop" command doesn't support options Problem: The terminal API "drop" command doesn't support options. Solution: Implement the options. --- runtime/doc/terminal.txt | 20 +++++- src/eval.c | 6 +- src/ex_cmds.h | 2 +- src/ex_docmd.c | 22 ++++--- src/fileio.c | 14 ++-- src/misc2.c | 2 +- src/proto/ex_docmd.pro | 1 + src/terminal.c | 59 +++++++++++++++-- src/testdir/test_terminal.vim | 117 ++++++++++++++++++++++++++++++++-- src/version.c | 2 + 10 files changed, 214 insertions(+), 31 deletions(-) diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index 54c7e1f044..f575c82d1b 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -25,7 +25,7 @@ If the result is "1" you have it. MS-Windows |terminal-ms-windows| 2. Terminal communication |terminal-communication| Vim to job: term_sendkeys() |terminal-to-job| - Job to Vim: JSON API |terminal-api| + Job to Vim: JSON API |terminal-api| Using the client-server feature |terminal-client-server| 3. Remote testing |terminal-testing| 4. Diffing screen dumps |terminal-diff| @@ -352,7 +352,7 @@ On Unix a pty is used to make it possible to run all kinds of commands. You can even run Vim in the terminal! That's used for debugging, see below. Environment variables are used to pass information to the running job: - TERM name of the terminal, 'term' + TERM name of the terminal, from the 'term' option ROWS number of rows in the terminal initially LINES same as ROWS COLUMNS number of columns in the terminal initially @@ -443,11 +443,25 @@ Currently supported commands: < Output from `:echo` may be erased by a redraw, use `:echomsg` to be able to see it with `:messages`. - drop {filename} + drop {filename} [options] Let Vim open a file, like the `:drop` command. If {filename} is already open in a window, switch to that window. Otherwise open a new window to edit {filename}. + + [options] is only used when opening a new window. If present, + it must be a Dict. Similarly to |++opt|, These entries are recognized: + "ff" file format: "dos", "mac" or "unix" + "fileformat" idem + "enc" overrides 'fileencoding' + "encoding" idem + "bin" sets 'binary' + "binary" idem + "nobin" resets 'binary' + "nobinary" idem + "bad" specifies behavior for bad characters, see + |++bad| + Example in JSON: > ["drop", "path/file.txt", {"ff": "dos"}] diff --git a/src/eval.c b/src/eval.c index 2da56a47af..c965d64f2d 100644 --- a/src/eval.c +++ b/src/eval.c @@ -6590,7 +6590,7 @@ set_cmdarg(exarg_T *eap, char_u *oldarg) len += 7; if (eap->force_ff != 0) - len += (unsigned)STRLEN(eap->cmd + eap->force_ff) + 6; + len += 10; /* " ++ff=unix" */ # ifdef FEAT_MBYTE if (eap->force_enc != 0) len += (unsigned)STRLEN(eap->cmd + eap->force_enc) + 7; @@ -6614,7 +6614,9 @@ set_cmdarg(exarg_T *eap, char_u *oldarg) if (eap->force_ff != 0) sprintf((char *)newval + STRLEN(newval), " ++ff=%s", - eap->cmd + eap->force_ff); + eap->force_ff == 'u' ? "unix" + : eap->force_ff == 'd' ? "dos" + : "mac"); #ifdef FEAT_MBYTE if (eap->force_enc != 0) sprintf((char *)newval + STRLEN(newval), " ++enc=%s", diff --git a/src/ex_cmds.h b/src/ex_cmds.h index 41c7c80cb7..48b0253157 100644 --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -1778,7 +1778,7 @@ struct exarg int regname; /* register name (NUL if none) */ int force_bin; /* 0, FORCE_BIN or FORCE_NOBIN */ int read_edit; /* ++edit argument */ - int force_ff; /* ++ff= argument (index in cmd[]) */ + int force_ff; /* ++ff= argument (first char of argument) */ #ifdef FEAT_MBYTE int force_enc; /* ++enc= argument (index in cmd[]) */ int bad_char; /* BAD_KEEP, BAD_DROP or replacement byte */ diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 3a6c7cfb15..b0130046e1 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -5308,6 +5308,18 @@ skip_cmd_arg( return p; } + int +get_bad_opt(char_u *p, exarg_T *eap) +{ + if (STRICMP(p, "keep") == 0) + eap->bad_char = BAD_KEEP; + else if (STRICMP(p, "drop") == 0) + eap->bad_char = BAD_DROP; + else if (MB_BYTE2LEN(*p) == 1 && p[1] == NUL) + eap->bad_char = *p; + return FAIL; +} + /* * Get "++opt=arg" argument. * Return FAIL or OK. @@ -5387,6 +5399,7 @@ getargopt(exarg_T *eap) #endif if (check_ff_value(eap->cmd + eap->force_ff) == FAIL) return FAIL; + eap->force_ff = eap->cmd[eap->force_ff]; #ifdef FEAT_MBYTE } else if (pp == &eap->force_enc) @@ -5399,14 +5412,7 @@ getargopt(exarg_T *eap) { /* Check ++bad= argument. Must be a single-byte character, "keep" or * "drop". */ - p = eap->cmd + bad_char_idx; - if (STRICMP(p, "keep") == 0) - eap->bad_char = BAD_KEEP; - else if (STRICMP(p, "drop") == 0) - eap->bad_char = BAD_DROP; - else if (MB_BYTE2LEN(*p) == 1 && p[1] == NUL) - eap->bad_char = *p; - else + if (get_bad_opt(eap->cmd + bad_char_idx, eap) == FAIL) return FAIL; } #endif diff --git a/src/fileio.c b/src/fileio.c index 05c3df50bc..e2fa3e22b6 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2779,22 +2779,22 @@ readfile_linenr( int prep_exarg(exarg_T *eap, buf_T *buf) { - eap->cmd = alloc((unsigned)(STRLEN(buf->b_p_ff) + eap->cmd = alloc(15 #ifdef FEAT_MBYTE - + STRLEN(buf->b_p_fenc) + + (unsigned)STRLEN(buf->b_p_fenc) #endif - + 15)); + ); if (eap->cmd == NULL) return FAIL; #ifdef FEAT_MBYTE - sprintf((char *)eap->cmd, "e ++ff=%s ++enc=%s", buf->b_p_ff, buf->b_p_fenc); - eap->force_enc = 14 + (int)STRLEN(buf->b_p_ff); + sprintf((char *)eap->cmd, "e ++enc=%s", buf->b_p_fenc); + eap->force_enc = 8; eap->bad_char = buf->b_bad_char; #else - sprintf((char *)eap->cmd, "e ++ff=%s", buf->b_p_ff); + sprintf((char *)eap->cmd, "e"); #endif - eap->force_ff = 7; + eap->force_ff = *buf->b_p_ff; eap->force_bin = buf->b_p_bin ? FORCE_BIN : FORCE_NOBIN; eap->read_edit = FALSE; diff --git a/src/misc2.c b/src/misc2.c index cd1dcf054a..9127e669ae 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -3161,7 +3161,7 @@ get_fileformat_force( int c; if (eap != NULL && eap->force_ff != 0) - c = eap->cmd[eap->force_ff]; + c = eap->force_ff; else { if ((eap != NULL && eap->force_bin != 0) diff --git a/src/proto/ex_docmd.pro b/src/proto/ex_docmd.pro index 3819531929..0eace6222f 100644 --- a/src/proto/ex_docmd.pro +++ b/src/proto/ex_docmd.pro @@ -12,6 +12,7 @@ char_u *skip_range(char_u *cmd, int *ctx); void ex_ni(exarg_T *eap); int expand_filename(exarg_T *eap, char_u **cmdlinep, char_u **errormsgp); void separate_nextcmd(exarg_T *eap); +int get_bad_opt(char_u *p, exarg_T *eap); int ends_excmd(int c); char_u *find_nextcmd(char_u *p); char_u *check_nextcmd(char_u *p); diff --git a/src/terminal.c b/src/terminal.c index b60799d7f1..3268062055 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -38,7 +38,6 @@ * in tl_scrollback are no longer used. * * TODO: - * - For the "drop" command accept another argument for options. * - Add a way to set the 16 ANSI colors, to be used for 'termguicolors' and in * the GUI. * - Win32: Make terminal used for :!cmd in the GUI work better. Allow for @@ -3152,10 +3151,12 @@ init_default_colors(term_T *term) handle_drop_command(listitem_T *item) { char_u *fname = get_tv_string(&item->li_tv); + listitem_T *opt_item = item->li_next; int bufnr; win_T *wp; tabpage_T *tp; exarg_T ea; + char_u *tofree = NULL; bufnr = buflist_add(fname, BLN_LISTED | BLN_NOOPT); FOR_ALL_TAB_WINDOWS(tp, wp) @@ -3168,10 +3169,60 @@ handle_drop_command(listitem_T *item) } } - /* open in new window, like ":sbuffer N" */ vim_memset(&ea, 0, sizeof(ea)); - ea.cmd = (char_u *)"sbuffer"; - goto_buffer(&ea, DOBUF_FIRST, FORWARD, bufnr); + + if (opt_item != NULL && opt_item->li_tv.v_type == VAR_DICT + && opt_item->li_tv.vval.v_dict != NULL) + { + dict_T *dict = opt_item->li_tv.vval.v_dict; + char_u *p; + + p = get_dict_string(dict, (char_u *)"ff", FALSE); + if (p == NULL) + p = get_dict_string(dict, (char_u *)"fileformat", FALSE); + if (p != NULL) + { + if (check_ff_value(p) == FAIL) + ch_log(NULL, "Invalid ff argument to drop: %s", p); + else + ea.force_ff = *p; + } + p = get_dict_string(dict, (char_u *)"enc", FALSE); + if (p == NULL) + p = get_dict_string(dict, (char_u *)"encoding", FALSE); + if (p != NULL) + { + ea.cmd = alloc((int)STRLEN(p) + 10); + if (ea.cmd != NULL) + { + sprintf((char *)ea.cmd, "sbuf ++enc=%s", p); + ea.force_enc = 11; + tofree = ea.cmd; + } + } + + p = get_dict_string(dict, (char_u *)"bad", FALSE); + if (p != NULL) + get_bad_opt(p, &ea); + + if (dict_find(dict, (char_u *)"bin", -1) != NULL) + ea.force_bin = FORCE_BIN; + if (dict_find(dict, (char_u *)"binary", -1) != NULL) + ea.force_bin = FORCE_BIN; + if (dict_find(dict, (char_u *)"nobin", -1) != NULL) + ea.force_bin = FORCE_NOBIN; + if (dict_find(dict, (char_u *)"nobinary", -1) != NULL) + ea.force_bin = FORCE_NOBIN; + } + + /* open in new window, like ":split fname" */ + if (ea.cmd == NULL) + ea.cmd = (char_u *)"split"; + ea.arg = fname; + ea.cmdidx = CMD_split; + ex_splitview(&ea); + + vim_free(tofree); } /* diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index eac54c1d68..218b4ca6f6 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -1049,17 +1049,14 @@ func Test_terminal_dumpdiff_options() set laststatus& endfunc -func Test_terminal_api_drop_newwin() - if !CanRunVimInTerminal() - return - endif +func Api_drop_common(options) call assert_equal(1, winnr('$')) " Use the title termcap entries to output the escape sequence. call writefile([ \ 'set title', \ 'exe "set t_ts=\]51; t_fs=\x07"', - \ 'let &titlestring = ''["drop","Xtextfile"]''', + \ 'let &titlestring = ''["drop","Xtextfile"' . a:options . ']''', \ 'redraw', \ "set t_ts=", \ ], 'Xscript') @@ -1067,6 +1064,116 @@ func Test_terminal_api_drop_newwin() call WaitFor({-> bufnr('Xtextfile') > 0}) call assert_equal('Xtextfile', expand('%:t')) call assert_true(winnr('$') >= 3) + return buf +endfunc + +func Test_terminal_api_drop_newwin() + if !CanRunVimInTerminal() + return + endif + let buf = Api_drop_common('') + call assert_equal(0, &bin) + call assert_equal('', &fenc) + + call StopVimInTerminal(buf) + call delete('Xscript') + bwipe Xtextfile +endfunc + +func Test_terminal_api_drop_newwin_bin() + if !CanRunVimInTerminal() + return + endif + let buf = Api_drop_common(',{"bin":1}') + call assert_equal(1, &bin) + + call StopVimInTerminal(buf) + call delete('Xscript') + bwipe Xtextfile +endfunc + +func Test_terminal_api_drop_newwin_binary() + if !CanRunVimInTerminal() + return + endif + let buf = Api_drop_common(',{"binary":1}') + call assert_equal(1, &bin) + + call StopVimInTerminal(buf) + call delete('Xscript') + bwipe Xtextfile +endfunc + +func Test_terminal_api_drop_newwin_nobin() + if !CanRunVimInTerminal() + return + endif + set binary + let buf = Api_drop_common(',{"nobin":1}') + call assert_equal(0, &bin) + + call StopVimInTerminal(buf) + call delete('Xscript') + bwipe Xtextfile + set nobinary +endfunc + +func Test_terminal_api_drop_newwin_nobinary() + if !CanRunVimInTerminal() + return + endif + set binary + let buf = Api_drop_common(',{"nobinary":1}') + call assert_equal(0, &bin) + + call StopVimInTerminal(buf) + call delete('Xscript') + bwipe Xtextfile + set nobinary +endfunc + +func Test_terminal_api_drop_newwin_ff() + if !CanRunVimInTerminal() + return + endif + let buf = Api_drop_common(',{"ff":"dos"}') + call assert_equal("dos", &ff) + + call StopVimInTerminal(buf) + call delete('Xscript') + bwipe Xtextfile +endfunc + +func Test_terminal_api_drop_newwin_fileformat() + if !CanRunVimInTerminal() + return + endif + let buf = Api_drop_common(',{"fileformat":"dos"}') + call assert_equal("dos", &ff) + + call StopVimInTerminal(buf) + call delete('Xscript') + bwipe Xtextfile +endfunc + +func Test_terminal_api_drop_newwin_enc() + if !CanRunVimInTerminal() + return + endif + let buf = Api_drop_common(',{"enc":"utf-16"}') + call assert_equal("utf-16", &fenc) + + call StopVimInTerminal(buf) + call delete('Xscript') + bwipe Xtextfile +endfunc + +func Test_terminal_api_drop_newwin_encoding() + if !CanRunVimInTerminal() + return + endif + let buf = Api_drop_common(',{"encoding":"utf-16"}') + call assert_equal("utf-16", &fenc) call StopVimInTerminal(buf) call delete('Xscript') diff --git a/src/version.c b/src/version.c index cdd8b418de..2d566ca14f 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1660, /**/ 1659, /**/ From 878c96d5b9416170dfd28a02cba0db683f91c220 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 4 Apr 2018 23:00:06 +0200 Subject: [PATCH 07/26] patch 8.0.1661: warnings from 64 bit compiler Problem: Warnings from 64 bit compiler. Solution: Add type casts. (Mike Williams) --- src/terminal.c | 4 ++-- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/terminal.c b/src/terminal.c index 3268062055..fd30c6512b 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -3253,7 +3253,7 @@ handle_call_command(term_T *term, channel_T *channel, listitem_T *item) argvars[0].v_type = VAR_NUMBER; argvars[0].vval.v_number = term->tl_buffer->b_fnum; argvars[1] = item->li_next->li_tv; - if (call_func(func, STRLEN(func), &rettv, + if (call_func(func, (int)STRLEN(func), &rettv, 2, argvars, /* argv_func */ NULL, /* firstline */ 1, /* lastline */ 1, &doesrange, /* evaluate */ TRUE, @@ -3283,7 +3283,7 @@ parse_osc(const char *command, size_t cmdlen, void *user) if (cmdlen < 3 || STRNCMP(command, "51;", 3) != 0) return 0; /* not handled */ - reader.js_buf = vim_strnsave((char_u *)command + 3, cmdlen - 3); + reader.js_buf = vim_strnsave((char_u *)command + 3, (int)(cmdlen - 3)); if (reader.js_buf == NULL) return 1; reader.js_fill = NULL; diff --git a/src/version.c b/src/version.c index 2d566ca14f..87a326a744 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1661, /**/ 1660, /**/ From 4a69634b1b55e06c4bf7f05b54125b1669b1c363 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Apr 2018 18:45:26 +0200 Subject: [PATCH 08/26] patch 8.0.1662: showing dump diff doesn't mention both file names Problem: Showing dump diff doesn't mention both file names. Solution: Add the file name in the separator line. --- src/terminal.c | 73 ++++++++++++++++++++++++++++++++++++++++++++------ src/version.c | 2 ++ 2 files changed, 67 insertions(+), 8 deletions(-) diff --git a/src/terminal.c b/src/terminal.c index fd30c6512b..86b86474e3 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -41,7 +41,7 @@ * - Add a way to set the 16 ANSI colors, to be used for 'termguicolors' and in * the GUI. * - Win32: Make terminal used for :!cmd in the GUI work better. Allow for - * redirection. + * redirection. Probably in call to channel_set_pipes(). * - implement term_setsize() * - Copy text in the vterm to the Vim buffer once in a while, so that * completion works. @@ -3916,6 +3916,57 @@ read_dump_file(FILE *fd, VTermPos *cursor_pos) return max_cells; } +/* + * Return an allocated string with at least "text_width" "=" characters and + * "fname" inserted in the middle. + */ + static char_u * +get_separator(int text_width, char_u *fname) +{ + int width = MAX(text_width, curwin->w_width); + char_u *textline; + int fname_size; + char_u *p = fname; + int i; + int off; + + textline = alloc(width + STRLEN(fname) + 1); + if (textline == NULL) + return NULL; + + fname_size = vim_strsize(fname); + if (fname_size < width - 8) + { + /* enough room, don't use the full window width */ + width = MAX(text_width, fname_size + 8); + } + else if (fname_size > width - 8) + { + /* full name doesn't fit, use only the tail */ + p = gettail(fname); + fname_size = vim_strsize(p); + } + /* skip characters until the name fits */ + while (fname_size > width - 8) + { + p += (*mb_ptr2len)(p); + fname_size = vim_strsize(p); + } + + for (i = 0; i < (width - fname_size) / 2 - 1; ++i) + textline[i] = '='; + textline[i++] = ' '; + + STRCPY(textline + i, p); + off = STRLEN(textline); + textline[off] = ' '; + for (i = 1; i < (width - fname_size) / 2; ++i) + textline[off + i] = '='; + textline[off + i] = NUL; + + return textline; +} + /* * Common for "term_dumpdiff()" and "term_dumpload()". */ @@ -4013,16 +4064,19 @@ term_load_dump(typval_T *argvars, typval_T *rettv, int do_diff) term->tl_top_diff_rows = curbuf->b_ml.ml_line_count; - textline = alloc(width + 1); + textline = get_separator(width, fname1); if (textline == NULL) goto theend; - for (i = 0; i < width; ++i) - textline[i] = '='; + if (add_empty_scrollback(term, &term->tl_default_color, 0) == OK) + ml_append(curbuf->b_ml.ml_line_count, textline, 0, FALSE); + vim_free(textline); + + textline = get_separator(width, fname2); + if (textline == NULL) + goto theend; + if (add_empty_scrollback(term, &term->tl_default_color, 0) == OK) + ml_append(curbuf->b_ml.ml_line_count, textline, 0, FALSE); textline[width] = NUL; - if (add_empty_scrollback(term, &term->tl_default_color, 0) == OK) - ml_append(curbuf->b_ml.ml_line_count, textline, 0, FALSE); - if (add_empty_scrollback(term, &term->tl_default_color, 0) == OK) - ml_append(curbuf->b_ml.ml_line_count, textline, 0, FALSE); bot_lnum = curbuf->b_ml.ml_line_count; width2 = read_dump_file(fd2, &cursor_pos2); @@ -4143,6 +4197,9 @@ term_load_dump(typval_T *argvars, typval_T *rettv, int do_diff) } term->tl_cols = width; + + /* looks better without wrapping */ + curwin->w_p_wrap = 0; } theend: diff --git a/src/version.c b/src/version.c index 87a326a744..4b9761f675 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1662, /**/ 1661, /**/ From 86676c949fcec939441620bc747851e315e2702a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Apr 2018 18:56:48 +0200 Subject: [PATCH 09/26] patch 8.0.1663: cannot build without multi-byte feature Problem: Cannot build without multi-byte feature. Solution: Add #ifdef. --- src/ex_docmd.c | 2 ++ src/version.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index b0130046e1..046ef3cf5d 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -5308,6 +5308,7 @@ skip_cmd_arg( return p; } +#if defined(FEAT_MBYTE) || defined(PROTO) int get_bad_opt(char_u *p, exarg_T *eap) { @@ -5319,6 +5320,7 @@ get_bad_opt(char_u *p, exarg_T *eap) eap->bad_char = *p; return FAIL; } +#endif /* * Get "++opt=arg" argument. diff --git a/src/version.c b/src/version.c index 4b9761f675..4d19b47b5d 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1663, /**/ 1662, /**/ From 3aa67fb453373109132b71eeb488595d651dfb7d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Apr 2018 21:04:15 +0200 Subject: [PATCH 10/26] patch 8.0.1664: test failure because of not allocating enough space Problem: Test failure because of not allocating enough space. Solution: Allocate more bytes. --- src/terminal.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/terminal.c b/src/terminal.c index 86b86474e3..1d81d8db56 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -3192,7 +3192,7 @@ handle_drop_command(listitem_T *item) p = get_dict_string(dict, (char_u *)"encoding", FALSE); if (p != NULL) { - ea.cmd = alloc((int)STRLEN(p) + 10); + ea.cmd = alloc((int)STRLEN(p) + 12); if (ea.cmd != NULL) { sprintf((char *)ea.cmd, "sbuf ++enc=%s", p); diff --git a/src/version.c b/src/version.c index 4d19b47b5d..a9b4dca755 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1664, /**/ 1663, /**/ From 9a993e3c09371bb80d71be62fca53cf954a98f72 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Apr 2018 22:15:22 +0200 Subject: [PATCH 11/26] patch 8.0.1665: when running a terminal from the GUI 'term' is not useful Problem: When running a terminal from the GUI 'term' is not useful. Solution: Use $TERM in the GUI if it starts with "xterm". (closes #2776) --- runtime/doc/terminal.txt | 4 +++- src/os_unix.c | 16 ++++++++++++++-- src/version.c | 2 ++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index f575c82d1b..8dc19cbf60 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -352,7 +352,9 @@ On Unix a pty is used to make it possible to run all kinds of commands. You can even run Vim in the terminal! That's used for debugging, see below. Environment variables are used to pass information to the running job: - TERM name of the terminal, from the 'term' option + TERM the name of the terminal, from the 'term' option or + $TERM in the GUI; falls back to "xterm" if it does not + start with "xterm" ROWS number of rows in the terminal initially LINES same as ROWS COLUMNS number of columns in the terminal initially diff --git a/src/os_unix.c b/src/os_unix.c index b811ac3f4b..42917c25b4 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -5579,11 +5579,23 @@ mch_job_start(char **argv, job_T *job, jobopt_T *options) # ifdef FEAT_TERMINAL if (options->jo_term_rows > 0) + { + char *term = (char *)T_NAME; + +#ifdef FEAT_GUI + if (term_is_gui(T_NAME)) + /* In the GUI 'term' is not what we want, use $TERM. */ + term = getenv("TERM"); +#endif + /* Use 'term' or $TERM if it starts with "xterm", otherwise fall + * back to "xterm". */ + if (term == NULL || *term == NUL || STRNCMP(term, "xterm", 5) != 0) + term = "xterm"; set_child_environment( (long)options->jo_term_rows, (long)options->jo_term_cols, - STRNCMP(T_NAME, "xterm", 5) == 0 - ? (char *)T_NAME : "xterm"); + term); + } else # endif set_default_child_environment(); diff --git a/src/version.c b/src/version.c index a9b4dca755..b29d64c825 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1665, /**/ 1664, /**/ From d5359b24ceefefed4b3a37efd9bf54176935f3a5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Apr 2018 22:44:39 +0200 Subject: [PATCH 12/26] patch 8.0.1666: % argument in ch_log() causes trouble Problem: % argument in ch_log() causes trouble. Solution: Use string as third argument in internal ch_log(). (Dominique Pelle, closes #2784) --- src/evalfunc.c | 4 ++-- src/testdir/test_channel.vim | 12 ++++++++++++ src/version.c | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/evalfunc.c b/src/evalfunc.c index dc2c14c3de..1ffbb21fa1 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -1993,7 +1993,7 @@ f_ch_log(typval_T *argvars, typval_T *rettv UNUSED) if (argvars[1].v_type != VAR_UNKNOWN) channel = get_channel_arg(&argvars[1], FALSE, FALSE, 0); - ch_log(channel, (char *)msg); + ch_log(channel, "%s", msg); } /* @@ -12927,7 +12927,7 @@ get_callback(typval_T *arg, partial_T **pp) } /* - * Unref/free "callback" and "partial" retured by get_callback(). + * Unref/free "callback" and "partial" returned by get_callback(). */ void free_callback(char_u *callback, partial_T *partial) diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index 9de3ca01f9..59283d2723 100644 --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -1823,3 +1823,15 @@ func Test_list_args() call s:test_list_args('print("hello\"world\"")', 'hello"world"', 1) call s:test_list_args('print("hello\tworld")', "hello\tworld", 1) endfunc + +" Do this last, it stops any channel log. +func Test_zz_ch_log() + call ch_logfile('Xlog', 'w') + call ch_log('hello there') + call ch_log('%s%s') + call ch_logfile('') + let text = readfile('Xlog') + call assert_match("hello there", text[1]) + call assert_match("%s%s", text[2]) + call delete('Xlog') +endfunc diff --git a/src/version.c b/src/version.c index b29d64c825..44fb030fc9 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1666, /**/ 1665, /**/ From 51ad4eaa22e15cf1fe6c45d82c7e1371e00401a4 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 6 Apr 2018 11:14:11 +0200 Subject: [PATCH 13/26] Update runtime files --- runtime/doc/indent.txt | 13 +- runtime/doc/terminal.txt | 2 +- runtime/doc/todo.txt | 26 +- runtime/syntax/lisp.vim | 698 +++++++++++++++++++-------------------- runtime/syntax/ninja.vim | 26 +- runtime/syntax/sh.vim | 82 ++--- runtime/syntax/tex.vim | 48 ++- runtime/syntax/vim.vim | 140 ++++---- runtime/tools/shtags.pl | 12 +- 9 files changed, 560 insertions(+), 487 deletions(-) diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index efb0a7d792..5918300705 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -1,4 +1,4 @@ -*indent.txt* For Vim version 8.0. Last change: 2014 Dec 06 +*indent.txt* For Vim version 8.0. Last change: 2018 Apr 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -414,10 +414,10 @@ The examples below assume a 'shiftwidth' of 4. *cino-(* (N When in unclosed parentheses, indent N characters from the line with the unclosed parentheses. Add a 'shiftwidth' for every - unclosed parentheses. When N is 0 or the unclosed parentheses - is the first non-white character in its line, line up with the - next non-white character after the unclosed parentheses. - (default 'shiftwidth' * 2). + extra unclosed parentheses. When N is 0 or the unclosed + parentheses is the first non-white character in its line, line + up with the next non-white character after the unclosed + parentheses. (default 'shiftwidth' * 2). cino= cino=(0 > if (c1 && (c2 || if (c1 && (c2 || @@ -428,7 +428,8 @@ The examples below assume a 'shiftwidth' of 4. { { < *cino-u* - uN Same as (N, but for one level deeper. (default 'shiftwidth'). + uN Same as (N, but for one nesting level deeper. + (default 'shiftwidth'). cino= cino=u2 > if (c123456789 if (c123456789 diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index 8dc19cbf60..9a1c1d229c 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -1,4 +1,4 @@ -*terminal.txt* For Vim version 8.0. Last change: 2018 Mar 26 +*terminal.txt* For Vim version 8.0. Last change: 2018 Apr 05 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index f9fa06b42e..98304e8875 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 8.0. Last change: 2018 Mar 29 +*todo.txt* For Vim version 8.0. Last change: 2018 Apr 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -39,7 +39,12 @@ Terminal emulator window: - dump diff sometimes creates a different way of repeating. Example: https://api.travis-ci.org/v3/job/359102504/log.txt unclear why this can happen. +- Passing 'term' as $TERM doesn't work in GUI. - Still some stuff to implement and bugs to fix, see src/terminal.c +- GUI: problem with split window and sourcing the current buffer into python? + (Blay263, 2018 Mar 31) +- Terminal debugger: need a way to (re) open the source window, where current + position is displayed. Mode message isn't updated on vertical split. (Alexei Averchenko, 2018 Feb 2, #2611) @@ -50,18 +55,31 @@ Problem with sudo. #2758 Code refactoring, macro for message, #2729 +Fix for crash with non-dict argument to job options. (ichizok, #2765) + Patch to enforce c89 compliance. (James McCoy, #2735) With fix for Mac from Kazunobu. +Block insert doesn't work if the first line is auto-indented. (Christian +Brabandt, 2018 Apr 4, #2778) + Errors found with random data: heap-buffer-overflow in alist_add (#2472) Patch to avoid bad highlighting caused by #if. (ichizok, #2731) +Patch to make mkdir() more like the shell command. (James McCoy, #2775) + Implement option_save() and option_restore()? Or remove the help. +Patch for static analysis warnings. (Christian Brabandt, 2018 Apr 1, #2770) + +Patch to refactor ex_helpgrep. (Yegappan, #2766, 2018 Mar 30) +Also in email, take the one with a test. + Looks like an error for inserting register makes ":file other" not work. -(Tom M, 2018 Mar 28) +(Tom M, 2018 Mar 28) Reset did_emsg after inserting a register. +Or at the top of the loop? (Apr 4) Patch to fix mouse pointer after :tselect. (Hirohito Higashi, #2709) How to reproduce the problem? @@ -116,6 +134,7 @@ Patch to add more flags to :ls. (Marcin Szamotulski, #2751) Does setting 'cursorline' cause syntax highlighting to slow down? Perhaps is mess up the cache? (Mike Lee Williams, 2018 Jan 27, #2539) +Also: 'foldtext' is evaluated too often. (Daniel Hahler, #2773) When using :packadd files under "later" are not used, which is inconsistent with packages under "start". (xtal8, #1994) @@ -158,9 +177,6 @@ applying the diff, etc. User dictionary ~/.vim/spell/lang.utf-8.add not used for spell checking until a word is re-added to it. (Matej Cepl, 2018 Feb 6) -Problem with mouse scroll in tmux. (fcying, #2419) Might be caused by patch -8.0.1309. Removing "held_button = MOUSE_RELEASE;" helps. (2018 Feb 5) - Fold at end of the buffer behaves inconsistently. (James McCoy, 2017 Oct 9) With foldmethod=syntax and nofoldenable comment highlighting isn't removed. diff --git a/runtime/syntax/lisp.vim b/runtime/syntax/lisp.vim index b02eb09d0a..b6aa04b2c7 100644 --- a/runtime/syntax/lisp.vim +++ b/runtime/syntax/lisp.vim @@ -1,9 +1,9 @@ " Vim syntax file " Language: Lisp " Maintainer: Charles E. Campbell -" Last Change: May 02, 2016 -" Version: 26 -" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_LISP +" Last Change: Feb 15, 2018 +" Version: 27 +" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_LISP " " Thanks to F Xavier Noria for a list of 978 Common Lisp symbols taken from HyperSpec " Clisp additions courtesy of http://clisp.cvs.sourceforge.net/*checkout*/clisp/clisp/emacs/lisp.vim @@ -40,8 +40,8 @@ syn case ignore " --------------------------------------------------------------------- " Lists: {{{1 -syn match lispSymbol contained ![^()'`,"; \t]\+! -syn match lispBarSymbol contained !|..\{-}|! +syn match lispSymbol contained ![^()'`,"; \t]\+! +syn match lispBarSymbol contained !|..\{-}|! if exists("g:lisp_rainbow") && g:lisp_rainbow != 0 syn region lispParen0 matchgroup=hlLevel0 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen1 syn region lispParen1 contained matchgroup=hlLevel1 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen2 @@ -71,320 +71,320 @@ syn match lispLeadWhite contained "^\s\+" " --------------------------------------------------------------------- " Standard Lisp Functions and Macros: {{{1 -syn keyword lispFunc * find-method pprint-indent -syn keyword lispFunc ** find-package pprint-linear -syn keyword lispFunc *** find-restart pprint-logical-block -syn keyword lispFunc + find-symbol pprint-newline -syn keyword lispFunc ++ finish-output pprint-pop -syn keyword lispFunc +++ first pprint-tab -syn keyword lispFunc - fixnum pprint-tabular -syn keyword lispFunc / flet prin1 -syn keyword lispFunc // float prin1-to-string -syn keyword lispFunc /// float-digits princ -syn keyword lispFunc /= float-precision princ-to-string -syn keyword lispFunc 1+ float-radix print -syn keyword lispFunc 1- float-sign print-not-readable -syn keyword lispFunc < floating-point-inexact print-not-readable-object -syn keyword lispFunc <= floating-point-invalid-operation print-object -syn keyword lispFunc = floating-point-overflow print-unreadable-object -syn keyword lispFunc > floating-point-underflow probe-file -syn keyword lispFunc >= floatp proclaim -syn keyword lispFunc abort floor prog -syn keyword lispFunc abs fmakunbound prog* -syn keyword lispFunc access force-output prog1 -syn keyword lispFunc acons format prog2 -syn keyword lispFunc acos formatter progn -syn keyword lispFunc acosh fourth program-error -syn keyword lispFunc add-method fresh-line progv -syn keyword lispFunc adjoin fround provide -syn keyword lispFunc adjust-array ftruncate psetf -syn keyword lispFunc adjustable-array-p ftype psetq -syn keyword lispFunc allocate-instance funcall push -syn keyword lispFunc alpha-char-p function pushnew -syn keyword lispFunc alphanumericp function-keywords putprop -syn keyword lispFunc and function-lambda-expression quote -syn keyword lispFunc append functionp random -syn keyword lispFunc apply gbitp random-state -syn keyword lispFunc applyhook gcd random-state-p -syn keyword lispFunc apropos generic-function rassoc -syn keyword lispFunc apropos-list gensym rassoc-if -syn keyword lispFunc aref gentemp rassoc-if-not -syn keyword lispFunc arithmetic-error get ratio -syn keyword lispFunc arithmetic-error-operands get-decoded-time rational -syn keyword lispFunc arithmetic-error-operation get-dispatch-macro-character rationalize -syn keyword lispFunc array get-internal-real-time rationalp -syn keyword lispFunc array-dimension get-internal-run-time read -syn keyword lispFunc array-dimension-limit get-macro-character read-byte -syn keyword lispFunc array-dimensions get-output-stream-string read-char -syn keyword lispFunc array-displacement get-properties read-char-no-hang -syn keyword lispFunc array-element-type get-setf-expansion read-delimited-list -syn keyword lispFunc array-has-fill-pointer-p get-setf-method read-eval-print -syn keyword lispFunc array-in-bounds-p get-universal-time read-from-string -syn keyword lispFunc array-rank getf read-line -syn keyword lispFunc array-rank-limit gethash read-preserving-whitespace -syn keyword lispFunc array-row-major-index go read-sequence -syn keyword lispFunc array-total-size graphic-char-p reader-error -syn keyword lispFunc array-total-size-limit handler-bind readtable -syn keyword lispFunc arrayp handler-case readtable-case -syn keyword lispFunc ash hash-table readtablep -syn keyword lispFunc asin hash-table-count real -syn keyword lispFunc asinh hash-table-p realp -syn keyword lispFunc assert hash-table-rehash-size realpart -syn keyword lispFunc assoc hash-table-rehash-threshold reduce -syn keyword lispFunc assoc-if hash-table-size reinitialize-instance -syn keyword lispFunc assoc-if-not hash-table-test rem -syn keyword lispFunc atan host-namestring remf -syn keyword lispFunc atanh identity remhash -syn keyword lispFunc atom if remove -syn keyword lispFunc base-char if-exists remove-duplicates -syn keyword lispFunc base-string ignorable remove-if -syn keyword lispFunc bignum ignore remove-if-not -syn keyword lispFunc bit ignore-errors remove-method -syn keyword lispFunc bit-and imagpart remprop -syn keyword lispFunc bit-andc1 import rename-file -syn keyword lispFunc bit-andc2 in-package rename-package -syn keyword lispFunc bit-eqv in-package replace -syn keyword lispFunc bit-ior incf require -syn keyword lispFunc bit-nand initialize-instance rest -syn keyword lispFunc bit-nor inline restart -syn keyword lispFunc bit-not input-stream-p restart-bind -syn keyword lispFunc bit-orc1 inspect restart-case -syn keyword lispFunc bit-orc2 int-char restart-name -syn keyword lispFunc bit-vector integer return -syn keyword lispFunc bit-vector-p integer-decode-float return-from -syn keyword lispFunc bit-xor integer-length revappend -syn keyword lispFunc block integerp reverse -syn keyword lispFunc boole interactive-stream-p room -syn keyword lispFunc boole-1 intern rotatef -syn keyword lispFunc boole-2 internal-time-units-per-second round -syn keyword lispFunc boole-and intersection row-major-aref -syn keyword lispFunc boole-andc1 invalid-method-error rplaca -syn keyword lispFunc boole-andc2 invoke-debugger rplacd -syn keyword lispFunc boole-c1 invoke-restart safety -syn keyword lispFunc boole-c2 invoke-restart-interactively satisfies -syn keyword lispFunc boole-clr isqrt sbit -syn keyword lispFunc boole-eqv keyword scale-float -syn keyword lispFunc boole-ior keywordp schar -syn keyword lispFunc boole-nand labels search -syn keyword lispFunc boole-nor lambda second -syn keyword lispFunc boole-orc1 lambda-list-keywords sequence -syn keyword lispFunc boole-orc2 lambda-parameters-limit serious-condition -syn keyword lispFunc boole-set last set -syn keyword lispFunc boole-xor lcm set-char-bit -syn keyword lispFunc boolean ldb set-difference -syn keyword lispFunc both-case-p ldb-test set-dispatch-macro-character -syn keyword lispFunc boundp ldiff set-exclusive-or -syn keyword lispFunc break least-negative-double-float set-macro-character -syn keyword lispFunc broadcast-stream least-negative-long-float set-pprint-dispatch -syn keyword lispFunc broadcast-stream-streams least-negative-normalized-double-float set-syntax-from-char -syn keyword lispFunc built-in-class least-negative-normalized-long-float setf -syn keyword lispFunc butlast least-negative-normalized-short-float setq -syn keyword lispFunc byte least-negative-normalized-single-float seventh -syn keyword lispFunc byte-position least-negative-short-float shadow -syn keyword lispFunc byte-size least-negative-single-float shadowing-import -syn keyword lispFunc call-arguments-limit least-positive-double-float shared-initialize -syn keyword lispFunc call-method least-positive-long-float shiftf -syn keyword lispFunc call-next-method least-positive-normalized-double-float short-float -syn keyword lispFunc capitalize least-positive-normalized-long-float short-float-epsilon -syn keyword lispFunc car least-positive-normalized-short-float short-float-negative-epsilon -syn keyword lispFunc case least-positive-normalized-single-float short-site-name -syn keyword lispFunc catch least-positive-short-float signal -syn keyword lispFunc ccase least-positive-single-float signed-byte -syn keyword lispFunc cdr length signum -syn keyword lispFunc ceiling let simple-condition -syn keyword lispFunc cell-error let* simple-array -syn keyword lispFunc cell-error-name lisp simple-base-string -syn keyword lispFunc cerror lisp-implementation-type simple-bit-vector -syn keyword lispFunc change-class lisp-implementation-version simple-bit-vector-p -syn keyword lispFunc char list simple-condition-format-arguments -syn keyword lispFunc char-bit list* simple-condition-format-control -syn keyword lispFunc char-bits list-all-packages simple-error -syn keyword lispFunc char-bits-limit list-length simple-string -syn keyword lispFunc char-code listen simple-string-p -syn keyword lispFunc char-code-limit listp simple-type-error -syn keyword lispFunc char-control-bit load simple-vector -syn keyword lispFunc char-downcase load-logical-pathname-translations simple-vector-p -syn keyword lispFunc char-equal load-time-value simple-warning -syn keyword lispFunc char-font locally sin -syn keyword lispFunc char-font-limit log single-flaot-epsilon -syn keyword lispFunc char-greaterp logand single-float -syn keyword lispFunc char-hyper-bit logandc1 single-float-epsilon -syn keyword lispFunc char-int logandc2 single-float-negative-epsilon -syn keyword lispFunc char-lessp logbitp sinh -syn keyword lispFunc char-meta-bit logcount sixth -syn keyword lispFunc char-name logeqv sleep -syn keyword lispFunc char-not-equal logical-pathname slot-boundp -syn keyword lispFunc char-not-greaterp logical-pathname-translations slot-exists-p -syn keyword lispFunc char-not-lessp logior slot-makunbound -syn keyword lispFunc char-super-bit lognand slot-missing -syn keyword lispFunc char-upcase lognor slot-unbound -syn keyword lispFunc char/= lognot slot-value -syn keyword lispFunc char< logorc1 software-type -syn keyword lispFunc char<= logorc2 software-version -syn keyword lispFunc char= logtest some -syn keyword lispFunc char> logxor sort -syn keyword lispFunc char>= long-float space -syn keyword lispFunc character long-float-epsilon special -syn keyword lispFunc characterp long-float-negative-epsilon special-form-p -syn keyword lispFunc check-type long-site-name special-operator-p -syn keyword lispFunc cis loop speed -syn keyword lispFunc class loop-finish sqrt -syn keyword lispFunc class-name lower-case-p stable-sort -syn keyword lispFunc class-of machine-instance standard -syn keyword lispFunc clear-input machine-type standard-char -syn keyword lispFunc clear-output machine-version standard-char-p -syn keyword lispFunc close macro-function standard-class -syn keyword lispFunc clrhash macroexpand standard-generic-function -syn keyword lispFunc code-char macroexpand-1 standard-method -syn keyword lispFunc coerce macroexpand-l standard-object -syn keyword lispFunc commonp macrolet step -syn keyword lispFunc compilation-speed make-array storage-condition -syn keyword lispFunc compile make-array store-value -syn keyword lispFunc compile-file make-broadcast-stream stream -syn keyword lispFunc compile-file-pathname make-char stream-element-type -syn keyword lispFunc compiled-function make-concatenated-stream stream-error -syn keyword lispFunc compiled-function-p make-condition stream-error-stream -syn keyword lispFunc compiler-let make-dispatch-macro-character stream-external-format -syn keyword lispFunc compiler-macro make-echo-stream streamp -syn keyword lispFunc compiler-macro-function make-hash-table streamup -syn keyword lispFunc complement make-instance string -syn keyword lispFunc complex make-instances-obsolete string-capitalize -syn keyword lispFunc complexp make-list string-char -syn keyword lispFunc compute-applicable-methods make-load-form string-char-p -syn keyword lispFunc compute-restarts make-load-form-saving-slots string-downcase -syn keyword lispFunc concatenate make-method string-equal -syn keyword lispFunc concatenated-stream make-package string-greaterp -syn keyword lispFunc concatenated-stream-streams make-pathname string-left-trim -syn keyword lispFunc cond make-random-state string-lessp -syn keyword lispFunc condition make-sequence string-not-equal -syn keyword lispFunc conjugate make-string string-not-greaterp -syn keyword lispFunc cons make-string-input-stream string-not-lessp -syn keyword lispFunc consp make-string-output-stream string-right-strim -syn keyword lispFunc constantly make-symbol string-right-trim -syn keyword lispFunc constantp make-synonym-stream string-stream -syn keyword lispFunc continue make-two-way-stream string-trim -syn keyword lispFunc control-error makunbound string-upcase -syn keyword lispFunc copy-alist map string/= -syn keyword lispFunc copy-list map-into string< -syn keyword lispFunc copy-pprint-dispatch mapc string<= -syn keyword lispFunc copy-readtable mapcan string= -syn keyword lispFunc copy-seq mapcar string> -syn keyword lispFunc copy-structure mapcon string>= -syn keyword lispFunc copy-symbol maphash stringp -syn keyword lispFunc copy-tree mapl structure -syn keyword lispFunc cos maplist structure-class -syn keyword lispFunc cosh mask-field structure-object -syn keyword lispFunc count max style-warning -syn keyword lispFunc count-if member sublim -syn keyword lispFunc count-if-not member-if sublis -syn keyword lispFunc ctypecase member-if-not subseq -syn keyword lispFunc debug merge subsetp -syn keyword lispFunc decf merge-pathname subst -syn keyword lispFunc declaim merge-pathnames subst-if -syn keyword lispFunc declaration method subst-if-not -syn keyword lispFunc declare method-combination substitute -syn keyword lispFunc decode-float method-combination-error substitute-if -syn keyword lispFunc decode-universal-time method-qualifiers substitute-if-not -syn keyword lispFunc defclass min subtypep -syn keyword lispFunc defconstant minusp svref -syn keyword lispFunc defgeneric mismatch sxhash -syn keyword lispFunc define-compiler-macro mod symbol -syn keyword lispFunc define-condition most-negative-double-float symbol-function -syn keyword lispFunc define-method-combination most-negative-fixnum symbol-macrolet -syn keyword lispFunc define-modify-macro most-negative-long-float symbol-name -syn keyword lispFunc define-setf-expander most-negative-short-float symbol-package -syn keyword lispFunc define-setf-method most-negative-single-float symbol-plist -syn keyword lispFunc define-symbol-macro most-positive-double-float symbol-value -syn keyword lispFunc defmacro most-positive-fixnum symbolp -syn keyword lispFunc defmethod most-positive-long-float synonym-stream -syn keyword lispFunc defpackage most-positive-short-float synonym-stream-symbol -syn keyword lispFunc defparameter most-positive-single-float sys -syn keyword lispFunc defsetf muffle-warning system -syn keyword lispFunc defstruct multiple-value-bind t -syn keyword lispFunc deftype multiple-value-call tagbody -syn keyword lispFunc defun multiple-value-list tailp -syn keyword lispFunc defvar multiple-value-prog1 tan -syn keyword lispFunc delete multiple-value-seteq tanh -syn keyword lispFunc delete-duplicates multiple-value-setq tenth -syn keyword lispFunc delete-file multiple-values-limit terpri -syn keyword lispFunc delete-if name-char the -syn keyword lispFunc delete-if-not namestring third -syn keyword lispFunc delete-package nbutlast throw -syn keyword lispFunc denominator nconc time -syn keyword lispFunc deposit-field next-method-p trace -syn keyword lispFunc describe nil translate-logical-pathname -syn keyword lispFunc describe-object nintersection translate-pathname -syn keyword lispFunc destructuring-bind ninth tree-equal -syn keyword lispFunc digit-char no-applicable-method truename -syn keyword lispFunc digit-char-p no-next-method truncase -syn keyword lispFunc directory not truncate -syn keyword lispFunc directory-namestring notany two-way-stream -syn keyword lispFunc disassemble notevery two-way-stream-input-stream -syn keyword lispFunc division-by-zero notinline two-way-stream-output-stream -syn keyword lispFunc do nreconc type -syn keyword lispFunc do* nreverse type-error -syn keyword lispFunc do-all-symbols nset-difference type-error-datum -syn keyword lispFunc do-exeternal-symbols nset-exclusive-or type-error-expected-type -syn keyword lispFunc do-external-symbols nstring type-of -syn keyword lispFunc do-symbols nstring-capitalize typecase -syn keyword lispFunc documentation nstring-downcase typep -syn keyword lispFunc dolist nstring-upcase unbound-slot -syn keyword lispFunc dotimes nsublis unbound-slot-instance -syn keyword lispFunc double-float nsubst unbound-variable -syn keyword lispFunc double-float-epsilon nsubst-if undefined-function -syn keyword lispFunc double-float-negative-epsilon nsubst-if-not unexport -syn keyword lispFunc dpb nsubstitute unintern -syn keyword lispFunc dribble nsubstitute-if union -syn keyword lispFunc dynamic-extent nsubstitute-if-not unless -syn keyword lispFunc ecase nth unread -syn keyword lispFunc echo-stream nth-value unread-char -syn keyword lispFunc echo-stream-input-stream nthcdr unsigned-byte -syn keyword lispFunc echo-stream-output-stream null untrace -syn keyword lispFunc ed number unuse-package -syn keyword lispFunc eighth numberp unwind-protect -syn keyword lispFunc elt numerator update-instance-for-different-class -syn keyword lispFunc encode-universal-time nunion update-instance-for-redefined-class -syn keyword lispFunc end-of-file oddp upgraded-array-element-type -syn keyword lispFunc endp open upgraded-complex-part-type -syn keyword lispFunc enough-namestring open-stream-p upper-case-p -syn keyword lispFunc ensure-directories-exist optimize use-package -syn keyword lispFunc ensure-generic-function or use-value -syn keyword lispFunc eq otherwise user -syn keyword lispFunc eql output-stream-p user-homedir-pathname -syn keyword lispFunc equal package values -syn keyword lispFunc equalp package-error values-list -syn keyword lispFunc error package-error-package vector -syn keyword lispFunc etypecase package-name vector-pop -syn keyword lispFunc eval package-nicknames vector-push -syn keyword lispFunc eval-when package-shadowing-symbols vector-push-extend -syn keyword lispFunc evalhook package-use-list vectorp -syn keyword lispFunc evenp package-used-by-list warn -syn keyword lispFunc every packagep warning -syn keyword lispFunc exp pairlis when -syn keyword lispFunc export parse-error wild-pathname-p -syn keyword lispFunc expt parse-integer with-accessors -syn keyword lispFunc extended-char parse-namestring with-compilation-unit -syn keyword lispFunc fboundp pathname with-condition-restarts -syn keyword lispFunc fceiling pathname-device with-hash-table-iterator -syn keyword lispFunc fdefinition pathname-directory with-input-from-string -syn keyword lispFunc ffloor pathname-host with-open-file -syn keyword lispFunc fifth pathname-match-p with-open-stream -syn keyword lispFunc file-author pathname-name with-output-to-string -syn keyword lispFunc file-error pathname-type with-package-iterator -syn keyword lispFunc file-error-pathname pathname-version with-simple-restart -syn keyword lispFunc file-length pathnamep with-slots -syn keyword lispFunc file-namestring peek-char with-standard-io-syntax -syn keyword lispFunc file-position phase write -syn keyword lispFunc file-stream pi write-byte -syn keyword lispFunc file-string-length plusp write-char -syn keyword lispFunc file-write-date pop write-line -syn keyword lispFunc fill position write-sequence -syn keyword lispFunc fill-pointer position-if write-string -syn keyword lispFunc find position-if-not write-to-string -syn keyword lispFunc find-all-symbols pprint y-or-n-p -syn keyword lispFunc find-class pprint-dispatch yes-or-no-p -syn keyword lispFunc find-if pprint-exit-if-list-exhausted zerop -syn keyword lispFunc find-if-not pprint-fill +syn keyword lispFunc < find-method pprint-indent +syn keyword lispFunc <= find-package pprint-linear +syn keyword lispFunc = find-restart pprint-logical-block +syn keyword lispFunc > find-symbol pprint-newline +syn keyword lispFunc >= finish-output pprint-pop +syn keyword lispFunc - first pprint-tab +syn keyword lispFunc / fixnum pprint-tabular +syn keyword lispFunc /= flet prin1 +syn keyword lispFunc // float prin1-to-string +syn keyword lispFunc /// float-digits princ +syn keyword lispFunc * floating-point-inexact princ-to-string +syn keyword lispFunc ** floating-point-invalid-operation print +syn keyword lispFunc *** floating-point-overflow print-not-readable +syn keyword lispFunc + floating-point-underflow print-not-readable-object +syn keyword lispFunc ++ floatp print-object +syn keyword lispFunc +++ float-precision print-unreadable-object +syn keyword lispFunc 1- float-radix probe-file +syn keyword lispFunc 1+ float-sign proclaim +syn keyword lispFunc abort floor prog +syn keyword lispFunc abs fmakunbound prog* +syn keyword lispFunc access force-output prog1 +syn keyword lispFunc acons format prog2 +syn keyword lispFunc acos formatter progn +syn keyword lispFunc acosh fourth program-error +syn keyword lispFunc add-method fresh-line progv +syn keyword lispFunc adjoin fround provide +syn keyword lispFunc adjustable-array-p ftruncate psetf +syn keyword lispFunc adjust-array ftype psetq +syn keyword lispFunc allocate-instance funcall push +syn keyword lispFunc alpha-char-p function pushnew +syn keyword lispFunc alphanumericp function-keywords putprop +syn keyword lispFunc and function-lambda-expression quote +syn keyword lispFunc append functionp random +syn keyword lispFunc apply gbitp random-state +syn keyword lispFunc applyhook gcd random-state-p +syn keyword lispFunc apropos generic-function rassoc +syn keyword lispFunc apropos-list gensym rassoc-if +syn keyword lispFunc aref gentemp rassoc-if-not +syn keyword lispFunc arithmetic-error get ratio +syn keyword lispFunc arithmetic-error-operands get-decoded-time rational +syn keyword lispFunc arithmetic-error-operation get-dispatch-macro-character rationalize +syn keyword lispFunc array getf rationalp +syn keyword lispFunc array-dimension gethash read +syn keyword lispFunc array-dimension-limit get-internal-real-time read-byte +syn keyword lispFunc array-dimensions get-internal-run-time read-char +syn keyword lispFunc array-displacement get-macro-character read-char-no-hang +syn keyword lispFunc array-element-type get-output-stream-string read-delimited-list +syn keyword lispFunc array-has-fill-pointer-p get-properties reader-error +syn keyword lispFunc array-in-bounds-p get-setf-expansion read-eval-print +syn keyword lispFunc arrayp get-setf-method read-from-string +syn keyword lispFunc array-rank get-universal-time read-line +syn keyword lispFunc array-rank-limit go read-preserving-whitespace +syn keyword lispFunc array-row-major-index graphic-char-p read-sequence +syn keyword lispFunc array-total-size handler-bind readtable +syn keyword lispFunc array-total-size-limit handler-case readtable-case +syn keyword lispFunc ash hash-table readtablep +syn keyword lispFunc asin hash-table-count real +syn keyword lispFunc asinh hash-table-p realp +syn keyword lispFunc assert hash-table-rehash-size realpart +syn keyword lispFunc assoc hash-table-rehash-threshold reduce +syn keyword lispFunc assoc-if hash-table-size reinitialize-instance +syn keyword lispFunc assoc-if-not hash-table-test rem +syn keyword lispFunc atan host-namestring remf +syn keyword lispFunc atanh identity remhash +syn keyword lispFunc atom if remove +syn keyword lispFunc base-char if-exists remove-duplicates +syn keyword lispFunc base-string ignorable remove-if +syn keyword lispFunc bignum ignore remove-if-not +syn keyword lispFunc bit ignore-errors remove-method +syn keyword lispFunc bit-and imagpart remprop +syn keyword lispFunc bit-andc1 import rename-file +syn keyword lispFunc bit-andc2 incf rename-package +syn keyword lispFunc bit-eqv initialize-instance replace +syn keyword lispFunc bit-ior inline require +syn keyword lispFunc bit-nand in-package rest +syn keyword lispFunc bit-nor in-package restart +syn keyword lispFunc bit-not input-stream-p restart-bind +syn keyword lispFunc bit-orc1 inspect restart-case +syn keyword lispFunc bit-orc2 int-char restart-name +syn keyword lispFunc bit-vector integer return +syn keyword lispFunc bit-vector-p integer-decode-float return-from +syn keyword lispFunc bit-xor integer-length revappend +syn keyword lispFunc block integerp reverse +syn keyword lispFunc boole interactive-stream-p room +syn keyword lispFunc boole-1 intern rotatef +syn keyword lispFunc boole-2 internal-time-units-per-second round +syn keyword lispFunc boolean intersection row-major-aref +syn keyword lispFunc boole-and invalid-method-error rplaca +syn keyword lispFunc boole-andc1 invoke-debugger rplacd +syn keyword lispFunc boole-andc2 invoke-restart safety +syn keyword lispFunc boole-c1 invoke-restart-interactively satisfies +syn keyword lispFunc boole-c2 isqrt sbit +syn keyword lispFunc boole-clr keyword scale-float +syn keyword lispFunc boole-eqv keywordp schar +syn keyword lispFunc boole-ior labels search +syn keyword lispFunc boole-nand lambda second +syn keyword lispFunc boole-nor lambda-list-keywords sequence +syn keyword lispFunc boole-orc1 lambda-parameters-limit serious-condition +syn keyword lispFunc boole-orc2 last set +syn keyword lispFunc boole-set lcm set-char-bit +syn keyword lispFunc boole-xor ldb set-difference +syn keyword lispFunc both-case-p ldb-test set-dispatch-macro-character +syn keyword lispFunc boundp ldiff set-exclusive-or +syn keyword lispFunc break least-negative-double-float setf +syn keyword lispFunc broadcast-stream least-negative-long-float set-macro-character +syn keyword lispFunc broadcast-stream-streams least-negative-normalized-double-float set-pprint-dispatch +syn keyword lispFunc built-in-class least-negative-normalized-long-float setq +syn keyword lispFunc butlast least-negative-normalized-short-float set-syntax-from-char +syn keyword lispFunc byte least-negative-normalized-single-float seventh +syn keyword lispFunc byte-position least-negative-short-float shadow +syn keyword lispFunc byte-size least-negative-single-float shadowing-import +syn keyword lispFunc call-arguments-limit least-positive-double-float shared-initialize +syn keyword lispFunc call-method least-positive-long-float shiftf +syn keyword lispFunc call-next-method least-positive-normalized-double-float short-float +syn keyword lispFunc capitalize least-positive-normalized-long-float short-float-epsilon +syn keyword lispFunc car least-positive-normalized-short-float short-float-negative-epsilon +syn keyword lispFunc case least-positive-normalized-single-float short-site-name +syn keyword lispFunc catch least-positive-short-float signal +syn keyword lispFunc ccase least-positive-single-float signed-byte +syn keyword lispFunc cdr length signum +syn keyword lispFunc ceiling let simple-array +syn keyword lispFunc cell-error let* simple-base-string +syn keyword lispFunc cell-error-name lisp simple-bit-vector +syn keyword lispFunc cerror lisp-implementation-type simple-bit-vector-p +syn keyword lispFunc change-class lisp-implementation-version simple-condition +syn keyword lispFunc char list simple-condition-format-arguments +syn keyword lispFunc char< list* simple-condition-format-control +syn keyword lispFunc char<= list-all-packages simple-error +syn keyword lispFunc char= listen simple-string +syn keyword lispFunc char> list-length simple-string-p +syn keyword lispFunc char>= listp simple-type-error +syn keyword lispFunc char/= load simple-vector +syn keyword lispFunc character load-logical-pathname-translations simple-vector-p +syn keyword lispFunc characterp load-time-value simple-warning +syn keyword lispFunc char-bit locally sin +syn keyword lispFunc char-bits log single-flaot-epsilon +syn keyword lispFunc char-bits-limit logand single-float +syn keyword lispFunc char-code logandc1 single-float-epsilon +syn keyword lispFunc char-code-limit logandc2 single-float-negative-epsilon +syn keyword lispFunc char-control-bit logbitp sinh +syn keyword lispFunc char-downcase logcount sixth +syn keyword lispFunc char-equal logeqv sleep +syn keyword lispFunc char-font logical-pathname slot-boundp +syn keyword lispFunc char-font-limit logical-pathname-translations slot-exists-p +syn keyword lispFunc char-greaterp logior slot-makunbound +syn keyword lispFunc char-hyper-bit lognand slot-missing +syn keyword lispFunc char-int lognor slot-unbound +syn keyword lispFunc char-lessp lognot slot-value +syn keyword lispFunc char-meta-bit logorc1 software-type +syn keyword lispFunc char-name logorc2 software-version +syn keyword lispFunc char-not-equal logtest some +syn keyword lispFunc char-not-greaterp logxor sort +syn keyword lispFunc char-not-lessp long-float space +syn keyword lispFunc char-super-bit long-float-epsilon special +syn keyword lispFunc char-upcase long-float-negative-epsilon special-form-p +syn keyword lispFunc check-type long-site-name special-operator-p +syn keyword lispFunc cis loop speed +syn keyword lispFunc class loop-finish sqrt +syn keyword lispFunc class-name lower-case-p stable-sort +syn keyword lispFunc class-of machine-instance standard +syn keyword lispFunc clear-input machine-type standard-char +syn keyword lispFunc clear-output machine-version standard-char-p +syn keyword lispFunc close macroexpand standard-class +syn keyword lispFunc clrhash macroexpand-1 standard-generic-function +syn keyword lispFunc code-char macroexpand-l standard-method +syn keyword lispFunc coerce macro-function standard-object +syn keyword lispFunc commonp macrolet step +syn keyword lispFunc compilation-speed make-array storage-condition +syn keyword lispFunc compile make-array store-value +syn keyword lispFunc compiled-function make-broadcast-stream stream +syn keyword lispFunc compiled-function-p make-char stream-element-type +syn keyword lispFunc compile-file make-concatenated-stream stream-error +syn keyword lispFunc compile-file-pathname make-condition stream-error-stream +syn keyword lispFunc compiler-let make-dispatch-macro-character stream-external-format +syn keyword lispFunc compiler-macro make-echo-stream streamp +syn keyword lispFunc compiler-macro-function make-hash-table streamup +syn keyword lispFunc complement make-instance string +syn keyword lispFunc complex make-instances-obsolete string< +syn keyword lispFunc complexp make-list string<= +syn keyword lispFunc compute-applicable-methods make-load-form string= +syn keyword lispFunc compute-restarts make-load-form-saving-slots string> +syn keyword lispFunc concatenate make-method string>= +syn keyword lispFunc concatenated-stream make-package string/= +syn keyword lispFunc concatenated-stream-streams make-pathname string-capitalize +syn keyword lispFunc cond make-random-state string-char +syn keyword lispFunc condition make-sequence string-char-p +syn keyword lispFunc conjugate make-string string-downcase +syn keyword lispFunc cons make-string-input-stream string-equal +syn keyword lispFunc consp make-string-output-stream string-greaterp +syn keyword lispFunc constantly make-symbol string-left-trim +syn keyword lispFunc constantp make-synonym-stream string-lessp +syn keyword lispFunc continue make-two-way-stream string-not-equal +syn keyword lispFunc control-error makunbound string-not-greaterp +syn keyword lispFunc copy-alist map string-not-lessp +syn keyword lispFunc copy-list mapc stringp +syn keyword lispFunc copy-pprint-dispatch mapcan string-right-strim +syn keyword lispFunc copy-readtable mapcar string-right-trim +syn keyword lispFunc copy-seq mapcon string-stream +syn keyword lispFunc copy-structure maphash string-trim +syn keyword lispFunc copy-symbol map-into string-upcase +syn keyword lispFunc copy-tree mapl structure +syn keyword lispFunc cos maplist structure-class +syn keyword lispFunc cosh mask-field structure-object +syn keyword lispFunc count max style-warning +syn keyword lispFunc count-if member sublim +syn keyword lispFunc count-if-not member-if sublis +syn keyword lispFunc ctypecase member-if-not subseq +syn keyword lispFunc debug merge subsetp +syn keyword lispFunc decf merge-pathname subst +syn keyword lispFunc declaim merge-pathnames subst-if +syn keyword lispFunc declaration method subst-if-not +syn keyword lispFunc declare method-combination substitute +syn keyword lispFunc decode-float method-combination-error substitute-if +syn keyword lispFunc decode-universal-time method-qualifiers substitute-if-not +syn keyword lispFunc defclass min subtypep +syn keyword lispFunc defconstant minusp svref +syn keyword lispFunc defgeneric mismatch sxhash +syn keyword lispFunc define-compiler-macro mod symbol +syn keyword lispFunc define-condition most-negative-double-float symbol-function +syn keyword lispFunc define-method-combination most-negative-fixnum symbol-macrolet +syn keyword lispFunc define-modify-macro most-negative-long-float symbol-name +syn keyword lispFunc define-setf-expander most-negative-short-float symbolp +syn keyword lispFunc define-setf-method most-negative-single-float symbol-package +syn keyword lispFunc define-symbol-macro most-positive-double-float symbol-plist +syn keyword lispFunc defmacro most-positive-fixnum symbol-value +syn keyword lispFunc defmethod most-positive-long-float synonym-stream +syn keyword lispFunc defpackage most-positive-short-float synonym-stream-symbol +syn keyword lispFunc defparameter most-positive-single-float sys +syn keyword lispFunc defsetf muffle-warning system +syn keyword lispFunc defstruct multiple-value-bind t +syn keyword lispFunc deftype multiple-value-call tagbody +syn keyword lispFunc defun multiple-value-list tailp +syn keyword lispFunc defvar multiple-value-prog1 tan +syn keyword lispFunc delete multiple-value-seteq tanh +syn keyword lispFunc delete-duplicates multiple-value-setq tenth +syn keyword lispFunc delete-file multiple-values-limit terpri +syn keyword lispFunc delete-if name-char the +syn keyword lispFunc delete-if-not namestring third +syn keyword lispFunc delete-package nbutlast throw +syn keyword lispFunc denominator nconc time +syn keyword lispFunc deposit-field next-method-p trace +syn keyword lispFunc describe nil translate-logical-pathname +syn keyword lispFunc describe-object nintersection translate-pathname +syn keyword lispFunc destructuring-bind ninth tree-equal +syn keyword lispFunc digit-char no-applicable-method truename +syn keyword lispFunc digit-char-p no-next-method truncase +syn keyword lispFunc directory not truncate +syn keyword lispFunc directory-namestring notany two-way-stream +syn keyword lispFunc disassemble notevery two-way-stream-input-stream +syn keyword lispFunc division-by-zero notinline two-way-stream-output-stream +syn keyword lispFunc do nreconc type +syn keyword lispFunc do* nreverse typecase +syn keyword lispFunc do-all-symbols nset-difference type-error +syn keyword lispFunc documentation nset-exclusive-or type-error-datum +syn keyword lispFunc do-exeternal-symbols nstring type-error-expected-type +syn keyword lispFunc do-external-symbols nstring-capitalize type-of +syn keyword lispFunc dolist nstring-downcase typep +syn keyword lispFunc do-symbols nstring-upcase unbound-slot +syn keyword lispFunc dotimes nsublis unbound-slot-instance +syn keyword lispFunc double-float nsubst unbound-variable +syn keyword lispFunc double-float-epsilon nsubst-if undefined-function +syn keyword lispFunc double-float-negative-epsilon nsubst-if-not unexport +syn keyword lispFunc dpb nsubstitute unintern +syn keyword lispFunc dribble nsubstitute-if union +syn keyword lispFunc dynamic-extent nsubstitute-if-not unless +syn keyword lispFunc ecase nth unread +syn keyword lispFunc echo-stream nthcdr unread-char +syn keyword lispFunc echo-stream-input-stream nth-value unsigned-byte +syn keyword lispFunc echo-stream-output-stream null untrace +syn keyword lispFunc ed number unuse-package +syn keyword lispFunc eighth numberp unwind-protect +syn keyword lispFunc elt numerator update-instance-for-different-class +syn keyword lispFunc encode-universal-time nunion update-instance-for-redefined-class +syn keyword lispFunc end-of-file oddp upgraded-array-element-type +syn keyword lispFunc endp open upgraded-complex-part-type +syn keyword lispFunc enough-namestring open-stream-p upper-case-p +syn keyword lispFunc ensure-directories-exist optimize use-package +syn keyword lispFunc ensure-generic-function or user +syn keyword lispFunc eq otherwise user-homedir-pathname +syn keyword lispFunc eql output-stream-p use-value +syn keyword lispFunc equal package values +syn keyword lispFunc equalp package-error values-list +syn keyword lispFunc error package-error-package variable +syn keyword lispFunc etypecase package-name vector +syn keyword lispFunc eval package-nicknames vectorp +syn keyword lispFunc evalhook packagep vector-pop +syn keyword lispFunc eval-when package-shadowing-symbols vector-push +syn keyword lispFunc evenp package-used-by-list vector-push-extend +syn keyword lispFunc every package-use-list warn +syn keyword lispFunc exp pairlis warning +syn keyword lispFunc export parse-error when +syn keyword lispFunc expt parse-integer wild-pathname-p +syn keyword lispFunc extended-char parse-namestring with-accessors +syn keyword lispFunc fboundp pathname with-compilation-unit +syn keyword lispFunc fceiling pathname-device with-condition-restarts +syn keyword lispFunc fdefinition pathname-directory with-hash-table-iterator +syn keyword lispFunc ffloor pathname-host with-input-from-string +syn keyword lispFunc fifth pathname-match-p with-open-file +syn keyword lispFunc file-author pathname-name with-open-stream +syn keyword lispFunc file-error pathnamep with-output-to-string +syn keyword lispFunc file-error-pathname pathname-type with-package-iterator +syn keyword lispFunc file-length pathname-version with-simple-restart +syn keyword lispFunc file-namestring peek-char with-slots +syn keyword lispFunc file-position phase with-standard-io-syntax +syn keyword lispFunc file-stream pi write +syn keyword lispFunc file-string-length plusp write-byte +syn keyword lispFunc file-write-date pop write-char +syn keyword lispFunc fill position write-line +syn keyword lispFunc fill-pointer position-if write-sequence +syn keyword lispFunc find position-if-not write-string +syn keyword lispFunc find-all-symbols pprint write-to-string +syn keyword lispFunc find-class pprint-dispatch yes-or-no-p +syn keyword lispFunc find-if pprint-exit-if-list-exhausted y-or-n-p +syn keyword lispFunc find-if-not pprint-fill zerop syn match lispFunc "\" if exists("g:lispsyntax_clisp") @@ -563,50 +563,50 @@ syn sync lines=100 " Define Highlighting: {{{1 if !exists("skip_lisp_syntax_inits") - hi def link lispCommentRegion lispComment + hi def link lispCommentRegion lispComment hi def link lispAtomNmbr lispNumber hi def link lispAtomMark lispMark hi def link lispInStringString lispString - hi def link lispAtom Identifier - hi def link lispAtomBarSymbol Special + hi def link lispAtom Identifier + hi def link lispAtomBarSymbol Special hi def link lispBarSymbol Special hi def link lispComment Comment hi def link lispConcat Statement - hi def link lispDecl Statement - hi def link lispFunc Statement - hi def link lispKey Type - hi def link lispMark Delimiter + hi def link lispDecl Statement + hi def link lispFunc Statement + hi def link lispKey Type + hi def link lispMark Delimiter hi def link lispNumber Number hi def link lispParenError Error - hi def link lispEscapeSpecial Type + hi def link lispEscapeSpecial Type hi def link lispString String - hi def link lispTodo Todo - hi def link lispVar Statement + hi def link lispTodo Todo + hi def link lispVar Statement if exists("g:lisp_rainbow") && g:lisp_rainbow != 0 if &bg == "dark" - hi def hlLevel0 ctermfg=red guifg=red1 - hi def hlLevel1 ctermfg=yellow guifg=orange1 - hi def hlLevel2 ctermfg=green guifg=yellow1 - hi def hlLevel3 ctermfg=cyan guifg=greenyellow - hi def hlLevel4 ctermfg=magenta guifg=green1 - hi def hlLevel5 ctermfg=red guifg=springgreen1 - hi def hlLevel6 ctermfg=yellow guifg=cyan1 - hi def hlLevel7 ctermfg=green guifg=slateblue1 - hi def hlLevel8 ctermfg=cyan guifg=magenta1 - hi def hlLevel9 ctermfg=magenta guifg=purple1 + hi def hlLevel0 ctermfg=red guifg=red1 + hi def hlLevel1 ctermfg=yellow guifg=orange1 + hi def hlLevel2 ctermfg=green guifg=yellow1 + hi def hlLevel3 ctermfg=cyan guifg=greenyellow + hi def hlLevel4 ctermfg=magenta guifg=green1 + hi def hlLevel5 ctermfg=red guifg=springgreen1 + hi def hlLevel6 ctermfg=yellow guifg=cyan1 + hi def hlLevel7 ctermfg=green guifg=slateblue1 + hi def hlLevel8 ctermfg=cyan guifg=magenta1 + hi def hlLevel9 ctermfg=magenta guifg=purple1 else - hi def hlLevel0 ctermfg=red guifg=red3 - hi def hlLevel1 ctermfg=darkyellow guifg=orangered3 - hi def hlLevel2 ctermfg=darkgreen guifg=orange2 - hi def hlLevel3 ctermfg=blue guifg=yellow3 - hi def hlLevel4 ctermfg=darkmagenta guifg=olivedrab4 - hi def hlLevel5 ctermfg=red guifg=green4 - hi def hlLevel6 ctermfg=darkyellow guifg=paleturquoise3 - hi def hlLevel7 ctermfg=darkgreen guifg=deepskyblue4 - hi def hlLevel8 ctermfg=blue guifg=darkslateblue - hi def hlLevel9 ctermfg=darkmagenta guifg=darkviolet + hi def hlLevel0 ctermfg=red guifg=red3 + hi def hlLevel1 ctermfg=darkyellow guifg=orangered3 + hi def hlLevel2 ctermfg=darkgreen guifg=orange2 + hi def hlLevel3 ctermfg=blue guifg=yellow3 + hi def hlLevel4 ctermfg=darkmagenta guifg=olivedrab4 + hi def hlLevel5 ctermfg=red guifg=green4 + hi def hlLevel6 ctermfg=darkyellow guifg=paleturquoise3 + hi def hlLevel7 ctermfg=darkgreen guifg=deepskyblue4 + hi def hlLevel8 ctermfg=blue guifg=darkslateblue + hi def hlLevel9 ctermfg=darkmagenta guifg=darkviolet endif endif diff --git a/runtime/syntax/ninja.vim b/runtime/syntax/ninja.vim index f34588f60c..a53567e585 100644 --- a/runtime/syntax/ninja.vim +++ b/runtime/syntax/ninja.vim @@ -1,16 +1,16 @@ " ninja build file syntax. " Language: ninja build file as described at -" http://martine.github.com/ninja/manual.html -" Version: 1.4 -" Last Change: 2014/05/13 +" http://ninja-build.org/manual.html +" Version: 1.5 +" Last Change: 2018/04/05 " Maintainer: Nicolas Weber -" Version 1.4 of this script is in the upstream vim repository and will be +" Version 1.5 of this script is in the upstream vim repository and will be " included in the next vim release. If you change this, please send your change " upstream. " ninja lexer and parser are at -" https://github.com/martine/ninja/blob/master/src/lexer.in.cc -" https://github.com/martine/ninja/blob/master/src/manifest_parser.cc +" https://github.com/ninja-build/ninja/blob/master/src/lexer.in.cc +" https://github.com/ninja-build/ninja/blob/master/src/manifest_parser.cc if exists("b:current_syntax") finish @@ -21,7 +21,10 @@ set cpo&vim syn case match -syn match ninjaComment /#.*/ contains=@Spell +" Comments are only matched when the # is at the beginning of the line (with +" optional whitespace), as long as the prior line didn't end with a $ +" continuation. +syn match ninjaComment /\(\$\n\)\@" " limited set of magic variables, 'build' allows general " let assignments. " manifest_parser.cc, ParseRule() -syn region ninjaRule start="^rule" end="^\ze\S" contains=ALL transparent -syn keyword ninjaRuleCommand contained command deps depfile description generator +syn region ninjaRule start="^rule" end="^\ze\S" contains=TOP transparent +syn keyword ninjaRuleCommand contained containedin=ninjaRule command + \ deps depfile description generator \ pool restat rspfile rspfile_content -syn region ninjaPool start="^pool" end="^\ze\S" contains=ALL transparent -syn keyword ninjaPoolCommand contained depth +syn region ninjaPool start="^pool" end="^\ze\S" contains=TOP transparent +syn keyword ninjaPoolCommand contained containedin=ninjaPool depth " Strings are parsed as follows: " lexer.in.cc, ReadEvalString() diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 838c5eb4a7..a8258d725f 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,8 +2,8 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Charles E. Campbell " Previous Maintainer: Lennart Schultz -" Last Change: Oct 02, 2017 -" Version: 172 +" Last Change: Mar 19, 2018 +" Version: 174 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) @@ -121,7 +121,7 @@ syn case match " Clusters: contains=@... clusters {{{1 "================================== syn cluster shErrorList contains=shDoError,shIfError,shInError,shCaseError,shEsacError,shCurlyError,shParenError,shTestError,shOK -if exists("b:is_kornshell") +if exists("b:is_kornshell") || exists("b:is_bash") syn cluster ErrorList add=shDTestError endif syn cluster shArithParenList contains=shArithmetic,shCaseEsac,shComment,shDeref,shDo,shDerefSimple,shEcho,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shHereString,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement,shIf,shFor @@ -164,7 +164,7 @@ syn region shEmbeddedEcho contained matchgroup=shStatement start="\" ski " Alias: {{{1 " ===== -if exists("b:is_kornshell") || exists("b:is_bash") +if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix") syn match shStatement "\" syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]\+\)\@=" skip="\\$" end="\>\|`" syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]\+=\)\@=" skip="\\$" end="=" @@ -186,7 +186,7 @@ if !exists("g:sh_no_error") syn match shCurlyError "}" syn match shParenError ")" syn match shOK '\.\(done\|fi\|in\|esac\)' - if exists("b:is_kornshell") + if exists("b:is_kornshell") || exists("b:is_bash") syn match shDTestError "]]" endif syn match shTestError "]" @@ -245,12 +245,14 @@ ShFoldIfDoFor syn region shIf transparent matchgroup=shConditional start="\]\+\)\"" matchgroup=shHereDoc02 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\s*\z1\s*$" contains=@shDblQuoteList -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc04 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^']\+\)'" matchgroup=shHereDoc05 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc06 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^ \t|>]\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^ \t|>]\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\\\=\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<\s*\"\z([^ \t0-9|>]\+\)\"" matchgroup=shHereDoc02 end="^\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<-\s*\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc03 end="^\s*\z1\s*$" contains=@shDblQuoteList +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*'\z([^'0-9]\+\)'" matchgroup=shHereDoc04 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^'0-9]\+\)'" matchgroup=shHereDoc05 end="^\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\"\z([^ \t0-9|>]\+\)\"" matchgroup=shHereDoc06 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^ \t0-9|>]\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^ \t0-9|>]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^ \t0-9|>]\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^ \t0-9|>]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$" " Here Strings: {{{1 " ============= @@ -405,7 +406,7 @@ syn region shAtExpr contained start="@(" end=")" contains=@shIdList if exists("b:is_bash") syn region shSetList oneline matchgroup=shSet start="\<\(declare\|typeset\|local\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+#\|=" contains=@shIdList syn region shSetList oneline matchgroup=shSet start="\\ze[^/]" end="\ze[;|)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+=" contains=@shIdList -elseif exists("b:is_kornshell") +elseif exists("b:is_kornshell") || exists("b:is_posix") syn region shSetList oneline matchgroup=shSet start="\<\(typeset\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList syn region shSetList oneline matchgroup=shSet start="\\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList else @@ -439,14 +440,14 @@ syn region shDeref matchgroup=PreProc start="\${" end="}" contains=@shDerefList, syn match shDerefSimple "\$[-#*@!?]" nextgroup=@shNoZSList syn match shDerefSimple "\$\$" nextgroup=@shNoZSList syn match shDerefSimple "\${\d}" nextgroup=@shNoZSList -if exists("b:is_bash") || exists("b:is_kornshell") +if exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix") syn region shDeref matchgroup=PreProc start="\${##\=" end="}" contains=@shDerefList nextgroup=@shSpecialNoZS syn region shDeref matchgroup=PreProc start="\${\$\$" end="}" contains=@shDerefList nextgroup=@shSpecialNoZS endif " ksh: ${!var[*]} array index list syntax: {{{1 " ======================================== -if exists("b:is_kornshell") +if exists("b:is_kornshell") || exists("b:is_posix") syn region shDeref matchgroup=PreProc start="\${!" end="}" contains=@shDerefVarArray endif @@ -464,7 +465,7 @@ syn match shDerefSpecial contained "{\@<=[-*@?0]" nextgroup=shDerefOp,shDerefO syn match shDerefSpecial contained "\({[#!]\)\@<=[[:alnum:]*@_]\+" nextgroup=@shDerefVarList,shDerefOp syn match shDerefVar contained "{\@<=\h\w*" nextgroup=@shDerefVarList syn match shDerefVar contained '\d' nextgroup=@shDerefVarList -if exists("b:is_kornshell") +if exists("b:is_kornshell") || exists("b:is_posix") syn match shDerefVar contained "{\@<=\h\w*[[:alnum:]_.]*" nextgroup=@shDerefVarList endif @@ -490,7 +491,7 @@ if !exists("g:sh_no_error") endif syn match shDerefOp contained ":\=[-=?]" nextgroup=@shDerefPatternList syn match shDerefOp contained ":\=+" nextgroup=@shDerefPatternList -if exists("b:is_bash") || exists("b:is_kornshell") +if exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix") syn match shDerefOp contained "#\{1,2}" nextgroup=@shDerefPatternList syn match shDerefOp contained "%\{1,2}" nextgroup=@shDerefPatternList syn match shDerefPattern contained "[^{}]\+" contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape nextgroup=shDerefPattern @@ -537,7 +538,7 @@ endif " Useful ksh Keywords: {{{1 " ==================== -if exists("b:is_kornshell") || exists("b:is_bash") +if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix") syn keyword shStatement autoload bg false fc fg functions getopts hash history integer jobs let nohup printf r stop suspend times true type unalias whence if exists("b:is_posix") syn keyword shStatement command @@ -635,6 +636,7 @@ if !exists("skip_sh_syntax_inits") hi def link shSingleQuote shString hi def link shSource shOperator hi def link shStringSpecial shSpecial + hi def link shSpecialStart shSpecial hi def link shSubShRegion shOperator hi def link shTestOpr shConditional hi def link shTestPattern shString @@ -652,7 +654,7 @@ if !exists("skip_sh_syntax_inits") hi def link shDerefOff shDerefOp hi def link shDerefLen shDerefOff endif - if exists("b:is_kornshell") + if exists("b:is_kornshell") || exists("b:is_posix") hi def link kshSpecialVariables shShellVariables hi def link kshStatement shStatement endif @@ -669,7 +671,7 @@ if !exists("skip_sh_syntax_inits") hi def link shInError Error hi def link shParenError Error hi def link shTestError Error - if exists("b:is_kornshell") + if exists("b:is_kornshell") || exists("b:is_posix") hi def link shDTestError Error endif endif @@ -725,6 +727,8 @@ if exists("b:is_bash") let b:current_syntax = "bash" elseif exists("b:is_kornshell") let b:current_syntax = "ksh" +elseif exists("b:is_posix") + let b:current_syntax = "posix" else let b:current_syntax = "sh" endif diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim index 1d777f8022..d5f900ae5c 100644 --- a/runtime/syntax/tex.vim +++ b/runtime/syntax/tex.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: TeX " Maintainer: Charles E. Campbell -" Last Change: Dec 11, 2017 -" Version: 107 +" Last Change: Mar 30, 2018 +" Version: 109 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX " " Notes: {{{1 @@ -396,7 +396,7 @@ endif " Bad Math (mismatched): {{{1 if !exists("g:tex_no_math") && !s:tex_no_error - syn match texBadMath "\\end\s*{\s*\(array\|bBpvV]matrix\|split\|smallmatrix\)\s*}" + syn match texBadMath "\\end\s*{\s*\(array\|[bBpvV]matrix\|split\|smallmatrix\)\s*}" syn match texBadMath "\\end\s*{\s*\(displaymath\|equation\|eqnarray\|math\)\*\=\s*}" syn match texBadMath "\\[\])]" endif @@ -1012,6 +1012,48 @@ if has("conceal") && &enc == 'utf-8' syn match texMathSymbol '\\hat{y}' contained conceal cchar=š syn match texMathSymbol '\\hat{Y}' contained conceal cchar=Ĺś " syn match texMathSymbol '\\bar{a}' contained conceal cchar=a̅ + + syn match texMathSymbol '\\dot{B}' contained conceal cchar=Ḃ + syn match texMathSymbol '\\dot{b}' contained conceal cchar=ḃ + syn match texMathSymbol '\\dot{D}' contained conceal cchar=Ḋ + syn match texMathSymbol '\\dot{d}' contained conceal cchar=ḋ + syn match texMathSymbol '\\dot{F}' contained conceal cchar=Ḟ + syn match texMathSymbol '\\dot{f}' contained conceal cchar=ḟ + syn match texMathSymbol '\\dot{H}' contained conceal cchar=Ḣ + syn match texMathSymbol '\\dot{h}' contained conceal cchar=ḣ + syn match texMathSymbol '\\dot{M}' contained conceal cchar=Ṁ + syn match texMathSymbol '\\dot{m}' contained conceal cchar=ᚁ + syn match texMathSymbol '\\dot{N}' contained conceal cchar=Ṅ + syn match texMathSymbol '\\dot{n}' contained conceal cchar=ṅ + syn match texMathSymbol '\\dot{P}' contained conceal cchar=Ṗ + syn match texMathSymbol '\\dot{p}' contained conceal cchar=ṗ + syn match texMathSymbol '\\dot{R}' contained conceal cchar=ᚘ + syn match texMathSymbol '\\dot{r}' contained conceal cchar=ṙ + syn match texMathSymbol '\\dot{S}' contained conceal cchar=áš  + syn match texMathSymbol '\\dot{s}' contained conceal cchar=ᚥ + syn match texMathSymbol '\\dot{T}' contained conceal cchar=ᚪ + syn match texMathSymbol '\\dot{t}' contained conceal cchar=ᚍ + syn match texMathSymbol '\\dot{W}' contained conceal cchar=Ẇ + syn match texMathSymbol '\\dot{w}' contained conceal cchar=ẇ + syn match texMathSymbol '\\dot{X}' contained conceal cchar=Ẋ + syn match texMathSymbol '\\dot{x}' contained conceal cchar=ẋ + syn match texMathSymbol '\\dot{Y}' contained conceal cchar=Ẏ + syn match texMathSymbol '\\dot{y}' contained conceal cchar=ẏ + syn match texMathSymbol '\\dot{Z}' contained conceal cchar=Ĺť + syn match texMathSymbol '\\dot{z}' contained conceal cchar=Ĺź + + syn match texMathSymbol '\\dot{C}' contained conceal cchar=Ċ + syn match texMathSymbol '\\dot{c}' contained conceal cchar=ċ + syn match texMathSymbol '\\dot{E}' contained conceal cchar=Ė + syn match texMathSymbol '\\dot{e}' contained conceal cchar=ė + syn match texMathSymbol '\\dot{G}' contained conceal cchar=Ä  + syn match texMathSymbol '\\dot{g}' contained conceal cchar=ÄĄ + syn match texMathSymbol '\\dot{I}' contained conceal cchar=İ + + syn match texMathSymbol '\\dot{A}' contained conceal cchar=ČŚ + syn match texMathSymbol '\\dot{a}' contained conceal cchar=ȧ + syn match texMathSymbol '\\dot{O}' contained conceal cchar=ČŽ + syn match texMathSymbol '\\dot{o}' contained conceal cchar=ČŻ endif " Greek {{{2 diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 48b02970ed..012d2ae2a5 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -1,9 +1,9 @@ " Vim syntax file " Language: Vim 8.0 script " Maintainer: Charles E. Campbell -" Last Change: Dec 15, 2017 -" Version: 8.0-07 -" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM +" Last Change: February 13, 2018 +" Version: 8.0-12 +" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM " Automatically generated keyword lists: {{{1 " Quit when a syntax file was already loaded {{{2 @@ -24,9 +24,9 @@ syn keyword vimCommand contained ab argd[elete] as[cii] bd[elete] bo[tright] bre syn keyword vimCommand contained abc[lear] argdo au bel[owright] bp[revious] bro[wse] cNf[ile] cal[l] cd cfir[st] che[ckpath] clo[se] col[der] conf[irm] cs debug deletep delp diffp[atch] dj[ump] dr[op] ec em[enu] ene[w] filet fir[st] foldo[pen] grepa[dd] helpf[ind] i imapc[lear] j[oin] keepj[umps] lad[dexpr] lb[uffer] lcscope lfdo lgrepa[dd] lmak[e] loadk lp[revious] luado ma[rk] messages mod[e] nbc[lose] noautocmd nu[mber] opt[ions] pc[lose] popu[p] prof[ile] ptN[ext] ptn[ext] pw[d] pyf[ile] pyxfile rec[over] reg[isters] ri[ght] rubyf[ile] sIe sIr sav[eas] sbl[ast] sc scl scscope sf[ind] sge sgr sig sip sm[ap] sno[magic] sp[lit] spellu[ndo] src srn startg[replace] sun[hide] sw[apname] syntime tabN[ext] tabfir[st] tabo[nly] tc[l] th[row] tmapc[lear] tr[ewind] u[ndo] unl ve[rsion] vim[grep] vs[plit] win[size] wp[revious] wv[iminfo] xmenu xunmenu syn keyword vimCommand contained abo[veleft] arge[dit] bN[ext] bf[irst] br[ewind] bufdo c[hange] cat[ch] cdo cg[etfile] checkt[ime] cmapc[lear] colo[rscheme] cope[n] cscope debugg[reedy] deletl dep diffpu[t] dl ds[earch] echoe[rr] en[dif] ex filetype fix[del] for gui helpg[rep] ia in ju[mps] keepp[atterns] laddb[uffer] lbo[ttom] ld[o] lfir[st] lh[elpgrep] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mk[exrc] mz[scheme] nbs[tart] noh[lsearch] o[pen] ownsyntax pe[rl] pp[op] profd[el] pta[g] ptp[revious] py3 python3 q[uit] red[o] res[ize] rightb[elow] rundo sIg sN[ext] sbN[ext] sbm[odified] scI scp se[t] sfir[st] sgi sh[ell] sign sir sme snoreme spe[llgood] spellw[rong] sre[wind] srp startr[eplace] sunme sy t tabc[lose] tabl[ast] tabp[revious] tcld[o] tj[ump] tn[ext] try una[bbreviate] unlo[ckvar] verb[ose] vimgrepa[dd] wN[ext] winc[md] wq x[it] xnoreme xwininfo syn keyword vimCommand contained al[l] argg[lobal] b[uffer] bl[ast] brea[k] buffers cabc[lear] cb[uffer] ce[nter] cgetb[uffer] chi[story] cn[ext] com cp[revious] cstag delc[ommand] deletp di[splay] diffs[plit] dli[st] dsp[lit] echom[sg] endf[unction] exi[t] filt[er] fo[ld] fu[nction] gvim helpt[ags] iabc[lear] intro k lN[ext] laddf[ile] lc[d] le[ft] lg[etfile] lhi[story] lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mks[ession] mzf[ile] new nor ol[dfiles] p[rint] ped[it] pre[serve] promptf[ind] ptf[irst] ptr[ewind] py3do pythonx qa[ll] redi[r] ret[ab] ru[ntime] rv[iminfo] sIl sa[rgument] sb[uffer] sbn[ext] sce scr[iptnames] setf[iletype] sg sgl si sil[ent] sl[eep] smenu snoremenu spelld[ump] spr[evious] srg st[op] stj[ump] sunmenu syn tN[ext] tabd[o] tabm[ove] tabr[ewind] tclf[ile] tl[ast] tno[remap] ts[elect] undoj[oin] uns[ilent] vert[ical] viu[sage] w[rite] windo wqa[ll] xa[ll] xnoremenu y[ank] -syn keyword vimCommand contained ar[gs] argl[ocal] ba[ll] bm[odified] breaka[dd] bun[load] cad[dbuffer] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cnew[er] comc[lear] cpf[ile] cuna[bbrev] delel delf[unction] dif[fupdate] difft[his] do e[dit] echon endfo[r] exu[sage] fin[d] foldc[lose] g h[elp] hi if is[earch] kee[pmarks] lNf[ile] lan[guage] lch[dir] lefta[bove] lgetb[uffer] ll lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mksp[ell] +syn keyword vimCommand contained ar[gs] argl[ocal] ba[ll] bm[odified] breaka[dd] bun[load] cad[dbuffer] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cnew[er] comc[lear] cpf[ile] cuna[bbrev] delel delf[unction] dif[fupdate] difft[his] do e[dit] echon endfo[r] exu[sage] fin[d] foldc[lose] g h[elp] hi if is[earch] kee[pmarks] lNf[ile] lan[guage] lch[dir] lefta[bove] lgetb[uffer] ll lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mksp[ell] syn match vimCommand contained "\" -syn keyword vimStdPlugin contained DiffOrig Man N[ext] P[rint] S TOhtml XMLent XMLns +syn keyword vimStdPlugin contained DiffOrig Man N[ext] P[rint] S TOhtml XMLent XMLns " vimOptions are caught only when contained in a vimSet {{{2 syn keyword vimOption contained acd ambw arshape background ballooneval bg bomb bs cb ch cinoptions cms commentstring copyindent cscopepathcomp csprg cursorbind delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr go guifontset helpheight history hlsearch imactivatekey imi imstyle indentkeys isf isprint km laststatus lisp loadplugins lz mat maxmempattern mh mmp more mouses mzq number opendevice paragraphs penc pi previewheight printmbcharset pvw rdt renderoptions rl ru sbo scrollbind secure shcf shelltemp shortmess showtabline sj smd spell splitbelow ssl stl sw sxe tabpagemax tags tbs termguicolors tf title tms ts ttybuiltin tx undolevels vbs viewdir vop wd wic wildmode winheight wm wrapscan @@ -36,21 +36,21 @@ syn keyword vimOption contained al ar autoread backupcopy bdlay binary breakinde syn keyword vimOption contained aleph arab autowrite backupdir belloff bk bri bufhidden cdpath cindent cm colorcolumn completeopt cpoptions cscopetag csto debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn gtl guipty hi hkp ignorecase imcmdline imsf incsearch infercase isk keymap langmenu linebreak lm lsp makeef maxfuncdepth menc mls modelines mousehide mp nf oft pa patchmode pfn popt printexpr pt pyxversion regexpengine ri rop rulerformat scl scs sessionoptions shellquote shiftround showfulltag sidescrolloff smartindent sol spellsuggest sr stal sua swf syntax tagcase tbi term textauto tildeop tk top ttimeoutlen ttyscroll ul ur verbosefile viminfofile wb wh wildignore window winwidth wop writedelay syn keyword vimOption contained allowrevins arabic autowriteall backupext beval bkc briopt buflisted cedit cink cmdheight columns concealcursor cpt cscopetagorder csverb deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtt guitablabel hid hl im imd imst inde insertmode iskeyword keymodel langnoremap lines lmap luadll makeencoding maxmapdepth menuitems mm modifiable mousem mps nrformats ofu packpath path ph pp printfont pumheight qe relativenumber rightleft rs runtimepath scr sect sft shellredir shiftwidth showmatch signcolumn smarttab sp spf srr startofline suffixes switchbuf ta taglength tbidi termbidi textmode timeout tl tpm ttm ttytype undodir ut vfile virtualedit wc whichwrap wildignorecase winfixheight wiv wrap ws syn keyword vimOption contained altkeymap arabicshape aw backupskip bex bl brk buftype cf cinkeys cmdwinheight com conceallevel crb cscopeverbose cuc def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw guicursor guitabtooltip hidden hlg imactivatefunc imdisable imstatusfunc indentexpr is isp keywordprg langremap linespace lnr lw makeprg maxmem mfd mmd modified mousemodel msm nu omnifunc para pdev pheader preserveindent printheader pvh quoteescape remap rightleftcmd rtp sb scroll sections sh shellslash shm showmode siso smc spc spl ss statusline suffixesadd sws tabline tagrelative tbis termencoding textwidth timeoutlen tm tr tty tw undofile vb vi visualbell wcm wi wildmenu winfixwidth wiw wrapmargin ww -syn keyword vimOption contained ambiwidth ari awa balloondelay bexpr bo browsedir casemap cfu cino cmp comments confirm cryptmethod cspc cul define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guifont helpfile highlight hls +syn keyword vimOption contained ambiwidth ari awa balloondelay bexpr bo browsedir casemap cfu cino cmp comments confirm cryptmethod cspc cul define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guifont helpfile highlight hls " vimOptions: These are the turn-off setting variants {{{2 syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobinary nobomb nobuflisted nocin noconfirm nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noendofline noerrorbells noex nofen nofixendofline nofkmap nofsync noguipty nohk nohkp noic noim noimd noinf nois nolangnoremap nolazyredraw nolinebreak nolist noloadplugins nolrm noma nomagic noml nomodeline nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup syn keyword vimOption contained noai noaltkeymap noar noarabicshape noautochdir noautowrite noawa nobeval nobk nobreakindent nocf nocindent nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noemo noeol noesckeys noexpandtab nofic nofixeol nofoldenable nogd nohid nohkmap nohls noicon noimc noimdisable noinfercase nojoinspaces nolangremap nolbr nolisp nolnr nolpl nolz nomacatsui nomh nomod nomodifiable nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscrollbind nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows -syn keyword vimOption contained noakm noanti noarab noari noautoindent noautowriteall nobackup nobin nobl nobri noci nocompatible nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noemoji noequalalways noet noexrc nofileignorecase nofk nofs nogdefault nohidden nohkmapp nohlsearch noignorecase noimcmdline noincsearch noinsertmode nojs +syn keyword vimOption contained noakm noanti noarab noari noautoindent noautowriteall nobackup nobin nobl nobri noci nocompatible nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noemoji noequalalways noet noexrc nofileignorecase nofk nofs nogdefault nohidden nohkmapp nohlsearch noignorecase noimcmdline noincsearch noinsertmode nojs " vimOptions: These are the invertible variants {{{2 syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoread invaw invballooneval invbinary invbomb invbuflisted invcin invconfirm invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invendofline inverrorbells invex invfen invfixendofline invfkmap invfsync invguipty invhk invhkp invic invim invimd invinf invis invlangnoremap invlazyredraw invlinebreak invlist invloadplugins invlrm invma invmagic invml invmodeline invmodified invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup syn keyword vimOption contained invai invaltkeymap invar invarabicshape invautochdir invautowrite invawa invbeval invbk invbreakindent invcf invcindent invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invemo inveol invesckeys invexpandtab invfic invfixeol invfoldenable invgd invhid invhkmap invhls invicon invimc invimdisable invinfercase invjoinspaces invlangremap invlbr invlisp invlnr invlpl invlz invmacatsui invmh invmod invmodifiable invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscrollbind invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws -syn keyword vimOption contained invakm invanti invarab invari invautoindent invautowriteall invbackup invbin invbl invbri invci invcompatible invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible invemoji invequalalways invet invexrc invfileignorecase invfk invfs invgdefault invhidden invhkmapp invhlsearch invignorecase invimcmdline invincsearch invinsertmode invjs +syn keyword vimOption contained invakm invanti invarab invari invautoindent invautowriteall invbackup invbin invbl invbri invci invcompatible invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible invemoji invequalalways invet invexrc invfileignorecase invfk invfs invgdefault invhidden invhkmapp invhlsearch invignorecase invimcmdline invincsearch invinsertmode invjs " termcap codes (which can also be set) {{{2 syn keyword vimOption contained t_8b t_AB t_al t_bc t_BE t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_EI t_F2 t_F4 t_F6 t_F8 t_fs t_IE t_k1 t_k2 t_K3 t_K4 t_K5 t_K6 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_ke t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_PE t_PS t_RB t_RC t_RF t_RI t_RS t_RV t_Sb t_SC t_se t_Sf t_SH t_SI t_so t_sr t_SR t_te t_Te t_ti t_ts t_Ts t_u7 t_ue t_us t_ut t_vb t_ve t_vi t_vs t_VS t_WP t_WS t_xn t_xs t_ZH t_ZR -syn keyword vimOption contained t_8f t_AF t_AL t_BD t_cd t_Ce t_cm t_cs t_CS t_da t_dl t_EC t_F1 t_F3 t_F5 t_F7 t_F9 t_GP t_IS t_K1 t_k3 t_k4 t_k5 t_k6 t_k7 +syn keyword vimOption contained t_8f t_AF t_AL t_BD t_cd t_Ce t_cm t_cs t_CS t_da t_dl t_EC t_F1 t_F3 t_F5 t_F7 t_F9 t_GP t_IS t_K1 t_k3 t_k4 t_k5 t_k6 t_k7 syn match vimOption contained "t_%1" syn match vimOption contained "t_#2" syn match vimOption contained "t_#4" @@ -62,17 +62,17 @@ syn match vimOption contained "t_k;" " unsupported settings: some were supported by vi but don't do anything in vim {{{2 " others have been dropped along with msdos support -syn keyword vimErrSetting contained bioskey biosk conskey consk autoprint beautify flash graphic hardtabs mesg novice open op optimize redraw slow slowopen sourceany w300 w1200 w9600 hardtabs ht nobioskey nobiosk noconskey noconsk noautoprint nobeautify noflash nographic nohardtabs nomesg nonovice noopen noop nooptimize noredraw noslow noslowopen nosourceany now300 now1200 now9600 w1200 w300 w9600 +syn keyword vimErrSetting contained bioskey biosk conskey consk autoprint beautify flash graphic hardtabs mesg novice open op optimize redraw slow slowopen sourceany w300 w1200 w9600 hardtabs ht nobioskey nobiosk noconskey noconsk noautoprint nobeautify noflash nographic nohardtabs nomesg nonovice noopen noop nooptimize noredraw noslow noslowopen nosourceany now300 now1200 now9600 w1200 w300 w9600 " AutoCmd Events {{{2 syn case ignore -syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineEnter CmdlineLeave CmdUndefined CmdwinEnter CmdwinLeave ColorScheme CompleteDone CursorHold CursorHoldI CursorMoved CursorMovedI EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TermResponse TextChanged TextChangedI TextChangedP User VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave WinNew +syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineEnter CmdlineLeave CmdUndefined CmdwinEnter CmdwinLeave ColorScheme CompleteDone CursorHold CursorHoldI CursorMoved CursorMovedI EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TermResponse TextChanged TextChangedI User VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave WinNew " Highlight commonly used Groupnames {{{2 -syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo +syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo " Default highlighting groups {{{2 -syn keyword vimHLGroup contained ColorColumn Cursor CursorColumn CursorIM CursorLine CursorLineNr DiffAdd DiffChange DiffDelete DiffText Directory EndOfBuffer ErrorMsg FoldColumn Folded IncSearch LineNr MatchParen Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question QuickFixLine Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC TabLine TabLineFill TabLineSel Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu +syn keyword vimHLGroup contained ColorColumn Cursor CursorColumn CursorIM CursorLine CursorLineNr DiffAdd DiffChange DiffDelete DiffText Directory EndOfBuffer ErrorMsg FoldColumn Folded IncSearch LineNr MatchParen Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question QuickFixLine Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC TabLine TabLineFill TabLineSel Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu syn match vimHLGroup contained "Conceal" syn case match @@ -80,52 +80,52 @@ syn case match syn keyword vimFuncName contained abs append argv assert_fails assert_notequal atan browsedir bufname byte2line ceil ch_close ch_getbufnr ch_logfile ch_sendexpr cindent complete_add cos cursor diff_filler eval exepath extend filter floor foldclosed foldtextresult garbagecollect getbufvar getcmdline getcompletion getfperm getline getpos gettabinfo getwinposx glob2regpat haslocaldir histget hostname input inputsave isdirectory job_getchannel job_status js_encode len line2byte log10 mapcheck matcharg matchstr mkdir nr2char pow py3eval readfile remote_expr remote_send repeat screenattr search searchpos setbufvar setline setqflist setwinvar simplify soundfold sqrt strcharpart strftime string strridx submatch synID synstack tabpagebuflist tagfiles tanh term_getattr term_getline term_getstatus term_gettty term_sendkeys term_wait test_feedinput test_null_channel test_null_list test_override timer_pause timer_stopall tr undofile values wildmenumode win_findbuf winheight winline winrestview wordcount syn keyword vimFuncName contained acos argc asin assert_false assert_notmatch atan2 bufexists bufnr byteidx changenr ch_close_in ch_getjob ch_open ch_sendraw clearmatches complete_check cosh deepcopy diff_hlID eventhandler exists feedkeys finddir fmod foldclosedend foreground get getchar getcmdpos getcurpos getfsize getloclist getqflist gettabvar getwinposy globpath hasmapto histnr iconv inputdialog inputsecret islocked job_info job_stop json_decode libcall lispindent luaeval match matchdelete matchstrpos mode or prevnonblank pyeval reltime remote_foreground remote_startserver resolve screenchar searchdecl server2client setcharsearch setloclist setreg sha256 sin spellbadword str2float strchars strgetchar strlen strtrans substitute synIDattr system tabpagenr taglist tempname term_getcursor term_getscrolled term_gettitle term_list term_setsize test_alloc_fail test_garbagecollect_now test_null_dict test_null_partial test_settime timer_start tolower trunc undotree virtcol winbufnr win_getid win_id2tabwin winnr winsaveview writefile syn keyword vimFuncName contained add argidx assert_equal assert_inrange assert_report balloon_show buflisted bufwinid byteidxcomp char2nr ch_evalexpr ch_info ch_read ch_setoptions col confirm count delete empty executable exp filereadable findfile fnameescape foldlevel funcref getbufinfo getcharmod getcmdtype getcwd getftime getmatches getreg gettabwinvar getwinvar has histadd hlexists indent inputlist insert isnan job_setoptions join json_encode libcallnr localtime map matchadd matchend max mzeval pathshorten printf pyxeval reltimefloat remote_peek remove reverse screencol searchpair serverlist setcmdpos setmatches settabvar shellescape sinh spellsuggest str2nr strdisplaywidth stridx strpart strwidth synconcealed synIDtrans systemlist tabpagewinnr tan term_getaltscreen term_getjob term_getsize term_getttty term_scrape term_start test_autochdir test_ignore_error test_null_job test_null_string timer_info timer_stop toupper type uniq visualmode wincol win_gotoid win_id2win winrestcmd winwidth xor -syn keyword vimFuncName contained and arglistid assert_exception assert_match assert_true browse bufloaded bufwinnr call ch_canread ch_evalraw ch_log ch_readraw ch_status complete copy cscope_connection did_filetype escape execute expand filewritable float2nr fnamemodify foldtext function getbufline getcharsearch getcmdwintype getfontname getftype getpid getregtype getwininfo glob has_key histdel hlID index inputrestore invert items job_start js_decode keys line log maparg matchaddpos matchlist min nextnonblank perleval pumvisible range reltimestr remote_read rename round screenrow searchpairpos setbufline setfperm setpos settabwinvar shiftwidth sort split +syn keyword vimFuncName contained and arglistid assert_exception assert_match assert_true browse bufloaded bufwinnr call ch_canread ch_evalraw ch_log ch_readraw ch_status complete copy cscope_connection did_filetype escape execute expand filewritable float2nr fnamemodify foldtext function getbufline getcharsearch getcmdwintype getfontname getftype getpid getregtype getwininfo glob has_key histdel hlID index inputrestore invert items job_start js_decode keys line log maparg matchaddpos matchlist min nextnonblank perleval pumvisible range reltimestr remote_read rename round screenrow searchpairpos setbufline setfperm setpos settabwinvar shiftwidth sort split "--- syntax here and above generated by mkvimvim --- " Special Vim Highlighting (not automatic) {{{1 " Set up folding commands if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[aflmpPrt]' - if g:vimsyn_folding =~# 'a' - com! -nargs=* VimFolda fold - else - com! -nargs=* VimFolda + if g:vimsyn_folding =~# 'a' + com! -nargs=* VimFolda fold + else + com! -nargs=* VimFolda endif - if g:vimsyn_folding =~# 'f' - com! -nargs=* VimFoldf fold - else - com! -nargs=* VimFoldf + if g:vimsyn_folding =~# 'f' + com! -nargs=* VimFoldf fold + else + com! -nargs=* VimFoldf endif - if g:vimsyn_folding =~# 'l' - com! -nargs=* VimFoldl fold - else - com! -nargs=* VimFoldl + if g:vimsyn_folding =~# 'l' + com! -nargs=* VimFoldl fold + else + com! -nargs=* VimFoldl endif - if g:vimsyn_folding =~# 'm' - com! -nargs=* VimFoldm fold - else - com! -nargs=* VimFoldm + if g:vimsyn_folding =~# 'm' + com! -nargs=* VimFoldm fold + else + com! -nargs=* VimFoldm endif - if g:vimsyn_folding =~# 'p' - com! -nargs=* VimFoldp fold - else - com! -nargs=* VimFoldp + if g:vimsyn_folding =~# 'p' + com! -nargs=* VimFoldp fold + else + com! -nargs=* VimFoldp endif - if g:vimsyn_folding =~# 'P' - com! -nargs=* VimFoldP fold - else - com! -nargs=* VimFoldP + if g:vimsyn_folding =~# 'P' + com! -nargs=* VimFoldP fold + else + com! -nargs=* VimFoldP endif - if g:vimsyn_folding =~# 'r' - com! -nargs=* VimFoldr fold - else - com! -nargs=* VimFoldr + if g:vimsyn_folding =~# 'r' + com! -nargs=* VimFoldr fold + else + com! -nargs=* VimFoldr endif - if g:vimsyn_folding =~# 't' - com! -nargs=* VimFoldt fold - else - com! -nargs=* VimFoldt + if g:vimsyn_folding =~# 't' + com! -nargs=* VimFoldt fold + else + com! -nargs=* VimFoldt endif else com! -nargs=* VimFolda @@ -164,7 +164,7 @@ endif syn match vimNumber "\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand syn match vimNumber "-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand syn match vimNumber "\<0[xX]\x\+" -syn match vimNumber "\%(^\|[^a-zA-Z]\)\zs#\x\{6}" +syn match vimNumber "\%(^\|\A\)\zs#\x\{6}" " All vimCommands are contained by vimIsCommands. {{{2 syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimIsCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd @@ -214,7 +214,7 @@ syn keyword vimAugroupKey contained aug[roup] " Operators: {{{2 " ========= syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue -syn match vimOper "\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\(\\|\\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "||\|&&\|[-+.]" skipwhite nextgroup=vimString,vimSpecFile syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup @@ -321,7 +321,7 @@ syn region vimSubstPat contained matchgroup=vimSubstDelim start="\z([^a-zA-Z syn region vimSubstRep4 contained matchgroup=vimSubstDelim start="\z(.\)" skip="\\\\\|\\\z1" end="\z1" matchgroup=vimNotation end="<[cC][rR]>" contains=@vimSubstRepList nextgroup=vimSubstFlagErr oneline syn region vimCollection contained transparent start="\\\@" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs +syn match vimMapMod contained "\%#=1\c<\(buffer\|expr\|\(local\)\=leader\|nowait\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs syn match vimMapRhs contained ".*" contains=vimNotation,vimCtrlChar skipnl nextgroup=vimMapRhsExtend syn match vimMapRhsExtend contained "^\s*\\.*$" contains=vimContinue syn case ignore @@ -416,27 +416,27 @@ syn match vimMenuBang "!" contained skipwhite nextgroup=@vimMenuList " Angle-Bracket Notation (tnx to Michael Geddes) {{{2 " ====================== syn case ignore -syn match vimNotation "\(\\\|\)\=<\([scamd]-\)\{0,4}x\=\(f\d\{1,2}\|[^ \t:]\|cr\|lf\|linefeed\|return\|k\=del\%[ete]\|bs\|backspace\|tab\|esc\|right\|left\|help\|undo\|insert\|ins\|k\=home\|k\=end\|kplus\|kminus\|kdivide\|kmultiply\|kenter\|kpoint\|space\|k\=\(page\)\=\(\|down\|up\|k\d\>\)\)>" contains=vimBracket -syn match vimNotation "\(\\\|\)\=<\([scam2-4]-\)\{0,4}\(right\|left\|middle\)\(mouse\)\=\(drag\|release\)\=>" contains=vimBracket -syn match vimNotation "\(\\\|\)\=<\(bslash\|plug\|sid\|space\|bar\|nop\|nul\|lt\)>" contains=vimBracket -syn match vimNotation '\(\\\|\)\=[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket -syn match vimNotation '\(\\\|\)\=<\%(q-\)\=\(line[12]\|count\|bang\|reg\|args\|mods\|f-args\|f-mods\|lt\)>' contains=vimBracket -syn match vimNotation "\(\\\|\)\=<\([cas]file\|abuf\|amatch\|cword\|cWORD\|client\)>" contains=vimBracket +syn match vimNotation "\%#=1\(\\\|\)\=<\([scamd]-\)\{0,4}x\=\(f\d\{1,2}\|[^ \t:]\|cr\|lf\|linefeed\|return\|k\=del\%[ete]\|bs\|backspace\|tab\|esc\|right\|left\|help\|undo\|insert\|ins\|k\=home\|k\=end\|kplus\|kminus\|kdivide\|kmultiply\|kenter\|kpoint\|space\|k\=\(page\)\=\(\|down\|up\|k\d\>\)\)>" contains=vimBracket +syn match vimNotation "\%#=1\(\\\|\)\=<\([scam2-4]-\)\{0,4}\(right\|left\|middle\)\(mouse\)\=\(drag\|release\)\=>" contains=vimBracket +syn match vimNotation "\%#=1\(\\\|\)\=<\(bslash\|plug\|sid\|space\|bar\|nop\|nul\|lt\)>" contains=vimBracket +syn match vimNotation '\(\\\|\)\=[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket +syn match vimNotation '\%#=1\(\\\|\)\=<\%(q-\)\=\(line[12]\|count\|bang\|reg\|args\|mods\|f-args\|f-mods\|lt\)>' contains=vimBracket +syn match vimNotation "\%#=1\(\\\|\)\=<\([cas]file\|abuf\|amatch\|cword\|cWORD\|client\)>" contains=vimBracket syn match vimBracket contained "[\\<>]" syn case match " User Function Highlighting {{{2 " (following Gautam Iyer's suggestion) " ========================== -syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_]\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute -syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_]\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\" contains=vimNotation +syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute +syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\" contains=vimNotation syn match vimNotFunc "\\|\\|\\|\" " Errors And Warnings: {{{2 " ==================== if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror") syn match vimFunctionError "\s\zs[a-z0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank -" syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)[0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank +" syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\d\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank syn match vimElseIfErr "\" syn match vimBufnrWarn /\" +syn match vimSynKeyOpt contained "\%#=1\<\(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>" syn cluster vimFuncBodyList add=vimSynType " Syntax: match {{{2 syn cluster vimSynMtchGroup contains=vimMtchComment,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\h\w*" matchgroup=vimSep end="|\|$" contains=@vimSynMtchGroup -syn match vimSynMtchOpt contained "\<\(conceal\|transparent\|contained\|excludenl\|keepend\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>" +syn match vimSynMtchOpt contained "\%#=1\<\(conceal\|transparent\|contained\|excludenl\|keepend\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>" if has("conceal") syn match vimSynMtchOpt contained "\" +syn match vimSynRegOpt contained "\%#=1\<\(conceal\(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>" syn match vimSynReg contained "\(start\|skip\|end\)="he=e-1 nextgroup=vimSynRegPat syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup syn region vimSynRegPat contained extend start="\z([-`~!@#$%^&*_=+;:'",./?]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSynRegPatGroup skipwhite nextgroup=vimSynPatMod,vimSynReg -syn match vimSynPatMod contained "\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\=" -syn match vimSynPatMod contained "\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\=," nextgroup=vimSynPatMod +syn match vimSynPatMod contained "\%#=1\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\=" +syn match vimSynPatMod contained "\%#=1\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\=," nextgroup=vimSynPatMod syn match vimSynPatMod contained "lc=\d\+" syn match vimSynPatMod contained "lc=\d\+," nextgroup=vimSynPatMod syn region vimSynPatRange contained start="\[" skip="\\\\\|\\]" end="]" @@ -553,7 +553,7 @@ syn match vimIsCommand "\s*\a\+" transparent contains=vimCommand,vimNotatio " ============ syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,vimComment if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror") - syn match vimHiCtermError contained "[^0-9]\i*" + syn match vimHiCtermError contained "\D\i*" endif syn match vimHighlight "\" skipwhite nextgroup=vimHiBang,@vimHighlightCluster syn match vimHiBang contained "!" skipwhite nextgroup=@vimHighlightCluster @@ -645,6 +645,7 @@ if !filereadable(s:luapath) endif if (g:vimsyn_embed =~# 'l' && has("lua")) && filereadable(s:luapath) unlet! b:current_syntax + syn cluster vimFuncBodyList add=vimLuaRegion exe "syn include @vimLuaScript ".s:luapath VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimLuaScript VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*$+ end=+\.$+ contains=@vimLuaScript @@ -667,6 +668,7 @@ if !filereadable(s:perlpath) endif if (g:vimsyn_embed =~# 'p' && has("perl")) && filereadable(s:perlpath) unlet! b:current_syntax + syn cluster vimFuncBodyList add=vimPerlRegion exe "syn include @vimPerlScript ".s:perlpath VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPerlScript VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript @@ -688,6 +690,7 @@ if !filereadable(s:rubypath) endfor endif if (g:vimsyn_embed =~# 'r' && has("ruby")) && filereadable(s:rubypath) + syn cluster vimFuncBodyList add=vimRubyRegion unlet! b:current_syntax exe "syn include @vimRubyScript ".s:rubypath VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimRubyScript @@ -709,12 +712,13 @@ if !filereadable(s:pythonpath) endif endfor endif -if g:vimsyn_embed =~# 'P' && (has("python") || has("python3")) && filereadable(s:pythonpath) +if g:vimsyn_embed =~# 'P' && has("pythonx") && filereadable(s:pythonpath) unlet! b:current_syntax + syn cluster vimFuncBodyList add=vimPythonRegion exe "syn include @vimPythonScript ".s:pythonpath VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript - VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript + VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\=\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript syn cluster vimFuncBodyList add=vimPythonRegion else @@ -742,6 +746,7 @@ if s:trytcl endif if (g:vimsyn_embed =~# 't' && has("tcl")) && filereadable(s:tclpath) unlet! b:current_syntax + syn cluster vimFuncBodyList add=vimTclRegion exe "syn include @vimTclScript ".s:tclpath VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimTclScript VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*$+ end=+\.$+ contains=@vimTclScript @@ -770,6 +775,7 @@ endif if (g:vimsyn_embed =~# 'm' && has("mzscheme")) && filereadable(s:mzschemepath) unlet! b:current_syntax let s:iskKeep= &isk + syn cluster vimFuncBodyList add=vimMzSchemeRegion exe "syn include @vimMzSchemeScript ".s:mzschemepath let &isk= s:iskKeep unlet s:iskKeep diff --git a/runtime/tools/shtags.pl b/runtime/tools/shtags.pl index 48dcdc7476..79238fdb27 100755 --- a/runtime/tools/shtags.pl +++ b/runtime/tools/shtags.pl @@ -3,11 +3,12 @@ # shtags: create a tags file for perl scripts # # Author: Stephen Riehm -# Last Changed: 96/11/27 19:46:06 -# -# "@(#) shtags 1.1 by S. Riehm" +# Updated by: David Woodfall +# Last Changed: 2018/04/02 # +use Getopt::Std; + # obvious... :-) sub usage { @@ -30,7 +31,7 @@ sub version # # Version information # - @id = split( ', ', 'scripts/bin/shtags, /usr/local/, LOCAL_SCRIPTS, 1.1, 96/11/27, 19:46:06' ); + @id = split( ', ', 'scripts/bin/shtags, /usr/local/, LOCAL_SCRIPTS, 1.2, 18/04/02, 07:37' ); $id[0] =~ s,.*/,,; print <<_EOVERS; $id[0]: $id[3] @@ -45,12 +46,11 @@ _EOVERS # initialisations # ($program = $0) =~ s,.*/,,; -require 'getopts.pl'; # # parse command line # -&Getopts( "t:s:vVwx" ) || &usage(); +getopts( "t:s:vVwx" ) || &usage(); $tags_file = $opt_t || 'tags'; $explicit = $opt_x; $variable_tags = $opt_v; From 3680bab7e797444a7f41646888d9dd04b01c3816 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 6 Apr 2018 20:22:06 +0200 Subject: [PATCH 14/26] patch 8.0.1667: terminal window tests are flaky Problem: Terminal window tests are flaky. Solution: Increase the waiting time for Vim to start. --- src/testdir/screendump.vim | 5 +++-- src/version.c | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/testdir/screendump.vim b/src/testdir/screendump.vim index d4fae07425..764345a98c 100644 --- a/src/testdir/screendump.vim +++ b/src/testdir/screendump.vim @@ -59,8 +59,9 @@ func RunVimInTerminal(arguments, options) let buf = term_start(cmd, {'curwin': 1, 'term_rows': rows, 'term_cols': cols}) call assert_equal([rows, cols], term_getsize(buf)) - " Wait for the ruler (in the status line) to be shown. - call WaitFor({-> len(term_getline(buf, rows)) >= cols - 1}) + " Wait for "All" of the ruler in the status line to be shown. + " This can be quite slow (e.g. when using valgrind), wait up to 4 seconds. + call WaitFor({-> len(term_getline(buf, rows)) >= cols - 1}, 4000) return buf endfunc diff --git a/src/version.c b/src/version.c index 44fb030fc9..c625b05c16 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1667, /**/ 1666, /**/ From c4b533e1e93151658cb170c6796d327a8c0f8612 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 6 Apr 2018 22:26:25 +0200 Subject: [PATCH 15/26] patch 8.0.1668: terminal debugger: can't re-open source code window Problem: Terminal debugger: can't re-open source code window. Solution: Add the :Source command. Also create the window if needed when gdb stops at a source line. --- runtime/doc/terminal.txt | 11 ++- .../dist/opt/termdebug/plugin/termdebug.vim | 72 +++++++++++-------- src/version.c | 2 + 3 files changed, 53 insertions(+), 32 deletions(-) diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index 9a1c1d229c..2d1af11266 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -731,6 +731,11 @@ to have the 'mouse' option set to enable mouse clicks. You can add the window toolbar in other windows you open with: > :Winbar +If gdb stops at a source line and there is no window currently showing the +source code, a new window will be created for the source code. This also +happens if the buffer in the source code window has been modified and can't be +abandoned. + Inspecting variables ~ *termdebug-variables* @@ -745,8 +750,10 @@ You can usually shorten `:Evaluate` to `:Ev`. Other commands ~ *termdebug-commands* - :Gdb jump to the gdb window - :Program jump to the window with the running program + :Gdb jump to the gdb window + :Program jump to the window with the running program + :Source jump to the window with the source code, create it if there + isn't one Communication ~ diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 086a8f1ecf..256f7ef60c 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -246,6 +246,7 @@ func s:InstallCommands() command -range -nargs=* Evaluate call s:Evaluate(, ) command Gdb call win_gotoid(s:gdbwin) command Program call win_gotoid(s:ptywin) + command Source call s:GotoStartwinOrCreateIt() command Winbar call s:InstallWinbar() " TODO: can the K mapping be restored? @@ -269,13 +270,15 @@ let s:winbar_winids = [] " Install the window toolbar in the current window. func s:InstallWinbar() - nnoremenu WinBar.Step :Step - nnoremenu WinBar.Next :Over - nnoremenu WinBar.Finish :Finish - nnoremenu WinBar.Cont :Continue - nnoremenu WinBar.Stop :Stop - nnoremenu WinBar.Eval :Evaluate - call add(s:winbar_winids, win_getid(winnr())) + if has('menu') && &mouse != '' + nnoremenu WinBar.Step :Step + nnoremenu WinBar.Next :Over + nnoremenu WinBar.Finish :Finish + nnoremenu WinBar.Cont :Continue + nnoremenu WinBar.Stop :Stop + nnoremenu WinBar.Eval :Evaluate + call add(s:winbar_winids, win_getid(winnr())) + endif endfunc " Delete installed debugger commands in the current window. @@ -450,6 +453,14 @@ func s:HandleError(msg) echoerr substitute(a:msg, '.*msg="\(.*\)"', '\1', '') endfunc +func s:GotoStartwinOrCreateIt() + if !win_gotoid(s:startwin) + new + let s:startwin = win_getid(winnr()) + call s:InstallWinbar() + endif +endfunc + " Handle stopping and running message from gdb. " Will update the sign that shows the current position. func s:HandleCursor(msg) @@ -461,31 +472,32 @@ func s:HandleCursor(msg) let s:stopped = 0 endif - if win_gotoid(s:startwin) - let fname = substitute(a:msg, '.*fullname="\([^"]*\)".*', '\1', '') - if a:msg =~ '^\(\*stopped\|=thread-selected\)' && filereadable(fname) - let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '') - if lnum =~ '^[0-9]*$' - if expand('%:p') != fnamemodify(fname, ':p') - if &modified - " TODO: find existing window - exe 'split ' . fnameescape(fname) - let s:startwin = win_getid(winnr()) - else - exe 'edit ' . fnameescape(fname) - endif - endif - exe lnum - exe 'sign unplace ' . s:pc_id - exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC file=' . fname - setlocal signcolumn=yes - endif - else - exe 'sign unplace ' . s:pc_id - endif + call s:GotoStartwinOrCreateIt() - call win_gotoid(wid) + let fname = substitute(a:msg, '.*fullname="\([^"]*\)".*', '\1', '') + if a:msg =~ '^\(\*stopped\|=thread-selected\)' && filereadable(fname) + let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '') + if lnum =~ '^[0-9]*$' + if expand('%:p') != fnamemodify(fname, ':p') + if &modified + " TODO: find existing window + exe 'split ' . fnameescape(fname) + let s:startwin = win_getid(winnr()) + call s:InstallWinbar() + else + exe 'edit ' . fnameescape(fname) + endif + endif + exe lnum + exe 'sign unplace ' . s:pc_id + exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC file=' . fname + setlocal signcolumn=yes + endif + else + exe 'sign unplace ' . s:pc_id endif + + call win_gotoid(wid) endfunc " Handle setting a breakpoint diff --git a/src/version.c b/src/version.c index c625b05c16..33bae20366 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1668, /**/ 1667, /**/ From e1bb879f49665bb828197135b80aaf72cc190073 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 6 Apr 2018 22:58:23 +0200 Subject: [PATCH 16/26] patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list Problem: :vimgrep may add entries to the wrong quickfix list. Solution: Use the list identifier. (Yegappan Lakshmanan) --- src/quickfix.c | 88 +++++++++++++++-------------------- src/testdir/test_quickfix.vim | 41 ++++++++++++++++ src/version.c | 2 + 3 files changed, 80 insertions(+), 51 deletions(-) diff --git a/src/quickfix.c b/src/quickfix.c index f32dcff05a..e5bd2d0f00 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -4159,6 +4159,21 @@ ex_cfile(exarg_T *eap) qf_jump(qi, 0, 0, eap->forceit); /* display first error */ } +/* + * Return the quickfix/location list number with the given identifier. + * Returns -1 if list is not found. + */ + static int +qf_id2nr(qf_info_T *qi, int_u qfid) +{ + int qf_idx; + + for (qf_idx = 0; qf_idx < qi->qf_listcount; qf_idx++) + if (qi->qf_lists[qf_idx].qf_id == qfid) + return qf_idx; + return -1; +} + /* * Return the vimgrep autocmd name. */ @@ -4272,40 +4287,32 @@ vgr_load_dummy_buf( */ static int vgr_qflist_valid( + win_T *wp, qf_info_T *qi, - int_u save_qfid, - qfline_T *cur_qf_start, - int loclist_cmd, + int_u qfid, char_u *title) { - if (loclist_cmd) + /* Verify that the quickfix/location list was not freed by an autocmd */ + if (!qflist_valid(wp, qfid)) { - /* - * Verify that the location list is still valid. An autocmd might - * have freed the location list. - */ - if (!qflist_valid(curwin, save_qfid)) + if (wp != NULL) { + /* An autocmd has freed the location list. */ EMSG(_(e_loc_list_changed)); return FALSE; } + else + { + /* Quickfix list is not found, create a new one. */ + qf_new_list(qi, title); + return TRUE; + } } - if (cur_qf_start != qi->qf_lists[qi->qf_curlist].qf_start) - { - int idx; + if (qi->qf_lists[qi->qf_curlist].qf_id != qfid) /* Autocommands changed the quickfix list. Find the one we were * using and restore it. */ - for (idx = 0; idx < LISTCOUNT; ++idx) - if (cur_qf_start == qi->qf_lists[idx].qf_start) - { - qi->qf_curlist = idx; - break; - } - if (idx == LISTCOUNT) - /* List cannot be found, create a new one. */ - qf_new_list(qi, title); - } + qi->qf_curlist = qf_id2nr(qi, qfid); return TRUE; } @@ -4424,10 +4431,8 @@ ex_vimgrep(exarg_T *eap) char_u *p; int fi; qf_info_T *qi = &ql_info; - int loclist_cmd = FALSE; int_u save_qfid; - qfline_T *cur_qf_start; - win_T *wp; + win_T *wp = NULL; buf_T *buf; int duplicate_name = FALSE; int using_dummy; @@ -4461,7 +4466,7 @@ ex_vimgrep(exarg_T *eap) qi = ll_get_or_alloc_list(curwin); if (qi == NULL) return; - loclist_cmd = TRUE; + wp = curwin; } if (eap->addr_count > 0) @@ -4518,10 +4523,9 @@ ex_vimgrep(exarg_T *eap) * ":lcd %:p:h" changes the meaning of short path names. */ mch_dirname(dirname_start, MAXPATHL); - /* Remember the current values of the quickfix list and qf_start, so that - * we can check for autocommands changing the current quickfix list. */ + /* Remember the current quickfix list identifier, so that we can check for + * autocommands changing the current quickfix list. */ save_qfid = qi->qf_lists[qi->qf_curlist].qf_id; - cur_qf_start = qi->qf_lists[qi->qf_curlist].qf_start; seconds = (time_t)0; for (fi = 0; fi < fcount && !got_int && tomatch > 0; ++fi) @@ -4549,11 +4553,11 @@ ex_vimgrep(exarg_T *eap) /* Use existing, loaded buffer. */ using_dummy = FALSE; - /* Check whether the quickfix list is still valid */ - if (!vgr_qflist_valid(qi, save_qfid, cur_qf_start, loclist_cmd, - *eap->cmdlinep)) + /* Check whether the quickfix list is still valid. When loading a + * buffer above, autocommands might have changed the quickfix list. */ + if (!vgr_qflist_valid(wp, qi, save_qfid, *eap->cmdlinep)) goto theend; - cur_qf_start = qi->qf_lists[qi->qf_curlist].qf_start; + save_qfid = qi->qf_lists[qi->qf_curlist].qf_id; if (buf == NULL) { @@ -4567,8 +4571,6 @@ ex_vimgrep(exarg_T *eap) found_match = vgr_match_buflines(qi, fname, buf, ®match, tomatch, duplicate_name, flags); - cur_qf_start = qi->qf_lists[qi->qf_curlist].qf_start; - if (using_dummy) { if (found_match && first_match_buf == NULL) @@ -4649,7 +4651,6 @@ ex_vimgrep(exarg_T *eap) * The QuickFixCmdPost autocmd may free the quickfix list. Check the list * is still valid. */ - wp = loclist_cmd ? curwin : NULL; if (!qflist_valid(wp, save_qfid)) goto theend; @@ -4994,21 +4995,6 @@ qf_get_list_from_lines(dict_T *what, dictitem_T *di, dict_T *retdict) return status; } -/* - * Return the quickfix/location list number with the given identifier. - * Returns -1 if list is not found. - */ - static int -qf_id2nr(qf_info_T *qi, int_u qfid) -{ - int qf_idx; - - for (qf_idx = 0; qf_idx < qi->qf_listcount; qf_idx++) - if (qi->qf_lists[qf_idx].qf_id == qfid) - return qf_idx; - return -1; -} - /* * Return the quickfix/location list window identifier in the current tabpage. */ diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index 71aa7d5b19..070582dfbe 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -3111,3 +3111,44 @@ func Test_qfwin_pos() call assert_equal(3, winnr()) close endfunc + +" Tests for quickfix/location lists changed by autocommands when +" :vimgrep/:lvimgrep commands are running. +func Test_vimgrep_autocmd() + call setqflist([], 'f') + call writefile(['stars'], 'Xtest1.txt') + call writefile(['stars'], 'Xtest2.txt') + + " Test 1: + " When searching for a pattern using :vimgrep, if the quickfix list is + " changed by an autocmd, the results should be added to the correct quickfix + " list. + autocmd BufRead Xtest2.txt cexpr '' | cexpr '' + silent vimgrep stars Xtest*.txt + call assert_equal(1, getqflist({'nr' : 0}).nr) + call assert_equal(3, getqflist({'nr' : '$'}).nr) + call assert_equal('Xtest2.txt', bufname(getqflist()[1].bufnr)) + au! BufRead Xtest2.txt + + " Test 2: + " When searching for a pattern using :vimgrep, if the quickfix list is + " freed, then a error should be given. + silent! %bwipe! + call setqflist([], 'f') + autocmd BufRead Xtest2.txt for i in range(10) | cexpr '' | endfor + call assert_fails('vimgrep stars Xtest*.txt', 'E925:') + au! BufRead Xtest2.txt + + " Test 3: + " When searching for a pattern using :lvimgrep, if the location list is + " freed, then the command should error out. + silent! %bwipe! + let g:save_winid = win_getid() + autocmd BufRead Xtest2.txt call setloclist(g:save_winid, [], 'f') + call assert_fails('lvimgrep stars Xtest*.txt', 'E926:') + au! BufRead Xtest2.txt + + call delete('Xtest1.txt') + call delete('Xtest2.txt') + call setqflist([], 'f') +endfunc diff --git a/src/version.c b/src/version.c index 33bae20366..813bcfac2c 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1669, /**/ 1668, /**/ From b6ed74fef8e088128c45928ee7d02458b2882c1e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 7 Apr 2018 10:42:14 +0200 Subject: [PATCH 17/26] patch 8.0.1670: terminal window tests are still a bit flaky Problem: Terminal window tests are still a bit flaky. Solution: Increase the waiting time for the buffer to be created. --- src/testdir/test_terminal.vim | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 218b4ca6f6..cd7a2b21e9 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -1061,7 +1061,7 @@ func Api_drop_common(options) \ "set t_ts=", \ ], 'Xscript') let buf = RunVimInTerminal('-S Xscript', {}) - call WaitFor({-> bufnr('Xtextfile') > 0}) + call WaitFor({-> bufnr('Xtextfile') > 0}, 2000) call assert_equal('Xtextfile', expand('%:t')) call assert_true(winnr('$') >= 3) return buf diff --git a/src/version.c b/src/version.c index 813bcfac2c..59ca7a8fde 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1670, /**/ 1669, /**/ From 22efba47deb7e504142487fdc1617ec638cf0683 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 7 Apr 2018 13:22:21 +0200 Subject: [PATCH 18/26] patch 8.0.1671: crash when passing non-dict argument as env to job_start() Problem: Crash when passing non-dict argument as env to job_start(). Solution: Check for valid argument. (Ozaki Kiichi, closes #2765) --- src/channel.c | 8 +++++++- src/testdir/test_channel.vim | 11 +++++++---- src/version.c | 2 ++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/channel.c b/src/channel.c index 38e639224c..581c6f603f 100644 --- a/src/channel.c +++ b/src/channel.c @@ -4797,9 +4797,15 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) { if (!(supported2 & JO2_ENV)) break; + if (item->v_type != VAR_DICT) + { + EMSG2(_(e_invargval), "env"); + return FAIL; + } opt->jo_set2 |= JO2_ENV; opt->jo_env = item->vval.v_dict; - ++item->vval.v_dict->dv_refcount; + if (opt->jo_env != NULL) + ++opt->jo_env->dv_refcount; } else if (STRCMP(hi->hi_key, "cwd") == 0) { diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index 59283d2723..235312e1de 100644 --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -1720,10 +1720,12 @@ func Test_env() let g:envstr = '' if has('win32') - call job_start(['cmd', '/c', 'echo %FOO%'], {'callback': {ch,msg->execute(":let g:envstr .= msg")}, 'env':{'FOO': 'bar'}}) + let cmd = ['cmd', '/c', 'echo %FOO%'] else - call job_start([&shell, &shellcmdflag, 'echo $FOO'], {'callback': {ch,msg->execute(":let g:envstr .= msg")}, 'env':{'FOO': 'bar'}}) + let cmd = [&shell, &shellcmdflag, 'echo $FOO'] endif + call assert_fails('call job_start(cmd, {"env": 1})', 'E475:') + call job_start(cmd, {'callback': {ch,msg -> execute(":let g:envstr .= msg")}, 'env': {'FOO': 'bar'}}) call WaitFor('"" != g:envstr') call assert_equal("bar", g:envstr) unlet g:envstr @@ -1737,11 +1739,12 @@ func Test_cwd() let g:envstr = '' if has('win32') let expect = $TEMP - let job = job_start(['cmd', '/c', 'echo %CD%'], {'callback': {ch,msg->execute(":let g:envstr .= msg")}, 'cwd': expect}) + let cmd = ['cmd', '/c', 'echo %CD%'] else let expect = $HOME - let job = job_start(['pwd'], {'callback': {ch,msg->execute(":let g:envstr .= msg")}, 'cwd': expect}) + let cmd = ['pwd'] endif + let job = job_start(cmd, {'callback': {ch,msg -> execute(":let g:envstr .= msg")}, 'cwd': expect}) try call WaitFor('"" != g:envstr') let expect = substitute(expect, '[/\\]$', '', '') diff --git a/src/version.c b/src/version.c index 59ca7a8fde..8264bd9a8a 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1671, /**/ 1670, /**/ From 72532d354e699f1cceec34c0b08e1de4d3ea9641 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 7 Apr 2018 19:09:09 +0200 Subject: [PATCH 19/26] patch 8.0.1672: error during completion causes command to be cancelled Problem: Error during completion causes command to be cancelled. Solution: Reset did_emsg before waiting for another character. (Tom M.) --- src/ex_getln.c | 4 ++++ src/testdir/test_cmdline.vim | 11 +++++++++++ src/version.c | 2 ++ 3 files changed, 17 insertions(+) diff --git a/src/ex_getln.c b/src/ex_getln.c index 48cccf18e0..9fdfac5a28 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -426,6 +426,10 @@ getcmdline( #endif quit_more = FALSE; /* reset after CTRL-D which had a more-prompt */ + did_emsg = FALSE; /* There can't really be a reason why an error + that occurs while typing a command should + cause the command not to be executed. */ + cursorcmd(); /* set the cursor on the right spot */ /* Get a character. Ignore K_IGNORE and K_NOP, they should not do diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 8755fbf1aa..ff0756c392 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -316,6 +316,17 @@ func Test_paste_in_cmdline() call feedkeys(":\etoupper(getline(1))\\\"\", 'tx') call assert_equal('"ASDF.X /TMP/SOME VERYLONGWORD A;B-C*D ', @:) bwipe! + + " Error while typing a command used to cause that it was not executed + " in the end. + new + try + call feedkeys(":file \%Xtestfile\", 'tx') + catch /^Vim\%((\a\+)\)\=:E32/ + " ignore error E32 + endtry + call assert_equal("Xtestfile", bufname("%")) + bwipe! endfunc func Test_remove_char_in_cmdline() diff --git a/src/version.c b/src/version.c index 8264bd9a8a..665c953916 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1672, /**/ 1671, /**/ From 4791015e6f0adf7f3a0a6a59884c4092ca3c19ef Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 7 Apr 2018 19:27:16 +0200 Subject: [PATCH 20/26] patch 8.0.1673: terminal window tests are still a bit flaky Problem: Terminal window tests are still a bit flaky. Solution: Increase the waiting time even more. (Elimar Riesebieter) --- src/testdir/test_terminal.vim | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index cd7a2b21e9..5645625cb3 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -1061,7 +1061,7 @@ func Api_drop_common(options) \ "set t_ts=", \ ], 'Xscript') let buf = RunVimInTerminal('-S Xscript', {}) - call WaitFor({-> bufnr('Xtextfile') > 0}, 2000) + call WaitFor({-> bufnr('Xtextfile') > 0}, 5000) call assert_equal('Xtextfile', expand('%:t')) call assert_true(winnr('$') >= 3) return buf diff --git a/src/version.c b/src/version.c index 665c953916..9f065797c5 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1673, /**/ 1672, /**/ From 77557a7ae66830cb21c79d3a2b48a93b086599b3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 7 Apr 2018 21:42:56 +0200 Subject: [PATCH 21/26] patch 8.0.1674: libvterm can't handle an OSC string split Problem: Libvterm can't handle a long OSC string that is split. Solution: When an incomplete OSC string is received copy it to the parser buffer. Increase the size of the parser buffer to be able to handle longer strings. --- src/libvterm/src/parser.c | 5 +++++ src/libvterm/src/vterm.c | 2 +- src/version.c | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libvterm/src/parser.c b/src/libvterm/src/parser.c index c71ea8d736..b07bb94a23 100644 --- a/src/libvterm/src/parser.c +++ b/src/libvterm/src/parser.c @@ -288,6 +288,11 @@ size_t vterm_input_write(VTerm *vt, const char *bytes, size_t len) done_string(vt, string_start, bytes + pos - string_start); ENTER_NORMAL_STATE(); } + else if (pos + 1 == len) { + /* end of input but OSC string isn't finished yet, copy it to + * vt->parser.strbuffer to continue it later */ + more_string(vt, string_start, bytes + pos + 1 - string_start); + } break; case NORMAL: diff --git a/src/libvterm/src/vterm.c b/src/libvterm/src/vterm.c index d9f0e208db..f066b01b81 100644 --- a/src/libvterm/src/vterm.c +++ b/src/libvterm/src/vterm.c @@ -52,7 +52,7 @@ VTerm *vterm_new_with_allocator(int rows, int cols, VTermAllocatorFunctions *fun vt->parser.callbacks = NULL; vt->parser.cbdata = NULL; - vt->parser.strbuffer_len = 64; + vt->parser.strbuffer_len = 500; /* should be able to hold an OSC string */ vt->parser.strbuffer_cur = 0; vt->parser.strbuffer = vterm_allocator_malloc(vt, vt->parser.strbuffer_len); diff --git a/src/version.c b/src/version.c index 9f065797c5..e95a62d3d3 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1674, /**/ 1673, /**/ From 820082914122d5bf7b6e89ff30cf364ad40a560f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 8 Apr 2018 12:17:04 +0200 Subject: [PATCH 22/26] patch 8.0.1675: unused macro argument in libvterm Problem: Unused macro argument in libvterm. (Randall W. Morris) Solution: Remove the argument. --- src/libvterm/src/parser.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libvterm/src/parser.c b/src/libvterm/src/parser.c index b07bb94a23..c15a5a59d9 100644 --- a/src/libvterm/src/parser.c +++ b/src/libvterm/src/parser.c @@ -141,7 +141,7 @@ size_t vterm_input_write(VTerm *vt, const char *bytes, size_t len) break; } -#define ENTER_STRING_STATE(st) do { vt->parser.state = STRING; string_start = bytes + pos + 1; } while(0) +#define ENTER_STRING_STATE() do { vt->parser.state = STRING; string_start = bytes + pos + 1; } while(0) #define ENTER_STATE(st) do { vt->parser.state = st; string_start = NULL; } while(0) #define ENTER_NORMAL_STATE() ENTER_STATE(NORMAL) diff --git a/src/version.c b/src/version.c index e95a62d3d3..38fe7d1820 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1675, /**/ 1674, /**/ From 4ac2e8d8e60dcc7dbff662e177b86ccfbda7cd9e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 8 Apr 2018 12:38:26 +0200 Subject: [PATCH 23/26] patch 8.0.1676: no compiler warning for wrong printf format Problem: No compiler warning for wrong printf format. Solution: Add a printf attribute for gcc. Fix reported problems. (Dominique Pelle, closes #2789) --- src/channel.c | 20 +++++++++++++++----- src/proto/channel.pro | 1 - src/version.c | 2 ++ src/vim.h | 7 +++++++ 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/channel.c b/src/channel.c index 581c6f603f..0f2e52b97b 100644 --- a/src/channel.c +++ b/src/channel.c @@ -158,6 +158,7 @@ ch_log_lead(const char *what, channel_T *ch) static int did_log_msg = TRUE; +#ifndef PROTO /* prototype is in vim.h */ void ch_log(channel_T *ch, const char *fmt, ...) { @@ -174,6 +175,14 @@ ch_log(channel_T *ch, const char *fmt, ...) did_log_msg = TRUE; } } +#endif + + static void +ch_error(channel_T *ch, const char *fmt, ...) +#ifdef __GNUC__ +__attribute__((format(printf, 2, 3))) +#endif + ; static void ch_error(channel_T *ch, const char *fmt, ...) @@ -1442,8 +1451,8 @@ channel_write_in(channel_T *channel) ch_close_part(channel, PART_IN); } else - ch_log(channel, "Still %d more lines to write", - buf->b_ml.ml_line_count - lnum + 1); + ch_log(channel, "Still %ld more lines to write", + (long)(buf->b_ml.ml_line_count - lnum + 1)); } /* @@ -1536,8 +1545,8 @@ channel_write_new_lines(buf_T *buf) else if (written > 1) ch_log(channel, "written %d lines to channel", written); if (lnum < buf->b_ml.ml_line_count) - ch_log(channel, "Still %d more lines to write", - buf->b_ml.ml_line_count - lnum); + ch_log(channel, "Still %ld more lines to write", + (long)(buf->b_ml.ml_line_count - lnum)); in_part->ch_buf_bot = lnum; } @@ -2081,7 +2090,8 @@ channel_get_json( { *rettv = item->jq_value; if (tv->v_type == VAR_NUMBER) - ch_log(channel, "Getting JSON message %d", tv->vval.v_number); + ch_log(channel, "Getting JSON message %ld", + (long)tv->vval.v_number); remove_json_node(head, item); return OK; } diff --git a/src/proto/channel.pro b/src/proto/channel.pro index 9b63490b79..dcf29b8420 100644 --- a/src/proto/channel.pro +++ b/src/proto/channel.pro @@ -1,7 +1,6 @@ /* channel.c */ void ch_logfile(char_u *fname, char_u *opt); int ch_log_active(void); -void ch_log(channel_T *ch, const char *fmt, ...); channel_T *add_channel(void); int has_any_channel(void); int channel_unref(channel_T *channel); diff --git a/src/version.c b/src/version.c index 38fe7d1820..4ee3c25769 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1676, /**/ 1675, /**/ diff --git a/src/vim.h b/src/vim.h index 626c0ad120..78dede0cd7 100644 --- a/src/vim.h +++ b/src/vim.h @@ -2549,4 +2549,11 @@ typedef enum { #define TERM_START_FORCEIT 2 #define TERM_START_SYSTEM 4 +/* Not generated automatically, to add extra attribute. */ +void ch_log(channel_T *ch, const char *fmt, ...) +#ifdef __GNUC__ +__attribute__((format(printf, 2, 3))) +#endif +; + #endif /* VIM__H */ From ea39176baab52b646d1e2676e662def718ddd365 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 8 Apr 2018 13:07:22 +0200 Subject: [PATCH 24/26] patch 8.0.1677: no compiler warning for wrong format in vim_snprintf() Problem: No compiler warning for wrong format in vim_snprintf(). Solution: Add printf attribute for gcc. Fix reported problems. --- src/eval.c | 2 +- src/fileio.c | 4 ++-- src/json.c | 2 +- src/mbyte.c | 4 ++-- src/ops.c | 37 +++++++++++++++++++++++-------------- src/proto.h | 20 ++++++++++++++++++-- src/spellfile.c | 2 +- src/undo.c | 2 +- src/version.c | 2 ++ src/vim.h | 7 ------- 10 files changed, 51 insertions(+), 31 deletions(-) diff --git a/src/eval.c b/src/eval.c index c965d64f2d..cfeba2edaa 100644 --- a/src/eval.c +++ b/src/eval.c @@ -7105,7 +7105,7 @@ get_tv_string_buf_chk(typval_T *varp, char_u *buf) { case VAR_NUMBER: vim_snprintf((char *)buf, NUMBUFLEN, "%lld", - (varnumber_T)varp->vval.v_number); + (long long)varp->vval.v_number); return buf; case VAR_FUNC: case VAR_PARTIAL: diff --git a/src/fileio.c b/src/fileio.c index e2fa3e22b6..4f35cb9659 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5315,7 +5315,7 @@ msg_add_lines( *p++ = ' '; if (shortmess(SHM_LINES)) vim_snprintf((char *)p, IOSIZE - (p - IObuff), - "%ldL, %lldC", lnum, (varnumber_T)nchars); + "%ldL, %lldC", lnum, (long long)nchars); else { if (lnum == 1) @@ -5327,7 +5327,7 @@ msg_add_lines( STRCPY(p, _("1 character")); else vim_snprintf((char *)p, IOSIZE - (p - IObuff), - _("%lld characters"), (varnumber_T)nchars); + _("%lld characters"), (long long)nchars); } } diff --git a/src/json.c b/src/json.c index e1f40bf652..cc756488d8 100644 --- a/src/json.c +++ b/src/json.c @@ -217,7 +217,7 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options) case VAR_NUMBER: vim_snprintf((char *)numbuf, NUMBUFLEN, "%lld", - val->vval.v_number); + (long long)val->vval.v_number); ga_concat(gap, numbuf); break; diff --git a/src/mbyte.c b/src/mbyte.c index cb2d2d93ed..6d21f113e9 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -5040,11 +5040,11 @@ im_preedit_window_open() #else gtk_widget_modify_font(preedit_label, gui.norm_font); - vim_snprintf(buf, sizeof(buf), "#%06X", gui.norm_pixel); + vim_snprintf(buf, sizeof(buf), "#%06X", (unsigned)gui.norm_pixel); gdk_color_parse(buf, &color); gtk_widget_modify_fg(preedit_label, GTK_STATE_NORMAL, &color); - vim_snprintf(buf, sizeof(buf), "#%06X", gui.back_pixel); + vim_snprintf(buf, sizeof(buf), "#%06X", (unsigned)gui.back_pixel); gdk_color_parse(buf, &color); gtk_widget_modify_bg(preedit_window, GTK_STATE_NORMAL, &color); #endif diff --git a/src/ops.c b/src/ops.c index cb019cfd08..8b895d8637 100644 --- a/src/ops.c +++ b/src/ops.c @@ -5976,13 +5976,17 @@ do_addsub( buf2[i] = '\0'; } else if (pre == 0) - vim_snprintf((char *)buf2, NUMBUFLEN, "%llu", n); + vim_snprintf((char *)buf2, NUMBUFLEN, "%llu", + (long long unsigned)n); else if (pre == '0') - vim_snprintf((char *)buf2, NUMBUFLEN, "%llo", n); + vim_snprintf((char *)buf2, NUMBUFLEN, "%llo", + (long long unsigned)n); else if (pre && hexupper) - vim_snprintf((char *)buf2, NUMBUFLEN, "%llX", n); + vim_snprintf((char *)buf2, NUMBUFLEN, "%llX", + (long long unsigned)n); else - vim_snprintf((char *)buf2, NUMBUFLEN, "%llx", n); + vim_snprintf((char *)buf2, NUMBUFLEN, "%llx", + (long long unsigned)n); length -= (int)STRLEN(buf2); /* @@ -7501,16 +7505,21 @@ cursor_pos_info(dict_T *dict) _("Selected %s%ld of %ld Lines; %lld of %lld Words; %lld of %lld Bytes"), buf1, line_count_selected, (long)curbuf->b_ml.ml_line_count, - word_count_cursor, word_count, - byte_count_cursor, byte_count); + (long long)word_count_cursor, + (long long)word_count, + (long long)byte_count_cursor, + (long long)byte_count); else vim_snprintf((char *)IObuff, IOSIZE, _("Selected %s%ld of %ld Lines; %lld of %lld Words; %lld of %lld Chars; %lld of %lld Bytes"), buf1, line_count_selected, (long)curbuf->b_ml.ml_line_count, - word_count_cursor, word_count, - char_count_cursor, char_count, - byte_count_cursor, byte_count); + (long long)word_count_cursor, + (long long)word_count, + (long long)char_count_cursor, + (long long)char_count, + (long long)byte_count_cursor, + (long long)byte_count); } else { @@ -7528,17 +7537,17 @@ cursor_pos_info(dict_T *dict) (char *)buf1, (char *)buf2, (long)curwin->w_cursor.lnum, (long)curbuf->b_ml.ml_line_count, - word_count_cursor, word_count, - byte_count_cursor, byte_count); + (long long)word_count_cursor, (long long)word_count, + (long long)byte_count_cursor, (long long)byte_count); else vim_snprintf((char *)IObuff, IOSIZE, _("Col %s of %s; Line %ld of %ld; Word %lld of %lld; Char %lld of %lld; Byte %lld of %lld"), (char *)buf1, (char *)buf2, (long)curwin->w_cursor.lnum, (long)curbuf->b_ml.ml_line_count, - word_count_cursor, word_count, - char_count_cursor, char_count, - byte_count_cursor, byte_count); + (long long)word_count_cursor, (long long)word_count, + (long long)char_count_cursor, (long long)char_count, + (long long)byte_count_cursor, (long long)byte_count); } } diff --git a/src/proto.h b/src/proto.h index 5513746dd9..231c53f3bf 100644 --- a/src/proto.h +++ b/src/proto.h @@ -119,13 +119,21 @@ int # ifdef __BORLANDC__ _RTLENTRYF # endif -vim_snprintf_add(char *, size_t, char *, ...); +vim_snprintf_add(char *, size_t, char *, ...) +#ifdef __GNUC__ + __attribute__((format(printf, 3, 4))) +#endif + ; int # ifdef __BORLANDC__ _RTLENTRYF # endif -vim_snprintf(char *, size_t, char *, ...); +vim_snprintf(char *, size_t, char *, ...) +#ifdef __GNUC__ + __attribute__((format(printf, 3, 4))) +#endif + ; int vim_vsnprintf(char *str, size_t str_m, char *fmt, va_list ap); int vim_vsnprintf_typval(char *str, size_t str_m, char *fmt, va_list ap, typval_T *tvs); @@ -212,6 +220,14 @@ void qsort(void *base, size_t elm_count, size_t elm_size, int (*cmp)(const void # endif # ifdef FEAT_JOB_CHANNEL # include "channel.pro" + +/* Not generated automatically, to add extra attribute. */ +void ch_log(channel_T *ch, const char *fmt, ...) +#ifdef __GNUC__ + __attribute__((format(printf, 2, 3))) +#endif + ; + # endif # if defined(FEAT_GUI) || defined(FEAT_JOB_CHANNEL) diff --git a/src/spellfile.c b/src/spellfile.c index e9eacbecb6..496e07f8f6 100644 --- a/src/spellfile.c +++ b/src/spellfile.c @@ -3649,7 +3649,7 @@ spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile) { spin->si_msg_count = 0; vim_snprintf((char *)message, sizeof(message), - _("line %6d, word %6d - %s"), + _("line %6d, word %6ld - %s"), lnum, spin->si_foldwcount + spin->si_keepwcount, w); msg_start(); msg_puts_long_attr(message, 0); diff --git a/src/undo.c b/src/undo.c index 09bcc91bef..6e3381f8cd 100644 --- a/src/undo.c +++ b/src/undo.c @@ -3029,7 +3029,7 @@ ex_undolist(exarg_T *eap UNUSED) { if (ga_grow(&ga, 1) == FAIL) break; - vim_snprintf((char *)IObuff, IOSIZE, "%6ld %7ld ", + vim_snprintf((char *)IObuff, IOSIZE, "%6ld %7d ", uhp->uh_seq, changes); u_add_time(IObuff + STRLEN(IObuff), IOSIZE - STRLEN(IObuff), uhp->uh_time); diff --git a/src/version.c b/src/version.c index 4ee3c25769..1b2a1fa0f0 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1677, /**/ 1676, /**/ diff --git a/src/vim.h b/src/vim.h index 78dede0cd7..626c0ad120 100644 --- a/src/vim.h +++ b/src/vim.h @@ -2549,11 +2549,4 @@ typedef enum { #define TERM_START_FORCEIT 2 #define TERM_START_SYSTEM 4 -/* Not generated automatically, to add extra attribute. */ -void ch_log(channel_T *ch, const char *fmt, ...) -#ifdef __GNUC__ -__attribute__((format(printf, 2, 3))) -#endif -; - #endif /* VIM__H */ From e333e79f9bdff82432e0fd7fcf7ae30ef8e3d092 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 8 Apr 2018 13:27:39 +0200 Subject: [PATCH 25/26] patch 8.0.1678: errorformat "%r" implies "%>" Problem: Errorformat "%r" implies "%>". (Jan Gosmann) Solution: Jump to before setting fmt_ptr. (Yegappan Lakshmanan, closes #2785) --- src/quickfix.c | 2 +- src/testdir/test_quickfix.vim | 23 +++++++++++++++++++++++ src/version.c | 2 ++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/quickfix.c b/src/quickfix.c index e5bd2d0f00..8c1df17938 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -844,6 +844,7 @@ qf_parse_line( /* Always ignore case when looking for a matching error. */ regmatch.rm_ic = TRUE; +restofline: /* If there was no %> item start at the first pattern */ if (fmt_start == NULL) fmt_ptr = fmt_first; @@ -858,7 +859,6 @@ qf_parse_line( * match or no match. */ fields->valid = TRUE; -restofline: for ( ; fmt_ptr != NULL; fmt_ptr = fmt_ptr->next) { int r; diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index 070582dfbe..b0e14e6ad0 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -2582,6 +2582,29 @@ func Xmultifilestack_tests(cchar) call assert_equal(3, l1.items[1].lnum) call assert_equal('two.txt', bufname(l2.items[1].bufnr)) call assert_equal(5, l2.items[1].lnum) + + " Test for start of a new error line in the same line where a previous + " error line ends with a file stack. + let efm_val = 'Error\ l%l\ in\ %f,' + let efm_val .= '%-P%>(%f%r,Error\ l%l\ in\ %m,%-Q)%r' + let l = g:Xgetlist({'lines' : [ + \ '(one.txt', + \ 'Error l4 in one.txt', + \ ') (two.txt', + \ 'Error l6 in two.txt', + \ ')', + \ 'Error l8 in one.txt' + \ ], 'efm' : efm_val}) + call assert_equal(3, len(l.items)) + call assert_equal('one.txt', bufname(l.items[0].bufnr)) + call assert_equal(4, l.items[0].lnum) + call assert_equal('one.txt', l.items[0].text) + call assert_equal('two.txt', bufname(l.items[1].bufnr)) + call assert_equal(6, l.items[1].lnum) + call assert_equal('two.txt', l.items[1].text) + call assert_equal('one.txt', bufname(l.items[2].bufnr)) + call assert_equal(8, l.items[2].lnum) + call assert_equal('', l.items[2].text) endfunc func Test_multifilestack() diff --git a/src/version.c b/src/version.c index 1b2a1fa0f0..c7e47f51b2 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1678, /**/ 1677, /**/ From 672afb9f66c64e031a2b609bdee0cb873883c9ec Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 8 Apr 2018 16:34:22 +0200 Subject: [PATCH 26/26] patch 8.0.1679: compiler warning for printf format Problem: Compiler warning for printf format. (Chdiza) Solution: Change type to "long long". (closes #2791) --- src/ops.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ops.c b/src/ops.c index 8b895d8637..b1c1d36935 100644 --- a/src/ops.c +++ b/src/ops.c @@ -7555,7 +7555,7 @@ cursor_pos_info(dict_T *dict) bom_count = bomb_size(); if (bom_count > 0) vim_snprintf((char *)IObuff + STRLEN(IObuff), IOSIZE, - _("(+%ld for BOM)"), bom_count); + _("(+%lld for BOM)"), (long long)bom_count); #endif if (dict == NULL) { diff --git a/src/version.c b/src/version.c index c7e47f51b2..a044f09bc1 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1679, /**/ 1678, /**/