diff --git a/Filelist b/Filelist index 56962c84d3..7083eed7de 100644 --- a/Filelist +++ b/Filelist @@ -659,6 +659,7 @@ RT_SCRIPTS = \ runtime/makemenu.vim \ runtime/autoload/*.vim \ runtime/autoload/README.txt \ + runtime/autoload/dist/*.vim \ runtime/autoload/xml/*.vim \ runtime/colors/*.vim \ runtime/colors/README.txt \ diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi index 4e9bbfb456..871ce673a9 100644 --- a/nsis/gvim.nsi +++ b/nsis/gvim.nsi @@ -268,6 +268,9 @@ Section "Vim executables and runtime files" SetOutPath $0\autoload File ${VIMRT}\autoload\*.* + SetOutPath $0\autoload\dist + File ${VIMRT}\autoload\dist\*.* + SetOutPath $0\autoload\xml File ${VIMRT}\autoload\xml\*.* diff --git a/runtime/autoload/filetype.vim b/runtime/autoload/dist/ft.vim similarity index 92% rename from runtime/autoload/filetype.vim rename to runtime/autoload/dist/ft.vim index 66e64b29d8..2603c6822f 100644 --- a/runtime/autoload/filetype.vim +++ b/runtime/autoload/dist/ft.vim @@ -1,7 +1,7 @@ " Vim functions for file type detection " " Maintainer: Bram Moolenaar -" Last Change: 2017 Nov 09 +" Last Change: 2017 Nov 11 " These functions are moved here from runtime/filetype.vim to make startup " faster. @@ -10,7 +10,7 @@ let s:cpo_save = &cpo set cpo&vim -func filetype#Check_inp() +func dist#ft#Check_inp() if getline(1) =~ '^\*' setf abaqus else @@ -32,14 +32,14 @@ endfunc " This function checks for the kind of assembly that is wanted by the user, or " can be detected from the first five lines of the file. -func filetype#FTasm() +func dist#ft#FTasm() " make sure b:asmsyntax exists if !exists("b:asmsyntax") let b:asmsyntax = "" endif if b:asmsyntax == "" - call filetype#FTasmsyntax() + call dist#ft#FTasmsyntax() endif " if b:asmsyntax still isn't set, default to asmsyntax or GNU @@ -54,7 +54,7 @@ func filetype#FTasm() exe "setf " . fnameescape(b:asmsyntax) endfunc -func filetype#FTasmsyntax() +func dist#ft#FTasmsyntax() " see if file contains any asmsyntax=foo overrides. If so, change " b:asmsyntax appropriately let head = " ".getline(1)." ".getline(2)." ".getline(3)." ".getline(4). @@ -69,7 +69,7 @@ endfunc " Check if one of the first five lines contains "VB_Name". In that case it is " probably a Visual Basic file. Otherwise it's assumed to be "alt" filetype. -func filetype#FTVB(alt) +func dist#ft#FTVB(alt) if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)' setf vb else @@ -77,7 +77,7 @@ func filetype#FTVB(alt) endif endfunc -func filetype#FTbtm() +func dist#ft#FTbtm() if exists("g:dosbatch_syntax_for_btm") && g:dosbatch_syntax_for_btm setf dosbatch else @@ -85,7 +85,7 @@ func filetype#FTbtm() endif endfunc -func filetype#BindzoneCheck(default) +func dist#ft#BindzoneCheck(default) if getline(1).getline(2).getline(3).getline(4) =~ '^; <<>> DiG [0-9.]\+.* <<>>\|$ORIGIN\|$TTL\|IN\s\+SOA' setf bindzone elseif a:default != '' @@ -93,7 +93,7 @@ func filetype#BindzoneCheck(default) endif endfunc -func filetype#FTlpc() +func dist#ft#FTlpc() if exists("g:lpc_syntax_for_c") let lnum = 1 while lnum <= 12 @@ -107,7 +107,7 @@ func filetype#FTlpc() setf c endfunc -func filetype#FTheader() +func dist#ft#FTheader() if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1 if exists("g:c_syntax_for_h") setf objc @@ -128,7 +128,7 @@ endfunc " If the first line starts with # or ! it's probably a ch file. " If a line has "main", "include", "//" ir "/*" it's probably ch. " Otherwise CHILL is assumed. -func filetype#FTchange() +func dist#ft#FTchange() let lnum = 1 while lnum <= 10 if getline(lnum)[0] == '@' @@ -152,7 +152,7 @@ func filetype#FTchange() setf chill endfunc -func filetype#FTent() +func dist#ft#FTent() " This function checks for valid cl syntax in the first five lines. " Look for either an opening comment, '#', or a block start, '{". " If not found, assume SGML. @@ -172,7 +172,7 @@ func filetype#FTent() setf dtd endfunc -func filetype#EuphoriaCheck() +func dist#ft#EuphoriaCheck() if exists('g:filetype_euphoria') exe 'setf ' . g:filetype_euphoria else @@ -180,7 +180,7 @@ func filetype#EuphoriaCheck() endif endfunc -func filetype#DtraceCheck() +func dist#ft#DtraceCheck() let lines = getline(1, min([line("$"), 100])) if match(lines, '^module\>\|^import\>') > -1 " D files often start with a module and/or import statement. @@ -192,7 +192,7 @@ func filetype#DtraceCheck() endif endfunc -func filetype#FTe() +func dist#ft#FTe() if exists('g:filetype_euphoria') exe 'setf ' . g:filetype_euphoria else @@ -209,7 +209,7 @@ func filetype#FTe() endfunc " Distinguish between HTML, XHTML and Django -func filetype#FThtml() +func dist#ft#FThtml() let n = 1 while n < 10 && n < line("$") if getline(n) =~ '\ 50 ? 50 : line("$") for n in range(1, max) @@ -466,7 +466,7 @@ func filetype#FTr() endif endfunc -func filetype#McSetf() +func dist#ft#McSetf() " Rely on the file to start with a comment. " MS message text files use ';', Sendmail files use '#' or 'dnl' for lnum in range(1, min([line("$"), 20])) @@ -483,21 +483,21 @@ func filetype#McSetf() endfunc " Called from filetype.vim and scripts.vim. -func filetype#SetFileTypeSH(name) +func dist#ft#SetFileTypeSH(name) if expand("") =~ g:ft_ignore_pat return endif if a:name =~ '\' " Some .sh scripts contain #!/bin/csh. - call filetype#SetFileTypeShell("csh") + call dist#ft#SetFileTypeShell("csh") return elseif a:name =~ '\' " Some .sh scripts contain #!/bin/tcsh. - call filetype#SetFileTypeShell("tcsh") + call dist#ft#SetFileTypeShell("tcsh") return elseif a:name =~ '\' " Some .sh scripts contain #!/bin/zsh. - call filetype#SetFileTypeShell("zsh") + call dist#ft#SetFileTypeShell("zsh") return elseif a:name =~ '\' let b:is_kornshell = 1 @@ -524,13 +524,13 @@ func filetype#SetFileTypeSH(name) unlet b:is_bash endif endif - call filetype#SetFileTypeShell("sh") + call dist#ft#SetFileTypeShell("sh") endfunc " For shell-like file types, check for an "exec" command hidden in a comment, " as used for Tcl. " Also called from scripts.vim, thus can't be local to this script. -func filetype#SetFileTypeShell(name) +func dist#ft#SetFileTypeShell(name) if expand("") =~ g:ft_ignore_pat return endif @@ -550,18 +550,18 @@ func filetype#SetFileTypeShell(name) exe "setf " . a:name endfunc -func filetype#CSH() +func dist#ft#CSH() if exists("g:filetype_csh") - call filetype#SetFileTypeShell(g:filetype_csh) + call dist#ft#SetFileTypeShell(g:filetype_csh) elseif &shell =~ "tcsh" - call filetype#SetFileTypeShell("tcsh") + call dist#ft#SetFileTypeShell("tcsh") else - call filetype#SetFileTypeShell("csh") + call dist#ft#SetFileTypeShell("csh") endif endfunc let s:ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*' -func filetype#FTRules() +func dist#ft#FTRules() let path = expand(':p') if path =~ '^/\(etc/udev/\%(rules\.d/\)\=.*\.rules\|lib/udev/\%(rules\.d/\)\=.*\.rules\)$' setf udevrules @@ -594,7 +594,7 @@ func filetype#FTRules() setf hog endfunc -func filetype#SQL() +func dist#ft#SQL() if exists("g:filetype_sql") exe "setf " . g:filetype_sql else @@ -608,7 +608,7 @@ endfunc " file. " (Slow test) If a file contains a 'use' statement then it is almost certainly " a Perl file. -func filetype#FTperl() +func dist#ft#FTperl() let dirname = expand("%:p:h:t") if expand("%:e") == 't' && (dirname == 't' || dirname == 'xt') setf perl @@ -629,7 +629,7 @@ endfunc " 1. Check the first line of the file for "%&". " 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords. " 3. Default to "latex" or to g:tex_flavor, can be set in user's vimrc. -func filetype#FTtex() +func dist#ft#FTtex() let firstline = getline(1) if firstline =~ '^%&\s*\a\+' let format = tolower(matchstr(firstline, '\a\+')) @@ -681,7 +681,7 @@ func filetype#FTtex() return endfunc -func filetype#FTxml() +func dist#ft#FTxml() let n = 1 while n < 100 && n < line("$") let line = getline(n) @@ -707,7 +707,7 @@ func filetype#FTxml() setf xml endfunc -func filetype#FTy() +func dist#ft#FTy() let n = 1 while n < 100 && n < line("$") let line = getline(n) @@ -724,7 +724,7 @@ func filetype#FTy() setf yacc endfunc -func filetype#Redif() +func dist#ft#Redif() let lnum = 1 while lnum <= 5 && lnum < line('$') if getline(lnum) =~ "^\ctemplate-type:" diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 93191d0e5f..7312bcfd43 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -8820,6 +8820,7 @@ amiga Amiga version of Vim. arabic Compiled with Arabic support |Arabic|. arp Compiled with ARP support (Amiga). autocmd Compiled with autocommand support. |autocommand| +autoservername Automatically enable |clientserver| balloon_eval Compiled with |balloon-eval| support. balloon_multiline GUI supports multiline balloons. beos BeOS version of Vim. diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 4b47a39a7b..8434aae671 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -602,7 +602,7 @@ MANPAGER *manpager.vim* The :Man command allows you to turn Vim into a manpager (that syntax highlights manpages and follows linked manpages on hitting CTRL-]). -Works on: +Tested on: - Linux - Mac OS @@ -617,25 +617,36 @@ Untested: - BeOS - OS/2 -For bash,zsh,ksh or dash by adding to the config file (.bashrc,.zshrc, ...) +If man sets the $MAN_PN environment variable, like man-db, the most common +implementation on Linux, then the "env MAN_PN=1 " part below should NOT be +set, that is, the "env MAN_PN=1" should be omitted! Otherwise, the Vim +manpager does not correctly recognize manpages whose title contains a capital +letter. See the discussion on + + https://groups.google.com/forum/#!topic/vim_dev/pWZmt_7GkxI + +For bash,zsh,ksh or dash, add to the config file (.bashrc,.zshrc, ...) export MANPAGER="env MAN_PN=1 vim -M +MANPAGER -" +For (t)csh, add to the config file + + setenv MANPAGER "env MAN_PN=1 vim -M +MANPAGER -" + +For fish, add to the config file + + set -x MANPAGER "env MAN_PN=1 vim -M +MANPAGER -" + On OpenBSD: export MANPAGER="env MAN_PN=1 vim -M +MANPAGER" -For (t)csh by adding to the config file +If you experience still issues on manpages whose titles do not contain capital +letters, then try adding MANPATH=${MANPATH} after MAN_PN=1. If your manpages do +not show up localized, then try adding, LANGUAGE=${LANG} after MAN_PN=1. See - setenv MANPAGER "env MAN_PN=1 vim -M +MANPAGER -" + https://github.com/vim/vim/issues/1002 -For fish by adding to the config file - - set -x MANPAGER "env MAN_PN=1 vim -M +MANPAGER -" - -If man sets the $MAN_PN environment variable, like man-db, the most common -implementation on Linux and Mac OS, then the "env MAN_PN=1 " part above is -superfluous. PDF *ft-pdf-plugin* diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index 8f96e41491..a870a501d1 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -1,4 +1,4 @@ -*if_pyth.txt* For Vim version 8.0. Last change: 2017 Mar 09 +*if_pyth.txt* For Vim version 8.0. Last change: 2017 Nov 09 VIM REFERENCE MANUAL by Paul Moore diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 07deac3902..af9de97c3c 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 8.0. Last change: 2017 Nov 02 +*options.txt* For Vim version 8.0. Last change: 2017 Nov 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -5498,7 +5498,7 @@ A jump table for the options with a short description can be found at |Q_op|. sysmouse and Linux console with gpm). For using the mouse in the GUI, see |gui-mouse|. The mouse can be enabled for different modes: - n Normal mode + n Normal mode and Terminal modes v Visual mode i Insert mode c Command-line mode @@ -8594,7 +8594,7 @@ A jump table for the options with a short description can be found at |Q_op|. security reasons. *'viewoptions'* *'vop'* -'viewoptions' 'vop' string (default: "folds,options,cursor") +'viewoptions' 'vop' string (default: "folds,options,cursor,curdir") global {not in Vi} {not available when compiled without the |+mksession| @@ -8612,6 +8612,7 @@ A jump table for the options with a short description can be found at |Q_op|. slashes unix with Unix end-of-line format (single ), even when on Windows or DOS + curdir the window-local directory, if set with `:lcd` "slash" and "unix" are useful on Windows when sharing view files with Unix. The Unix version of Vim cannot source dos format scripts, diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index f77fdc6b37..a1e612c5fb 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1,4 +1,4 @@ -*starting.txt* For Vim version 8.0. Last change: 2017 Oct 24 +*starting.txt* For Vim version 8.0. Last change: 2017 Nov 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1419,7 +1419,7 @@ The output of ":mkview" contains these items: 5. The scroll position and the cursor position in the file. Doesn't work very well when there are closed folds. 6. The local current directory, if it is different from the global current - directory. + directory and 'viewoptions' contains "curdir". Note that Views and Sessions are not perfect: - They don't restore everything. For example, defined functions, autocommands @@ -1531,7 +1531,7 @@ Notes for Unix: you have worked with. - If you want to share the viminfo file with other users (e.g. when you "su" to another user), you can make the file writable for the group or everybody. - Vim will preserve this when writing new viminfo files. Be careful, don't + Vim will preserve this when replacing the viminfo file. Be careful, don't allow just anybody to read and write your viminfo file! - Vim will not overwrite a viminfo file that is not writable by the current "real" user. This helps for when you did "su" to become root, but your diff --git a/runtime/doc/tags b/runtime/doc/tags index 601f86036b..88f5e030b3 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -315,6 +315,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* 'go-g' options.txt /*'go-g'* 'go-h' options.txt /*'go-h'* 'go-i' options.txt /*'go-i'* +'go-k' options.txt /*'go-k'* 'go-l' options.txt /*'go-l'* 'go-m' options.txt /*'go-m'* 'go-p' options.txt /*'go-p'* @@ -8990,16 +8991,29 @@ termcap-cursor-color term.txt /*termcap-cursor-color* termcap-cursor-shape term.txt /*termcap-cursor-shape* termcap-options term.txt /*termcap-options* termcap-title term.txt /*termcap-title* +termdebug-commands terminal.txt /*termdebug-commands* +termdebug-communication terminal.txt /*termdebug-communication* +termdebug-customizing terminal.txt /*termdebug-customizing* +termdebug-example terminal.txt /*termdebug-example* +termdebug-starting terminal.txt /*termdebug-starting* +termdebug-stepping terminal.txt /*termdebug-stepping* +termdebug-variables terminal.txt /*termdebug-variables* terminal terminal.txt /*terminal* terminal-colors os_unix.txt /*terminal-colors* +terminal-cursor-style terminal.txt /*terminal-cursor-style* terminal-debug terminal.txt /*terminal-debug* terminal-functions usr_41.txt /*terminal-functions* terminal-info term.txt /*terminal-info* terminal-key-codes term.txt /*terminal-key-codes* +terminal-ms-windows terminal.txt /*terminal-ms-windows* terminal-options term.txt /*terminal-options* terminal-output-codes term.txt /*terminal-output-codes* +terminal-resizing terminal.txt /*terminal-resizing* +terminal-size-color terminal.txt /*terminal-size-color* +terminal-special-keys terminal.txt /*terminal-special-keys* terminal-testing terminal.txt /*terminal-testing* terminal-typing terminal.txt /*terminal-typing* +terminal-unix terminal.txt /*terminal-unix* terminal-use terminal.txt /*terminal-use* terminal.txt terminal.txt /*terminal.txt* terminfo term.txt /*terminfo* diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index be6801561f..b3df8ce046 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -1,4 +1,4 @@ -*terminal.txt* For Vim version 8.0. Last change: 2017 Oct 29 +*terminal.txt* For Vim version 8.0. Last change: 2017 Nov 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -14,9 +14,25 @@ The terminal feature is optional, use this to check if your Vim has it: > If the result is "1" you have it. -1. Basic use |terminal-use| -2. Remote testing |terminal-testing| -3. Debugging |terminal-debug| +1. Basic use |terminal-use| + Typing |terminal-typing| + Size and color |terminal-size-color| + Syntax |:terminal| + Resizing |terminal-resizing| + Terminal Modes |Terminal-mode| + Cursor style |terminal-cursor-style| + Special keys |terminal-special-keys| + Unix |terminal-unix| + MS-Windows |terminal-ms-windows| +2. Remote testing |terminal-testing| +3. Debugging |terminal-debug| + Starting |termdebug-starting| + Example session |termdebug-example| + Stepping through code |termdebug-stepping| + Inspecting variables |termdebug-variables| + Other commands |termdebug-commands| + Communication |termdebug-communication| + Customizing |termdebug-customizing| {Vi does not have any of these commands} {only available when compiled with the |+terminal| feature} @@ -44,7 +60,7 @@ the job. This uses a pty when possible. You can click outside of the terminal window to move keyboard focus elsewhere. CTRL-W can be used to navigate between windows and other CTRL-W commands, e.g.: - CTRL-W CTRL-W move focus to the next window + CTRL-W CTRL-W move focus to the next window CTRL-W : enter an Ex command See |CTRL-W| for more commands. @@ -64,7 +80,7 @@ the job. For example: 'termkey' : enter an Ex command 'termkey' 'termkey' send 'termkey' to the job in the terminal 'termkey' . send a CTRL-W to the job in the terminal - 'termkey' N go to terminal Normal mode, see below + 'termkey' N go to terminal Normal mode, see below 'termkey' CTRL-N same as CTRL-W N 'termkey' CTRL-C same as |t_CTRL-W_CTRL-C| *t_CTRL-\_CTRL-N* @@ -92,7 +108,7 @@ options specifically for the window and buffer. Example: > Size and color ~ - + *terminal-size-color* See option 'termsize' for controlling the size of the terminal window. (TODO: scrolling when the terminal is larger than the window) @@ -201,7 +217,7 @@ the buffer name will still be set to the command. Resizing ~ - + *terminal-resizing* The size of the terminal can be in one of three modes: 1. The 'termsize' option is empty: The terminal size follows the window size. @@ -251,7 +267,7 @@ It is not possible to enter Insert mode from Terminal-Job mode. Cursor style ~ - + *terminal-cursor-style* By default the cursor in the terminal window uses a not blinking block. The normal xterm escape sequences can be used to change the blinking state and the shape. Once focus leaves the terminal window Vim will restore the original @@ -263,8 +279,21 @@ is inverted. Since Vim cannot detect this, the terminal window cursor blinking will also be inverted. -Unix ~ +Special keys ~ + *terminal-special-keys* +Since the terminal emulator simulates an xterm, only escape sequences that +both Vim and xterm recognize will be available in the terminal window. If you +want to pass on other escape sequences to the job running in the terminal you +need to set up forwarding. Example: > + tmap ]b SendToTerm("\]b") + func SendToTerm(what) + call term_sendkeys('', a:what) + return '' + endfunc + +Unix ~ + *terminal-unix* 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. @@ -287,7 +316,7 @@ This will open the file "some_file.c" and put the cursor on line 123. MS-Windows ~ - + *terminal-ms-windows* On MS-Windows winpty is used to make it possible to run all kind of commands. Obviously, they must be commands that run in a terminal, not open their own window. @@ -330,7 +359,7 @@ Vim this also works remotely over an ssh connection. Starting ~ - + *termdebug-starting* Load the plugin with this command: > packadd termdebug < *:Termdebug* @@ -360,7 +389,7 @@ opened windows are closed. Example session ~ - + *termdebug-example* Start in the Vim "src" directory and build Vim: > % make Start Vim: > @@ -416,36 +445,42 @@ a deeper level. Stepping through code ~ - + *termdebug-stepping* Put focus on the gdb window to type commands there. Some common ones are: -- CTRL-C interrupt the program -- next execute the current line and stop at the next line -- step execute the current line and stop at the next statement, entering - functions -- finish execute until leaving the current function -- where show the stack -- frame N go to the Nth stack frame -- continue continue execution +- CTRL-C interrupt the program +- next execute the current line and stop at the next line +- step execute the current line and stop at the next statement, + entering functions +- finish execute until leaving the current function +- where show the stack +- frame N go to the Nth stack frame +- continue continue execution -In the window showing the source code some commands can used to control gdb: - :Break set a breakpoint at the current line; a sign will be displayed - :Delete delete a breakpoint at the current line - :Step execute the gdb "step" command - :Over execute the gdb "next" command (:Next is a Vim command) - :Finish execute the gdb "finish" command - :Continue execute the gdb "continue" command +In the window showing the source code these commands can used to control gdb: + :Run [args] run the program with [args] or the previous arguments + :Arguments {args} set arguments for the next :Run + + :Break set a breakpoint at the current line; a sign will be displayed + :Delete delete a breakpoint at the current line + + :Step execute the gdb "step" command + :Over execute the gdb "next" command (:Next is a Vim command) + :Finish execute the gdb "finish" command + :Continue execute the gdb "continue" command + :Stop interrupt the program The plugin adds a window toolbar with these entries: - Step :Step - Next :Over - Finish :Finish - Cont :Continue - Eval :Evaluate + Step :Step + Next :Over + Finish :Finish + Cont :Continue + Stop :Stop + Eval :Evaluate This way you can use the mouse to perform the most common commands. Inspecting variables ~ - + *termdebug-variables* :Evaluate evaluate the expression under the cursor K same :Evaluate {expr} evaluate {expr} @@ -455,20 +490,20 @@ This is similar to using "print" in the gdb window. Other commands ~ - + *termdebug-commands* :Gdb jump to the gdb window :Program jump to the window with the running program Communication ~ - + *termdebug-communication* There is another, hidden, buffer, which is used for Vim to communicate with gdb. The buffer name is "gdb communication". Do not delete this buffer, it will break the debugger. Customizing ~ - + *termdebug-customizing* To change the name of the gdb command, set the "termdebugger" variable before invoking `:Termdebug`: > let termdebugger = "mygdb" diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index f16eb4dddf..44d002bd37 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 8.0. Last change: 2017 Nov 05 +*todo.txt* For Vim version 8.0. Last change: 2017 Nov 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -35,6 +35,10 @@ entered there will not be repeated below, unless there is extra information. *known-bugs* -------------------- Known bugs and current work ----------------------- +Permission of viminfo tempfile can be wrong. (Simon Ruderich) +Always use 600 ? Also avoids groups problem. +patch from Simon Ruderich, Nov 8 + No maintainer for Vietnamese translations. No maintainer for Simplified Chinese translations. @@ -132,8 +136,8 @@ Regexp problems: Include a few color schemes, based on popularity: http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search http://vimawesome.com/?q=tag:color-scheme -Use names that indicate their appearnce (Christian Brabandt, 2017 Aug 3) -- monokai - Xia Crusoe (2017 Aug 4) +Use names that indicate their apperance (Christian Brabandt, 2017 Aug 3) +- monokai - Xia Crusoe (2017 Aug 4) - seoul256 - Christian Brabandt (2017 Aug 3) - gruvbox - Christian Brabandt (2017 Aug 3) - janah - Marco Hinz (2017 Aug 4) @@ -141,7 +145,8 @@ Use names that indicate their appearnce (Christian Brabandt, 2017 Aug 3) Suggested by Hiroki Kokubun: - [Iceberg](https://github.com/cocopon/iceberg.vim) (my one) - [hybrid](https://github.com/w0ng/vim-hybrid) -Include solarized color scheme? +Include solarized color scheme?, it does not support termguicolors. +-> Make check for colorscheme that it's sane. Compiler warnings (geeknik, 2017 Oct 26): - signed integer overflow in do_sub() (#2249) @@ -178,9 +183,6 @@ Error in emsg with buggy script. (Dominique, 2017 Apr 30) When a timer is running and typing CTRL-R on the command line, it is not redrawn properly. (xtal8, 2017 Oct 23, #2241) -Patch for manpager plugin. (Lcd, 2017 Oct 12) -Asked maintainer. - Universal solution to detect if t_RS is working, using cursor position. Koichi Iwamoto, #2126 @@ -216,15 +218,7 @@ When bracketed paste is used, pasting at the ":append" prompt does not get the line breaks. (Ken Takata, 2017 Aug 22) Patch for 24 bit color support in MS-Windows console, using vcon. (Nobuhiro -Takasaki, 2017 Oct 1, #2060). Should not set 'tgc' automatically. - -Patch to change GUI behavior: instead of changing the window size change the -lines/columns when menu/toolbar/etc. is added/removed. (Ychin, 2016 Mar 20, -#703) - -Patch to skip globpath() for color schemes, keymaps and compiler settings. -So that loading menus is faster. (Ken Takata, 2017 Oct 23) -Update to expand the menus in a CursorHold autocmd. (2017 Oct 25) +Takasaki, 2017 Oct 1, #2060). Ready to include now? Memory leaks in test_channel? (or is it because of fork()) Memory leak in test_arabic. @@ -296,6 +290,9 @@ Patch to add argument to :cquit. (Thinca, 2014 Oct 12) Python: After "import vim" error messages only show the first line of the stack trace. (Yggdroot, 2017 Jul 28, #1887) +Patch to add "module" to quickfix entries. (Marcin Szamotulski, Coot, 2017 Jun +8, #1757) + When checking if a bufref is valid, also check the buffer number, to catch the case of :bwipe followed by :new. @@ -499,8 +496,6 @@ Patch for wrong cursor position on wrapped line, involving breakindent. (Ozaki Kiichi, 2016 Nov 25) Does this also fix #1408 ? -Patch to add "module" to quickfix entries. (Coot, 2017 Jun 8, #1757) - 'cursorline' and match interfere. (Ozaki Kiichi, 2017 Jun 23, #1792) Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30) @@ -5206,7 +5201,7 @@ Swap (.swp) files: - Add an option to create a swap file only when making the first change to the buffer. (Liang) Or only when the buffer is not read-only. - Add option to set "umask" for backup files and swap files (Antwerpen). - 'backupumask' and 'swapumask'? Or 'umaskback' and 'umaskswap'? + 'backupumask' and 'swapumask'? Or 'umaskbackup' and 'umaskswap'? - When editing a readonly file, don't use a swap file but read parts from the original file. Also do this when the file is huge (>'maxmem'). We do need to load the file once to count the number of lines? Perhaps keep a diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 3186827e5c..79e30c5198 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -309,6 +309,7 @@ g8 Print the hex values of the bytes used in the *+ARP* Amiga only: ARP support included B *+arabic* |Arabic| language support N *+autocmd* |:autocmd|, automatic commands +H *+autoservername* Automatically enable |clientserver| m *+balloon_eval* |balloon-eval| support. Included when compiling with supported GUI (Motif, GTK, GUI) and either Netbeans/Sun Workshop integration or |+eval| feature. diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 55f99fc105..d176cf12cf 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2017 Nov 09 +" Last Change: 2017 Nov 11 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -52,7 +52,7 @@ endfunc au BufNewFile,BufRead $VIMRUNTIME/doc/*.txt setf help " Abaqus or Trasys -au BufNewFile,BufRead *.inp call filetype#Check_inp() +au BufNewFile,BufRead *.inp call dist#ft#Check_inp() " A-A-P recipe au BufNewFile,BufRead *.aap setf aap @@ -154,7 +154,7 @@ au BufNewFile,BufRead */boot/grub/menu.lst,*/boot/grub/grub.conf,*/etc/grub.conf " Assembly (all kinds) " *.lst is not pure assembly, it has two extra columns (address, byte codes) -au BufNewFile,BufRead *.asm,*.[sS],*.[aA],*.mac,*.lst call filetype#FTasm() +au BufNewFile,BufRead *.asm,*.[sS],*.[aA],*.mac,*.lst call dist#ft#FTasm() " Macro (VAX) au BufNewFile,BufRead *.mar setf vmasm @@ -184,7 +184,7 @@ au BufNewFile,BufRead *.awk setf awk au BufNewFile,BufRead *.mch,*.ref,*.imp setf b " BASIC or Visual Basic -au BufNewFile,BufRead *.bas call filetype#FTVB("basic") +au BufNewFile,BufRead *.bas call dist#ft#FTVB("basic") " Visual Basic Script (close to Visual Basic) or Visual Basic .NET au BufNewFile,BufRead *.vb,*.vbs,*.dsm,*.ctl setf vb @@ -202,7 +202,7 @@ au BufNewFile,BufRead *.cmd \ if getline(1) =~ '^/\*' | setf rexx | else | setf dosbatch | endif " Batch file for 4DOS -au BufNewFile,BufRead *.btm call filetype#FTbtm() +au BufNewFile,BufRead *.btm call dist#ft#FTbtm() " BC calculator au BufNewFile,BufRead *.bc setf bc @@ -222,7 +222,7 @@ au BufNewFile,BufRead named*.conf,rndc*.conf,rndc*.key setf named " BIND zone au BufNewFile,BufRead named.root setf bindzone -au BufNewFile,BufRead *.db call filetype#BindzoneCheck('') +au BufNewFile,BufRead *.db call dist#ft#BindzoneCheck('') " Blank au BufNewFile,BufRead *.bl setf blank @@ -238,7 +238,7 @@ if has("fname_case") endif " C or lpc -au BufNewFile,BufRead *.c call filetype#FTlpc() +au BufNewFile,BufRead *.c call dist#ft#FTlpc() " Calendar au BufNewFile,BufRead calendar setf calendar @@ -292,7 +292,7 @@ endif " .h files can be C, Ch C++, ObjC or ObjC++. " Set c_syntax_for_h if you want C, ch_syntax_for_h if you want Ch. ObjC is " detected automatically. -au BufNewFile,BufRead *.h call filetype#FTheader() +au BufNewFile,BufRead *.h call dist#ft#FTheader() " Ch (CHscript) au BufNewFile,BufRead *.chf setf ch @@ -326,7 +326,7 @@ au BufNewFile,BufRead NEWS au BufNewFile,BufRead *..ch setf chill " Changes for WEB and CWEB or CHILL -au BufNewFile,BufRead *.ch call filetype#FTchange() +au BufNewFile,BufRead *.ch call dist#ft#FTchange() " ChordPro au BufNewFile,BufRead *.chopro,*.crd,*.cho,*.crdpro,*.chordpro setf chordpro @@ -338,7 +338,7 @@ au BufNewFile,BufRead *.dcl,*.icl setf clean au BufNewFile,BufRead *.eni setf cl " Clever or dtd -au BufNewFile,BufRead *.ent call filetype#FTent() +au BufNewFile,BufRead *.ent call dist#ft#FTent() " Clipper (or FoxPro; could also be eviews) au BufNewFile,BufRead *.prg @@ -393,9 +393,9 @@ au BufNewFile,BufRead *enlightenment/*.cfg setf c au BufNewFile,BufRead *Eterm/*.cfg setf eterm " Euphoria 3 or 4 -au BufNewFile,BufRead *.eu,*.ew,*.ex,*.exu,*.exw call filetype#EuphoriaCheck() +au BufNewFile,BufRead *.eu,*.ew,*.ex,*.exu,*.exw call dist#ft#EuphoriaCheck() if has("fname_case") - au BufNewFile,BufRead *.EU,*.EW,*.EX,*.EXU,*.EXW call filetype#EuphoriaCheck() + au BufNewFile,BufRead *.EU,*.EW,*.EX,*.EXU,*.EXW call dist#ft#EuphoriaCheck() endif " Lynx config files @@ -442,7 +442,7 @@ au BufNewFile,BufRead */etc/dnsmasq.conf setf dnsmasq au BufNewFile,BufRead *.desc setf desc " the D language or dtrace -au BufNewFile,BufRead *.d call filetype#DtraceCheck() +au BufNewFile,BufRead *.d call dist#ft#DtraceCheck() " Desktop files au BufNewFile,BufRead *.desktop,.directory setf desktop @@ -474,7 +474,7 @@ au BufNewFile,BufRead *.rul \ endif " DCL (Digital Command Language - vms) or DNS zone file -au BufNewFile,BufRead *.com call filetype#BindzoneCheck('dcl') +au BufNewFile,BufRead *.com call dist#ft#BindzoneCheck('dcl') " DOT au BufNewFile,BufRead *.dot setf dot @@ -522,7 +522,7 @@ au BufNewFile,BufRead .editorconfig setf dosini au BufNewFile,BufRead *.ecd setf ecd " Eiffel or Specman or Euphoria -au BufNewFile,BufRead *.e,*.E call filetype#FTe() +au BufNewFile,BufRead *.e,*.E call dist#ft#FTe() " Elinks configuration au BufNewFile,BufRead */etc/elinks.conf,*/.elinks/elinks.conf setf elinks @@ -695,7 +695,7 @@ au BufNewFile,BufRead *.hex,*.h32 setf hex au BufNewFile,BufRead *.t.html setf tilde " HTML (.shtml and .stm for server side) -au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call filetype#FThtml() +au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call dist#ft#FThtml() " HTML with Ruby - eRuby au BufNewFile,BufRead *.erb,*.rhtml setf eruby @@ -722,7 +722,7 @@ au BufNewFile,BufRead *.htt,*.htb setf httest au BufNewFile,BufRead *.icn setf icon " IDL (Interface Description Language) -au BufNewFile,BufRead *.idl call filetype#FTidl() +au BufNewFile,BufRead *.idl call dist#ft#FTidl() " Microsoft IDL (Interface Description Language) Also *.idl " MOF = WMI (Windows Management Instrumentation) Managed Object Format @@ -733,10 +733,10 @@ au BufNewFile,BufRead */.icewm/menu setf icemenu " Indent profile (must come before IDL *.pro!) au BufNewFile,BufRead .indent.pro setf indent -au BufNewFile,BufRead indent.pro call filetype#ProtoCheck('indent') +au BufNewFile,BufRead indent.pro call dist#ft#ProtoCheck('indent') " IDL (Interactive Data Language) -au BufNewFile,BufRead *.pro call filetype#ProtoCheck('idlang') +au BufNewFile,BufRead *.pro call dist#ft#ProtoCheck('idlang') " Indent RC au BufNewFile,BufRead indentrc setf indent @@ -950,7 +950,7 @@ au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md setf markdown au BufNewFile,BufRead *.mason,*.mhtml,*.comp setf mason " Mathematica, Matlab, Murphi or Objective C -au BufNewFile,BufRead *.m call filetype#FTm() +au BufNewFile,BufRead *.m call dist#ft#FTm() " Mathematica notebook au BufNewFile,BufRead *.nb setf mma @@ -980,7 +980,7 @@ au BufNewFile,BufRead *.mgl setf mgl au BufNewFile,BufRead *.mix,*.mixal setf mix " MMIX or VMS makefile -au BufNewFile,BufRead *.mms call filetype#FTmms() +au BufNewFile,BufRead *.mms call dist#ft#FTmms() " Symbian meta-makefile definition (MMP) au BufNewFile,BufRead *.mmp setf mmp @@ -1068,10 +1068,10 @@ au BufNewFile,BufRead *.me \ setf nroff | \ endif au BufNewFile,BufRead *.tr,*.nr,*.roff,*.tmac,*.mom setf nroff -au BufNewFile,BufRead *.[1-9] call filetype#FTnroff() +au BufNewFile,BufRead *.[1-9] call dist#ft#FTnroff() " Nroff or Objective C++ -au BufNewFile,BufRead *.mm call filetype#FTmm() +au BufNewFile,BufRead *.mm call dist#ft#FTmm() " Not Quite C au BufNewFile,BufRead *.nqc setf nqc @@ -1126,9 +1126,9 @@ au BufNewFile,BufRead *.pcmk setf pcmk " Perl if has("fname_case") - au BufNewFile,BufRead *.pl,*.PL call filetype#FTpl() + au BufNewFile,BufRead *.pl,*.PL call dist#ft#FTpl() else - au BufNewFile,BufRead *.pl call filetype#FTpl() + au BufNewFile,BufRead *.pl call dist#ft#FTpl() endif au BufNewFile,BufRead *.plx,*.al,*.psgi setf perl au BufNewFile,BufRead *.p6,*.pm6,*.pl6 setf perl6 @@ -1195,7 +1195,7 @@ au BufNewFile,BufRead *.pov setf pov au BufNewFile,BufRead .povrayrc setf povini " Povray, PHP or assembly -au BufNewFile,BufRead *.inc call filetype#FTinc() +au BufNewFile,BufRead *.inc call dist#ft#FTinc() " Printcap and Termcap au BufNewFile,BufRead *printcap @@ -1224,13 +1224,13 @@ au BufNewFile,BufRead *.action setf privoxy au BufNewFile,BufRead .procmail,.procmailrc setf procmail " Progress or CWEB -au BufNewFile,BufRead *.w call filetype#FTprogress_cweb() +au BufNewFile,BufRead *.w call dist#ft#FTprogress_cweb() " Progress or assembly -au BufNewFile,BufRead *.i call filetype#FTprogress_asm() +au BufNewFile,BufRead *.i call dist#ft#FTprogress_asm() " Progress or Pascal -au BufNewFile,BufRead *.p call filetype#FTprogress_pascal() +au BufNewFile,BufRead *.p call dist#ft#FTprogress_pascal() " Software Distributor Product Specification File (POSIX 1387.2-1995) au BufNewFile,BufRead *.psf setf psf @@ -1316,7 +1316,7 @@ else endif " Rexx, Rebol or R -au BufNewFile,BufRead *.r,*.R call filetype#FTr() +au BufNewFile,BufRead *.r,*.R call dist#ft#FTr() " Remind au BufNewFile,BufRead .reminders,*.remind,*.rem setf remind @@ -1412,7 +1412,7 @@ au BufNewFile,BufRead *.siv setf sieve au BufNewFile,BufRead sendmail.cf setf sm " Sendmail .mc files are actually m4. Could also be MS Message text file. -au BufNewFile,BufRead *.mc call filetype#McSetf() +au BufNewFile,BufRead *.mc call dist#ft#McSetf() " Services au BufNewFile,BufRead */etc/services setf services @@ -1453,23 +1453,23 @@ au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog') " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc. " Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts -au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD* call filetype#SetFileTypeSH("bash") -au BufNewFile,BufRead .kshrc*,*.ksh call filetype#SetFileTypeSH("ksh") -au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call filetype#SetFileTypeSH(getline(1)) +au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD* call dist#ft#SetFileTypeSH("bash") +au BufNewFile,BufRead .kshrc*,*.ksh call dist#ft#SetFileTypeSH("ksh") +au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1)) " Shell script (Arch Linux) or PHP file (Drupal) au BufNewFile,BufRead *.install \ if getline(1) =~ ' -" Last Change: 2017 Jan 18 +" Last Change: 2017 Nov 11 " To make the ":Man" command available before editing a manual page, source " this script from your startup vimrc file. @@ -15,12 +15,6 @@ if &filetype == "man" endif let b:did_ftplugin = 1 - " Ensure Vim is not recursively invoked (man-db does this) - " when doing ctrl-[ on a man page reference. - if exists("$MANPAGER") - let $MANPAGER = "" - endif - " allow dot and dash in manual page name. setlocal iskeyword+=\.,- @@ -176,7 +170,11 @@ func GetPage(...) let $MANWIDTH = winwidth(0) let unsetwidth = 1 endif - silent exec "r !man ".s:GetCmdArg(sect, page)." | col -b" + + " Ensure Vim is not recursively invoked (man-db does this) when doing ctrl-[ + " on a man page reference by unsetting MANPAGER. + silent exec "r !env -u MANPAGER man ".s:GetCmdArg(sect, page)." | col -b" + if unsetwidth let $MANWIDTH = '' endif diff --git a/runtime/ftplugin/python.vim b/runtime/ftplugin/python.vim index d52a338b5b..54926418de 100644 --- a/runtime/ftplugin/python.vim +++ b/runtime/ftplugin/python.vim @@ -3,7 +3,7 @@ " Maintainer: Tom Picton " Previous Maintainer: James Sully " Previous Maintainer: Johannes Zellner -" Last Change: Fri, 20 October 2017 +" Last Change: Thur, 09 November 2017 " https://github.com/tpict/vim-ftplugin-python if exists("b:did_ftplugin") | finish | endif @@ -29,8 +29,8 @@ let b:next_endtoplevel='\v%$\|\S.*\n+(def\|class)' let b:prev_endtoplevel='\v\S.*\n+(def\|class)' let b:next='\v%$\|^\s*(class\|def\|async def)>' let b:prev='\v^\s*(class\|def\|async def)>' -let b:next_end='\v\S\n*(%$\|^\s*(class\|def\|async def)\|^\S)' -let b:prev_end='\v\S\n*(^\s*(class\|def\|async def)\|^\S)' +let b:next_end='\v\S\n*(%$\|^(\s*\n*)*(class\|def\|async def)\|^\S)' +let b:prev_end='\v\S\n*(^(\s*\n*)*(class\|def\|async def)\|^\S)' execute "nnoremap ]] :call Python_jump('n', '". b:next_toplevel."', 'W')" execute "nnoremap [[ :call Python_jump('n', '". b:prev_toplevel."', 'Wb')" @@ -43,8 +43,8 @@ execute "nnoremap [M :call Python_jump('n', '". b:prev_en execute "onoremap ]] :call Python_jump('o', '". b:next_toplevel."', 'W')" execute "onoremap [[ :call Python_jump('o', '". b:prev_toplevel."', 'Wb')" -execute "onoremap ][ :call Python_jump('n', '". b:next_endtoplevel."', 'W', 0)" -execute "onoremap [] :call Python_jump('n', '". b:prev_endtoplevel."', 'Wb', 0)" +execute "onoremap ][ :call Python_jump('o', '". b:next_endtoplevel."', 'W', 0)" +execute "onoremap [] :call Python_jump('o', '". b:prev_endtoplevel."', 'Wb', 0)" execute "onoremap ]m :call Python_jump('o', '". b:next."', 'W')" execute "onoremap [m :call Python_jump('o', '". b:prev."', 'Wb')" execute "onoremap ]M :call Python_jump('o', '". b:next_end."', 'W', 0)" @@ -52,8 +52,8 @@ execute "onoremap [M :call Python_jump('o', '". b:prev_en execute "xnoremap ]] :call Python_jump('x', '". b:next_toplevel."', 'W')" execute "xnoremap [[ :call Python_jump('x', '". b:prev_toplevel."', 'Wb')" -execute "xnoremap ][ :call Python_jump('n', '". b:next_endtoplevel."', 'W', 0)" -execute "xnoremap [] :call Python_jump('n', '". b:prev_endtoplevel."', 'Wb', 0)" +execute "xnoremap ][ :call Python_jump('x', '". b:next_endtoplevel."', 'W', 0)" +execute "xnoremap [] :call Python_jump('x', '". b:prev_endtoplevel."', 'Wb', 0)" execute "xnoremap ]m :call Python_jump('x', '". b:next."', 'W')" execute "xnoremap [m :call Python_jump('x', '". b:prev."', 'Wb')" execute "xnoremap ]M :call Python_jump('x', '". b:next_end."', 'W', 0)" diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index f355d2837d..1f2e57c675 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Vim " Maintainer: Bram Moolenaar -" Last Change: 2014 Sep 07 +" Last Change: 2017 Nov 06 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -25,6 +25,9 @@ setlocal fo-=t fo+=croql " keyword character. E.g., for netrw#Nread(). setlocal isk+=# +" Use :help to lookup the keyword under the cursor with K. +setlocal keywordprg=:help + " Set 'comments' to format dashed lists in comments setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\" diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index a4dbf536ae..635bf93f23 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -20,6 +20,9 @@ if exists(':Termdebug') finish endif +" Uncomment this line to write logging in "debuglog". +" call ch_logfile('debuglog', 'w') + " The command that starts debugging, e.g. ":Termdebug vim". " To end type "quit" in the gdb window. command -nargs=* -complete=file Termdebug call s:StartDebug() @@ -31,6 +34,7 @@ endif let s:pc_id = 12 let s:break_id = 13 +let s:stopped = 1 if &background == 'light' hi default debugPC term=reverse ctermbg=lightblue guibg=lightblue @@ -83,11 +87,11 @@ func s:StartDebug(cmd) " Add -quiet to avoid the intro message causing a hit-enter prompt. let cmd = [g:termdebugger, '-quiet', '-tty', pty, a:cmd] echomsg 'executing "' . join(cmd) . '"' - let gdbbuf = term_start(cmd, { + let s:gdbbuf = term_start(cmd, { \ 'exit_cb': function('s:EndDebug'), \ 'term_finish': 'close', \ }) - if gdbbuf == 0 + if s:gdbbuf == 0 echoerr 'Failed to open the gdb terminal window' exe 'bwipe! ' . s:ptybuf exe 'bwipe! ' . s:commbuf @@ -97,7 +101,12 @@ func s:StartDebug(cmd) " Connect gdb to the communication pty, using the GDB/MI interface " If you get an error "undefined command" your GDB is too old. - call term_sendkeys(gdbbuf, 'new-ui mi ' . commpty . "\r") + call term_sendkeys(s:gdbbuf, 'new-ui mi ' . commpty . "\r") + + " Interpret commands while the target is running. This should usualy only be + " exec-interrupt, since many commands don't work properly while the target is + " running. + call s:SendCommand('-gdb-set mi-async on') " Sign used to highlight the line where the program has stopped. " There can be only one. @@ -170,6 +179,9 @@ func s:InstallCommands() command Step call s:SendCommand('-exec-step') command Over call s:SendCommand('-exec-next') command Finish call s:SendCommand('-exec-finish') + command -nargs=* Run call s:Run() + command -nargs=* Arguments call s:SendCommand('-exec-arguments ' . ) + command Stop call s:SendCommand('-exec-interrupt') command Continue call s:SendCommand('-exec-continue') command -range -nargs=* Evaluate call s:Evaluate(, ) command Gdb call win_gotoid(s:gdbwin) @@ -183,6 +195,7 @@ func s:InstallCommands() nnoremenu WinBar.Next :Over nnoremenu WinBar.Finish :Finish nnoremenu WinBar.Cont :Continue + nnoremenu WinBar.Stop :Stop nnoremenu WinBar.Eval :Evaluate endif endfunc @@ -194,6 +207,9 @@ func s:DeleteCommands() delcommand Step delcommand Over delcommand Finish + delcommand Run + delcommand Arguments + delcommand Stop delcommand Continue delcommand Evaluate delcommand Gdb @@ -206,6 +222,7 @@ func s:DeleteCommands() aunmenu WinBar.Next aunmenu WinBar.Finish aunmenu WinBar.Cont + aunmenu WinBar.Stop aunmenu WinBar.Eval endif @@ -220,8 +237,19 @@ endfunc " :Break - Set a breakpoint at the cursor position. func s:SetBreakpoint() - call term_sendkeys(s:commbuf, '-break-insert --source ' - \ . fnameescape(expand('%:p')) . ' --line ' . line('.') . "\r") + " Setting a breakpoint may not work while the program is running. + " Interrupt to make it work. + let do_continue = 0 + if !s:stopped + let do_continue = 1 + call s:SendCommand('-exec-interrupt') + sleep 10m + endif + call s:SendCommand('-break-insert --source ' + \ . fnameescape(expand('%:p')) . ' --line ' . line('.')) + if do_continue + call s:SendCommand('-exec-continue') + endif endfunc " :Delete - Delete a breakpoint at the cursor position. @@ -244,6 +272,13 @@ func s:SendCommand(cmd) call term_sendkeys(s:commbuf, a:cmd . "\r") endfunc +func s:Run(args) + if a:args != '' + call s:SendCommand('-exec-arguments ' . a:args) + endif + call s:SendCommand('-exec-run') +endfunc + " :Evaluate - evaluate what is under the cursor func s:Evaluate(range, arg) if a:arg != '' @@ -259,7 +294,7 @@ func s:Evaluate(range, arg) else let expr = expand('') endif - call term_sendkeys(s:commbuf, '-data-evaluate-expression "' . expr . "\"\r") + call s:SendCommand('-data-evaluate-expression "' . expr . '"') let s:evalexpr = expr endfunc @@ -269,7 +304,7 @@ func s:HandleEvaluate(msg) let value = substitute(value, '\\"', '"', 'g') echomsg '"' . s:evalexpr . '": ' . value - if s:evalexpr[0] != '*' && value =~ '^0x' && value !~ '"$' + if s:evalexpr[0] != '*' && value =~ '^0x' && value != '0x0' && value !~ '"$' " Looks like a pointer, also display what it points to. let s:evalexpr = '*' . s:evalexpr call term_sendkeys(s:commbuf, '-data-evaluate-expression "' . s:evalexpr . "\"\r") @@ -286,6 +321,12 @@ endfunc func s:HandleCursor(msg) let wid = win_getid(winnr()) + if a:msg =~ '^\*stopped' + let s:stopped = 1 + elseif a:msg =~ '^\*running' + 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) diff --git a/runtime/plugin/manpager.vim b/runtime/plugin/manpager.vim index be6e30b70f..9ae2e7357f 100644 --- a/runtime/plugin/manpager.vim +++ b/runtime/plugin/manpager.vim @@ -1,6 +1,6 @@ " Vim plugin for using Vim as manpager. " Maintainer: Enno Nagel -" Last Change: 2016 May 20 +" Last Change: 2017 November 07 " $MAN_PN is supposed to be set by MANPAGER, see ":help manpager.vim". if empty($MAN_PN) @@ -10,17 +10,17 @@ endif command! -nargs=0 MANPAGER call s:MANPAGER() | delcommand MANPAGER function! s:MANPAGER() - let page_pattern = '\v\w+%([-_.]\w+)*' + let page_pattern = '\v\w[-_.:0-9A-Za-z]*' let sec_pattern = '\v\w+%(\+\w+)*' let pagesec_pattern = '\v(' . page_pattern . ')\((' . sec_pattern . ')\)' if $MAN_PN is '1' - let manpage = matchstr( getline(1), '^' . pagesec_pattern ) + let manpage = tolower(matchstr( getline(nextnonblank(1)), '^' . pagesec_pattern )) else - let manpage = expand('$MAN_PN') + let manpage = expand($MAN_PN) endif - let page_sec = matchlist(tolower(manpage), '^' . pagesec_pattern . '$') + let page_sec = matchlist(manpage, '^' . pagesec_pattern . '$') bwipe! diff --git a/runtime/scripts.vim b/runtime/scripts.vim index 24799c4287..18263e2842 100644 --- a/runtime/scripts.vim +++ b/runtime/scripts.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types in scripts " " Maintainer: Bram Moolenaar -" Last change: 2017 Nov 09 +" Last change: 2017 Nov 11 " This file is called by an autocommand for every file that has just been " loaded into a buffer. It checks if the type of file can be recognized by @@ -66,19 +66,19 @@ if s:line1 =~# "^#!" " Bourne-like shell scripts: bash bash2 ksh ksh93 sh if s:name =~# '^\(bash\d*\|\|ksh\d*\|sh\)\>' - call filetype#SetFileTypeSH(s:line1) " defined in filetype.vim + call dist#ft#SetFileTypeSH(s:line1) " defined in filetype.vim " csh scripts elseif s:name =~# '^csh\>' if exists("g:filetype_csh") - call filetype#SetFileTypeShell(g:filetype_csh) + call dist#ft#SetFileTypeShell(g:filetype_csh) else - call filetype#SetFileTypeShell("csh") + call dist#ft#SetFileTypeShell("csh") endif " tcsh scripts elseif s:name =~# '^tcsh\>' - call filetype#SetFileTypeShell("tcsh") + call dist#ft#SetFileTypeShell("tcsh") " Z shell scripts elseif s:name =~# '^zsh\>' @@ -185,7 +185,7 @@ else " Bourne-like shell scripts: sh ksh bash bash2 if s:line1 =~# '^:$' - call filetype#SetFileTypeSH(s:line1) " defined in filetype.vim + call dist#ft#SetFileTypeSH(s:line1) " defined in filetype.vim " Z shell scripts elseif s:line1 =~# '^#compdef\>' || s:line1 =~# '^#autoload\>' || diff --git a/runtime/syntax/debcontrol.vim b/runtime/syntax/debcontrol.vim index 1131c9e12f..b8790747aa 100644 --- a/runtime/syntax/debcontrol.vim +++ b/runtime/syntax/debcontrol.vim @@ -3,7 +3,7 @@ " Maintainer: Debian Vim Maintainers " Former Maintainers: Gerfried Fuchs " Wichert Akkerman -" Last Change: 2017 Aug 18 +" Last Change: 2017 Nov 04 " URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debcontrol.vim " Standard syntax initialization @@ -17,6 +17,8 @@ set cpo&vim " Should match case except for the keys of each field syn case match +syn iskeyword @,48-57,-,/ + " Everything that is not explicitly matched by the rules below syn match debcontrolElse "^.*$" @@ -24,24 +26,50 @@ syn match debcontrolElse "^.*$" syn match debControlComma ",[ \t]*" syn match debControlSpace "[ \t]" -let s:kernels = '\%(linux\|hurd\|kfreebsd\|knetbsd\|kopensolaris\|netbsd\)' -let s:archs = '\%(alpha\|amd64\|armeb\|armel\|armhf\|arm64\|avr32\|hppa\|i386' - \ . '\|ia64\|lpia\|m32r\|m68k\|mipsel\|mips64el\|mips\|powerpcspe\|powerpc\|ppc64el' - \ . '\|ppc64\|s390x\|s390\|sh3eb\|sh3\|sh4eb\|sh4\|sh\|sparc64\|sparc\|x32\)' -let s:pairs = 'hurd-i386\|kfreebsd-i386\|kfreebsd-amd64\|knetbsd-i386\|kopensolaris-i386\|netbsd-alpha\|netbsd-i386' +let s:kernels = ['linux', 'hurd', 'kfreebsd', 'knetbsd', 'kopensolaris', 'netbsd'] +let s:archs = [ + \ 'alpha', 'amd64', 'armeb', 'armel', 'armhf', 'arm64', 'avr32', 'hppa' + \, 'i386', 'ia64', 'lpia', 'm32r', 'm68k', 'mipsel', 'mips64el', 'mips' + \, 'powerpcspe', 'powerpc', 'ppc64el', 'ppc64', 's390x', 's390', 'sh3eb' + \, 'sh3', 'sh4eb', 'sh4', 'sh', 'sparc64', 'sparc', 'x32' + \ ] +let s:pairs = [ + \ 'hurd-i386', 'kfreebsd-i386', 'kfreebsd-amd64', 'knetbsd-i386' + \, 'kopensolaris-i386', 'netbsd-alpha', 'netbsd-i386' + \ ] " Define some common expressions we can use later on -exe 'syn match debcontrolArchitecture contained "\%(all\|'. s:kernels .'-any\|\%(any-\)\='. s:archs .'\|'. s:pairs .'\|any\)"' +syn keyword debcontrolArchitecture contained all any +exe 'syn keyword debcontrolArchitecture contained '. join(map(s:kernels, {k,v -> v .'-any'})) +exe 'syn keyword debcontrolArchitecture contained '. join(map(s:archs, {k,v -> 'any-'.v})) +exe 'syn keyword debcontrolArchitecture contained '. join(s:archs) +exe 'syn keyword debcontrolArchitecture contained '. join(s:pairs) unlet s:kernels s:archs s:pairs -syn match debcontrolMultiArch contained "\%(no\|foreign\|allowed\|same\)" +let s:sections = [ + \ 'admin', 'cli-mono', 'comm', 'database', 'debian-installer', 'debug' + \, 'devel', 'doc', 'editors', 'education', 'electronics', 'embedded' + \, 'fonts', 'games', 'gnome', 'gnustep', 'gnu-r', 'golang', 'graphics' + \, 'hamradio', 'haskell', 'httpd', 'interpreters', 'introspection' + \, 'java', 'javascript', 'kde', 'kernel', 'libs', 'libdevel', 'lisp' + \, 'localization', 'mail', 'math', 'metapackages', 'misc', 'net' + \, 'news', 'ocaml', 'oldlibs', 'otherosfs', 'perl', 'php', 'python' + \, 'ruby', 'rust', 'science', 'shells', 'sound', 'text', 'tex' + \, 'utils', 'vcs', 'video', 'web', 'x11', 'xfce', 'zope' + \ ] + +syn keyword debcontrolMultiArch contained no foreign allowed same syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+" -syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)" -syn match debcontrolSection contained "\v((contrib|non-free|non-US/main|non-US/contrib|non-US/non-free|restricted|universe|multiverse)/)?(admin|cli-mono|comm|database|debian-installer|debug|devel|doc|editors|education|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|introspection|java%(script)=|kde|kernel|libs|libdevel|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|rust|science|shells|sound|text|tex|utils|vcs|video|web|x11|xfce|zope)" -syn match debcontrolPackageType contained "u\?deb" +syn keyword debcontrolPriority contained extra important optional required standard +exe 'syn match debcontrolSection contained "\%(\%(contrib\|non-free\|non-US/main\|non-US/contrib\|non-US/non-free\|restricted\|universe\|multiverse\)/\)\=\%('.join(s:sections, '\|').'\)"' +syn keyword debcontrolPackageType contained udeb deb syn match debcontrolVariable contained "\${.\{-}}" -syn match debcontrolDmUpload contained "\cyes" +syn keyword debcontrolDmUpload contained yes +syn keyword debcontrolYesNo contained yes no +syn match debcontrolR3 contained "\<\%(no\|binary-targets\|[[:graph:]]\+/[[:graph:]]\+\%( \+[[:graph:]]\+/[[:graph:]]\+\)*\)\>" + +unlet s:sections " A URL (using the domain name definitions from RFC 1034 and 1738), right now " only enforce protocol and some sanity on the server/path part; @@ -59,15 +87,28 @@ syn match debcontrolComment "^#.*$" contains=@Spell syn case ignore -" List of all legal keys -syn match debcontrolKey contained "^\%(Source\|Package\|Section\|Priority\|\%(XSBC-Original-\)\=Maintainer\|Uploaders\|Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|Standards-Version\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Enhances\|Breaks\|Essential\|Architecture\|Multi-Arch\|Description\|Bugs\|Origin\|X[SB]-Python-Version\|Homepage\|\(XS-\)\=Vcs-\(Browser\|Arch\|Bzr\|Cvs\|Darcs\|Git\|Hg\|Mtn\|Svn\)\|\%(XC-\)\=Package-Type\|\%(XS-\)\=Testsuite\): *" +" List of all legal keys, in order, from deb-src-control(5) +" Source fields +syn match debcontrolKey contained "^\%(Source\|Maintainer\|Uploaders\|Standards-Version\|Description\|Homepage\|Bugs\|Rules-Requires-Root\): *" +syn match debcontrolKey contained "^\%(XS-\)\=Vcs-\%(Arch\|Bzr\|Cvs\|Darcs\|Git\|Hg\|Mtn\|Svn\|Browser\): *" +syn match debcontrolKey contained "^\%(Origin\|Section\|Priority\): *" +syn match debcontrolKey contained "^Build-\%(Depends\|Conflicts\)\%(-Arch\|-Indep\)\=: *" + +" Binary fields +syn match debcontrolKey contained "^\%(Package\%(-Type\)\=\|Architecture\|Build-Profiles\): *" +syn match debcontrolKey contained "^\%(\%(Build-\)\=Essential\|Multi-Arch\|Tag\): *" +syn match debcontrolKey contained "^\%(\%(Pre-\)\=Depends\|Recommends\|Suggests\|Breaks\|Enhances\|Replaces\|Conflicts\|Provides\|Built-Using\): *" +syn match debcontrolKey contained "^\%(Subarchitecture\|Kernel-Version\|Installer-Menu-Item\): *" + +" User-defined fields +syn match debcontrolKey contained "^X[SBC]\{0,3\}\%(-Private\)\=-[-a-zA-Z0-9]\+: *" syn match debcontrolDeprecatedKey contained "^\%(\%(XS-\)\=DM-Upload-Allowed\): *" " Fields for which we do strict syntax checking syn region debcontrolStrictField start="^Architecture" end="$" contains=debcontrolKey,debcontrolArchitecture,debcontrolSpace oneline syn region debcontrolStrictField start="^Multi-Arch" end="$" contains=debcontrolKey,debcontrolMultiArch oneline -syn region debcontrolStrictField start="^\(Package\|Source\)" end="$" contains=debcontrolKey,debcontrolName oneline +syn region debcontrolStrictField start="^\%(Package\|Source\)" end="$" contains=debcontrolKey,debcontrolName oneline syn region debcontrolStrictField start="^Priority" end="$" contains=debcontrolKey,debcontrolPriority oneline syn region debcontrolStrictField start="^Section" end="$" contains=debcontrolKey,debcontrolSection oneline syn region debcontrolStrictField start="^\%(XC-\)\=Package-Type" end="$" contains=debcontrolKey,debcontrolPackageType oneline @@ -77,10 +118,12 @@ syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Svn" end="$" contains=deb syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Cvs" end="$" contains=debcontrolKey,debcontrolVcsCvs oneline keepend syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Git" end="$" contains=debcontrolKey,debcontrolVcsGit oneline keepend syn region debcontrolStrictField start="^\%(XS-\)\=DM-Upload-Allowed" end="$" contains=debcontrolDeprecatedKey,debcontrolDmUpload oneline +syn region debcontrolStrictField start="^Rules-Requires-Root" end="$" contains=debcontrolKey,debcontrolR3 oneline +syn region debcontrolStrictField start="^\%(Build-\)\=Essential" end="$" contains=debcontrolKey,debcontrolYesNo oneline " Catch-all for the other legal fields -syn region debcontrolField start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Essential\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\|\%(XS-\)\=Testsuite\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline -syn region debcontrolMultiField start="^\%(Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Enhances\|Breaks\|Uploaders\|Description\):" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment +syn region debcontrolField start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\|\%(XS-\)\=Testsuite\|Build-Profiles\|Tag\|Subarchitecture\|Kernel-Version\|Installer-Menu-Item\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline +syn region debcontrolMultiField start="^\%(Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Breaks\|Enhances\|Replaces\|Conflicts\|Provides\|Built-Using\|Uploaders\|X[SBC]\{0,3\}\%(Private-\)\=-[-a-zA-Z0-9]\+\):" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment syn region debcontrolMultiFieldSpell start="^\%(Description\):" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment,@Spell " Associate our matches and regions with pretty colours @@ -102,6 +145,8 @@ hi def link debcontrolVcsCvs Identifier hi def link debcontrolVcsGit Identifier hi def link debcontrolHTTPUrl Identifier hi def link debcontrolDmUpload Identifier +hi def link debcontrolYesNo Identifier +hi def link debcontrolR3 Identifier hi def link debcontrolComment Comment hi def link debcontrolElse Special diff --git a/runtime/syntax/debsources.vim b/runtime/syntax/debsources.vim index 4fa80debec..6791ece294 100644 --- a/runtime/syntax/debsources.vim +++ b/runtime/syntax/debsources.vim @@ -2,7 +2,7 @@ " Language: Debian sources.list " Maintainer: Debian Vim Maintainers " Former Maintainer: Matthijs Mohlmann -" Last Change: 2017 Apr 22 +" Last Change: 2017 Oct 28 " URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debsources.vim " Standard syntax initialization @@ -23,18 +23,18 @@ let s:cpo = &cpo set cpo-=C let s:supported = [ \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', - \ 'squeeze', 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy', + \ 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy', \ - \ 'trusty', 'xenial', 'yakkety', 'zesty', 'artful', 'devel' + \ 'trusty', 'xenial', 'zesty', 'artful', 'bionic', 'devel' \ ] let s:unsupported = [ \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato', - \ 'woody', 'sarge', 'etch', 'lenny', + \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', \ \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty', \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid', \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy', - \ 'utopic', 'vivid', 'wily' + \ 'utopic', 'vivid', 'wily', 'yakkety' \ ] let &cpo=s:cpo diff --git a/runtime/syntax/fstab.vim b/runtime/syntax/fstab.vim index 39c1a00b39..56237c0770 100644 --- a/runtime/syntax/fstab.vim +++ b/runtime/syntax/fstab.vim @@ -2,8 +2,8 @@ " Language: fstab file " Maintainer: Radu Dineiu " URL: https://raw.github.com/rid9/vim-fstab/master/fstab.vim -" Last Change: 2013 May 21 -" Version: 1.0 +" Last Change: 2017 Nov 09 +" Version: 1.2 " " Credits: " David Necas (Yeti) @@ -38,10 +38,14 @@ syn match fsDeviceError /\%([^a-zA-Z0-9_\/#@:\.-]\|^\w\{-}\ze\W\)/ contained syn keyword fsDeviceKeyword contained none proc linproc tmpfs devpts devtmpfs sysfs usbfs syn keyword fsDeviceKeyword contained LABEL nextgroup=fsDeviceLabel syn keyword fsDeviceKeyword contained UUID nextgroup=fsDeviceUUID +syn keyword fsDeviceKeyword contained PARTLABEL nextgroup=fsDevicePARTLABEL +syn keyword fsDeviceKeyword contained PARTUUID nextgroup=fsDevicePARTUUID syn keyword fsDeviceKeyword contained sshfs nextgroup=fsDeviceSshfs syn match fsDeviceKeyword contained /^[a-zA-Z0-9.\-]\+\ze:/ syn match fsDeviceLabel contained /=[^ \t]\+/hs=s+1 contains=fsOperator syn match fsDeviceUUID contained /=[^ \t]\+/hs=s+1 contains=fsOperator +syn match fsDevicePARTLABEL contained /=[^ \t]\+/hs=s+1 contains=fsOperator +syn match fsDevicePARTUUID contained /=[^ \t]\+/hs=s+1 contains=fsOperator syn match fsDeviceSshfs contained /#[_=[:alnum:]\.\/+-]\+@[a-z0-9._-]\+\a\{2}:[^ \t]\+/hs=s+1 contains=fsOperator " Mount Point @@ -64,7 +68,7 @@ syn match fsOptionsString /[a-zA-Z0-9_-]\+/ syn keyword fsOptionsYesNo yes no syn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatCheck syn keyword fsOptionsSize 512 1024 2048 -syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand nosuid nosymfollow nouser owner rbind rdonly remount ro rq rw suid suiddir supermount sw sync union update user users xx +syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand norelatime nosuid nosymfollow nouser owner rbind rdonly relatime remount ro rq rw suid suiddir supermount sw sync union update user users wxallowed xx syn match fsOptionsGeneral /_netdev/ " Options: adfs @@ -137,7 +141,7 @@ syn match fsOptionsKeywords contained /\<\%(dir\|file\|\)_umask=/ nextgroup=fsOp syn match fsOptionsKeywords contained /\<\%(session\|part\)=/ nextgroup=fsOptionsNumber " Options: ffs -syn keyword fsOptionsKeyWords contained softdep +syn keyword fsOptionsKeyWords contained noperm softdep " Options: hpfs syn match fsOptionsKeywords contained /\&5 +$as_echo_n "checking --enable-autoservername argument... " >&6; } +# Check whether --enable-autoservername was given. +if test "${enable_autoservername+set}" = set; then : + enableval=$enable_autoservername; +else + enable_autoservername="no" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_autoservername" >&5 +$as_echo "$enable_autoservername" >&6; } +if test "$enable_autoservername" = "yes"; then + $as_echo "#define FEAT_AUTOSERVERNAME 1" >>confdefs.h + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-multibyte argument" >&5 $as_echo_n "checking --enable-multibyte argument... " >&6; } # Check whether --enable-multibyte was given. diff --git a/src/channel.c b/src/channel.c index fe57e207c0..8d87745526 100644 --- a/src/channel.c +++ b/src/channel.c @@ -2917,8 +2917,6 @@ channel_close(channel_T *channel, int invoke_close_cb) channel->ch_close_cb = NULL; channel->ch_close_partial = NULL; - --channel->ch_refcount; - if (channel_need_redraw) { channel_need_redraw = FALSE; @@ -2929,6 +2927,8 @@ channel_close(channel_T *channel, int invoke_close_cb) /* any remaining messages are useless now */ for (part = PART_SOCK; part < PART_IN; ++part) drop_messages(channel, part); + + --channel->ch_refcount; } } diff --git a/src/config.h.in b/src/config.h.in index e692d40ac5..ec9fc59202 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -384,6 +384,9 @@ /* Define if you want to include multibyte support. */ #undef FEAT_MBYTE +/* Define if you want to always define a server name at vim startup. */ +#undef FEAT_AUTOSERVERNAME + /* Define if you want to include fontset support. */ #undef FEAT_XFONTSET diff --git a/src/configure.ac b/src/configure.ac index 5112669d65..e131673b34 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -2130,6 +2130,15 @@ if test "$enable_terminal" = "yes"; then AC_SUBST(TERM_OBJ) fi +AC_MSG_CHECKING(--enable-autoservername argument) +AC_ARG_ENABLE(autoservername, + [ --enable-autoservername Automatically define servername at vim startup.], , + [enable_autoservername="no"]) +AC_MSG_RESULT($enable_autoservername) +if test "$enable_autoservername" = "yes"; then + AC_DEFINE(FEAT_AUTOSERVERNAME) +fi + AC_MSG_CHECKING(--enable-multibyte argument) AC_ARG_ENABLE(multibyte, [ --enable-multibyte Include multibyte editing support.], , diff --git a/src/evalfunc.c b/src/evalfunc.c index b773bf0254..2e641bf77f 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -5587,6 +5587,9 @@ f_has(typval_T *argvars, typval_T *rettv) #ifdef FEAT_AUTOCMD "autocmd", #endif +#ifdef FEAT_AUTOSERVERNAME + "autoservername", +#endif #ifdef FEAT_BEVAL "balloon_eval", # ifndef FEAT_GUI_W32 /* other GUIs always have multiline balloons */ diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 154372883d..f86e141fcd 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -2007,7 +2007,8 @@ write_viminfo(char_u *file, int forceit) /* * If we can't create in the same directory, try creating a - * "normal" temp file. + * "normal" temp file. This is just an attempt, renaming the temp + * file might fail as well. */ if (fp_out == NULL) { @@ -2018,11 +2019,29 @@ write_viminfo(char_u *file, int forceit) #if defined(UNIX) && defined(HAVE_FCHOWN) /* - * Make sure the owner can read/write it. This only works for - * root. + * Make sure the original owner can read/write the tempfile and + * otherwise preserve permissions, making sure the group matches. */ if (fp_out != NULL) - ignored = fchown(fileno(fp_out), st_old.st_uid, st_old.st_gid); + { + stat_T tmp_st; + + if (mch_stat((char *)tempname, &tmp_st) >= 0) + { + if (st_old.st_uid != tmp_st.st_uid) + /* Changing the owner might fail, in which case the + * file will now owned by the current user, oh well. */ + ignored = fchown(fileno(fp_out), st_old.st_uid, -1); + if (st_old.st_gid != tmp_st.st_gid + && fchown(fileno(fp_out), -1, st_old.st_gid) == -1) + /* can't set the group to what it should be, remove + * group permissions */ + (void)mch_setperm(tempname, 0600); + } + else + /* can't stat the file, set conservative permissions */ + (void)mch_setperm(tempname, 0600); + } #endif } } @@ -7536,7 +7555,7 @@ ex_sign(exarg_T *eap) int idx; sign_T *sp; sign_T *sp_prev; - buf_T *buf; + buf_T *buf = NULL; /* Parse the subcommand. */ p = skiptowhite(arg); diff --git a/src/ex_docmd.c b/src/ex_docmd.c index ad0bb5910e..735837faa1 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -11730,9 +11730,11 @@ put_view( } /* - * Local directory. + * Local directory, if the current flag is not view options or the "curdir" + * option is included. */ - if (wp->w_localdir != NULL) + if (wp->w_localdir != NULL + && (flagp != &vop_flags || (*flagp & SSOP_CURDIR))) { if (fputs("lcd ", fd) < 0 || ses_put_fname(fd, wp->w_localdir, flagp) == FAIL diff --git a/src/feature.h b/src/feature.h index e3c92b90ff..c932419a2e 100644 --- a/src/feature.h +++ b/src/feature.h @@ -1181,6 +1181,20 @@ # define FEAT_CLIENTSERVER #endif +/* + * +autoservername Automatically generate a servername for clientserver + * when --servername is not passed on the command line. + */ +#if defined(FEAT_CLIENTSERVER) && !defined(FEAT_AUTOSERVERNAME) +# ifdef WIN3264 + /* Always enabled on MS-Windows. */ +# define FEAT_AUTOSERVERNAME +# else + /* Enable here if you don't use configure. */ +/* # define FEAT_AUTOSERVERNAME */ +# endif +#endif + /* * +termresponse send t_RV to obtain terminal response. Used for xterm * to check if mouse dragging can be used and if term diff --git a/src/gui.c b/src/gui.c index a8f3d5def5..343ea2caaa 100644 --- a/src/gui.c +++ b/src/gui.c @@ -1133,6 +1133,9 @@ gui_update_cursor( gui_mch_set_blinking(shape->blinkwait, shape->blinkon, shape->blinkoff); + if (shape->blinkwait == 0 || shape->blinkon == 0 + || shape->blinkoff == 0) + gui_mch_stop_blink(); #ifdef FEAT_TERMINAL if (shape_bg != INVALCOLOR) { @@ -3161,15 +3164,18 @@ button_set: { case NORMAL_BUSY: case OP_PENDING: +# ifdef FEAT_TERMINAL + case TERMINAL: +# endif case NORMAL: checkfor = MOUSE_NORMAL; break; case VISUAL: checkfor = MOUSE_VISUAL; break; case SELECTMODE: checkfor = MOUSE_VISUAL; break; case REPLACE: case REPLACE+LANGMAP: -#ifdef FEAT_VREPLACE +# ifdef FEAT_VREPLACE case VREPLACE: case VREPLACE+LANGMAP: -#endif +# endif case INSERT: case INSERT+LANGMAP: checkfor = MOUSE_INSERT; break; case ASKMORE: diff --git a/src/main.c b/src/main.c index 27147ebb94..06a3047d16 100644 --- a/src/main.c +++ b/src/main.c @@ -3757,12 +3757,18 @@ prepare_server(mparm_T *parmp) /* * Register for remote command execution with :serversend and --remote * unless there was a -X or a --servername '' on the command line. - * Only register nongui-vim's with an explicit --servername argument. + * Only register nongui-vim's with an explicit --servername argument, + * or when compiling with autoservername. * When running as root --servername is also required. */ if (X_DISPLAY != NULL && parmp->servername != NULL && ( -# ifdef FEAT_GUI - (gui.in_use +# if defined(FEAT_AUTOSERVERNAME) || defined(FEAT_GUI) + ( +# if defined(FEAT_AUTOSERVERNAME) + 1 +# else + gui.in_use +# endif # ifdef UNIX && getuid() != ROOT_UID # endif diff --git a/src/option.c b/src/option.c index 6516f32dfd..f92297d4d5 100644 --- a/src/option.c +++ b/src/option.c @@ -3027,7 +3027,8 @@ static struct vimoption options[] = {"viewoptions", "vop", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_SESSION (char_u *)&p_vop, PV_NONE, - {(char_u *)"folds,options,cursor", (char_u *)0L} + {(char_u *)"folds,options,cursor,curdir", + (char_u *)0L} #else (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} diff --git a/src/search.c b/src/search.c index 80ea21ade6..8013df2413 100644 --- a/src/search.c +++ b/src/search.c @@ -2289,7 +2289,7 @@ findmatchlimit( { /* * A comment may contain / * or / /, it may also start or end - * with / * /. Ignore a / * after / /. + * with / * /. Ignore a / * after / / and after *. */ if (pos.col == 0) continue; @@ -2315,6 +2315,7 @@ findmatchlimit( } else if ( linep[pos.col - 1] == '/' && linep[pos.col] == '*' + && (pos.col == 1 || linep[pos.col - 2] != '*') && (int)pos.col < comment_col) { count++; diff --git a/src/testdir/test3.in b/src/testdir/test3.in index c78a66ec13..646fbb35c3 100644 --- a/src/testdir/test3.in +++ b/src/testdir/test3.in @@ -2338,6 +2338,16 @@ CCC 4 /* end of define */ +STARTTEST +:set cin cino& +/a = second +ox +ENDTEST + +{ + a = second/*bug*/*line; +} + STARTTEST :g/^STARTTEST/.,/^ENDTEST/d :1;/start of AUTO/,$wq! test.out diff --git a/src/testdir/test3.ok b/src/testdir/test3.ok index cfb519bdf4..035ea39999 100644 --- a/src/testdir/test3.ok +++ b/src/testdir/test3.ok @@ -2094,3 +2094,9 @@ JSEND 4 /* end of define */ + +{ + a = second/*bug*/*line; + x +} + diff --git a/src/testdir/test_undo.vim b/src/testdir/test_undo.vim index 4ea1c9b69d..30164a6df4 100644 --- a/src/testdir/test_undo.vim +++ b/src/testdir/test_undo.vim @@ -4,22 +4,82 @@ " Also tests :earlier and :later. func Test_undotree() - exe "normal Aabc\" + new + + normal! Aabc set ul=100 - exe "normal Adef\" - set ul=100 - undo let d = undotree() - call assert_true(d.seq_last > 0) - call assert_true(d.seq_cur > 0) - call assert_true(d.seq_cur < d.seq_last) - call assert_true(len(d.entries) > 0) - " TODO: check more members of d + call assert_equal(1, d.seq_last) + call assert_equal(1, d.seq_cur) + call assert_equal(0, d.save_last) + call assert_equal(0, d.save_cur) + call assert_equal(1, len(d.entries)) + call assert_equal(1, d.entries[0].newhead) + call assert_equal(1, d.entries[0].seq) + call assert_true(d.entries[0].time <= d.time_cur) + + normal! Adef + set ul=100 + let d = undotree() + call assert_equal(2, d.seq_last) + call assert_equal(2, d.seq_cur) + call assert_equal(0, d.save_last) + call assert_equal(0, d.save_cur) + call assert_equal(2, len(d.entries)) + call assert_equal(1, d.entries[0].seq) + call assert_equal(1, d.entries[1].newhead) + call assert_equal(2, d.entries[1].seq) + call assert_true(d.entries[1].time <= d.time_cur) + + undo + set ul=100 + let d = undotree() + call assert_equal(2, d.seq_last) + call assert_equal(1, d.seq_cur) + call assert_equal(0, d.save_last) + call assert_equal(0, d.save_cur) + call assert_equal(2, len(d.entries)) + call assert_equal(1, d.entries[0].seq) + call assert_equal(1, d.entries[1].curhead) + call assert_equal(1, d.entries[1].newhead) + call assert_equal(2, d.entries[1].seq) + call assert_true(d.entries[1].time == d.time_cur) + + normal! Aghi + set ul=100 + let d = undotree() + call assert_equal(3, d.seq_last) + call assert_equal(3, d.seq_cur) + call assert_equal(0, d.save_last) + call assert_equal(0, d.save_cur) + call assert_equal(2, len(d.entries)) + call assert_equal(1, d.entries[0].seq) + call assert_equal(2, d.entries[1].alt[0].seq) + call assert_equal(1, d.entries[1].newhead) + call assert_equal(3, d.entries[1].seq) + call assert_true(d.entries[1].time <= d.time_cur) + + undo + set ul=100 + let d = undotree() + call assert_equal(3, d.seq_last) + call assert_equal(1, d.seq_cur) + call assert_equal(0, d.save_last) + call assert_equal(0, d.save_cur) + call assert_equal(2, len(d.entries)) + call assert_equal(1, d.entries[0].seq) + call assert_equal(2, d.entries[1].alt[0].seq) + call assert_equal(1, d.entries[1].curhead) + call assert_equal(1, d.entries[1].newhead) + call assert_equal(3, d.entries[1].seq) + call assert_true(d.entries[1].time == d.time_cur) w! Xtest - call assert_equal(d.save_last + 1, undotree().save_last) + let d = undotree() + call assert_equal(1, d.save_cur) + call assert_equal(1, d.save_last) call delete('Xtest') - bwipe Xtest + bwipe! Xtest endfunc func FillBuffer() diff --git a/src/ui.c b/src/ui.c index 840fa70af7..4a46c05dc9 100644 --- a/src/ui.c +++ b/src/ui.c @@ -2673,6 +2673,21 @@ retnomove: return IN_STATUS_LINE; if (on_sep_line) return IN_SEP_LINE; +#ifdef FEAT_MENU + if (in_winbar) + { + /* A quick second click may arrive as a double-click, but we use it + * as a second click in the WinBar. */ + if ((mod_mask & MOD_MASK_MULTI_CLICK) && !(flags & MOUSE_RELEASED)) + { + wp = mouse_find_win(&row, &col); + if (wp == NULL) + return IN_UNKNOWN; + winbar_click(wp, col); + } + return IN_OTHER_WIN | MOUSE_WINBAR; + } +#endif if (flags & MOUSE_MAY_STOP_VIS) { end_visual_mode(); diff --git a/src/undo.c b/src/undo.c index ec34d26ae2..a70e68076a 100644 --- a/src/undo.c +++ b/src/undo.c @@ -2863,9 +2863,14 @@ u_undoredo(int undo) /* Remember where we are for "g-" and ":earlier 10s". */ curbuf->b_u_seq_cur = curhead->uh_seq; if (undo) + { /* We are below the previous undo. However, to make ":earlier 1s" * work we compute this as being just above the just undone change. */ - --curbuf->b_u_seq_cur; + if (curhead->uh_next.ptr != NULL) + curbuf->b_u_seq_cur = curhead->uh_next.ptr->uh_seq; + else + curbuf->b_u_seq_cur = 0; + } /* Remember where we are for ":earlier 1f" and ":later 1f". */ if (curhead->uh_save_nr != 0) diff --git a/src/version.c b/src/version.c index 1c27c9b6cd..0bb45c4849 100644 --- a/src/version.c +++ b/src/version.c @@ -83,6 +83,11 @@ static char *(features[]) = #else "-autocmd", #endif +#ifdef FEAT_AUTOSERVERNAME + "+autoservername", +#else + "-autoservername", +#endif #ifdef FEAT_BEVAL "+balloon_eval", #else @@ -776,6 +781,32 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1297, +/**/ + 1296, +/**/ + 1295, +/**/ + 1294, +/**/ + 1293, +/**/ + 1292, +/**/ + 1291, +/**/ + 1290, +/**/ + 1289, +/**/ + 1288, +/**/ + 1287, +/**/ + 1286, +/**/ + 1285, /**/ 1284, /**/