aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--CMakeLists.txt9
-rw-r--r--contrib/uncrustify.cfg (renamed from uncrustify.cfg)0
-rw-r--r--runtime/doc/autocmd.txt2
-rw-r--r--runtime/doc/change.txt11
-rw-r--r--runtime/doc/cmdline.txt4
-rw-r--r--runtime/doc/diff.txt15
-rw-r--r--runtime/doc/editing.txt5
-rw-r--r--runtime/doc/eval.txt13
-rw-r--r--runtime/doc/farsi.txt2
-rw-r--r--runtime/doc/gui.txt12
-rw-r--r--runtime/doc/gui_w32.txt10
-rw-r--r--runtime/doc/index.txt4
-rw-r--r--runtime/doc/intro.txt4
-rw-r--r--runtime/doc/mbyte.txt58
-rw-r--r--runtime/doc/options.txt22
-rw-r--r--runtime/doc/os_dos.txt27
-rw-r--r--runtime/doc/os_win32.txt88
-rw-r--r--runtime/doc/print.txt2
-rw-r--r--runtime/doc/quickfix.txt94
-rw-r--r--runtime/doc/quotes.txt4
-rw-r--r--runtime/doc/rileft.txt3
-rw-r--r--runtime/doc/scroll.txt2
-rw-r--r--runtime/doc/syntax.txt16
-rw-r--r--runtime/doc/tabpage.txt3
-rw-r--r--runtime/doc/term.txt2
-rw-r--r--runtime/doc/uganda.txt2
-rw-r--r--runtime/doc/usr_03.txt2
-rw-r--r--runtime/doc/various.txt2
-rw-r--r--runtime/doc/vi_diff.txt19
-rw-r--r--runtime/doc/windows.txt12
-rw-r--r--runtime/filetype.vim6
-rw-r--r--runtime/ftplugin/j.vim32
-rw-r--r--runtime/indent/fortran.vim21
-rw-r--r--runtime/indent/html.vim4
-rw-r--r--runtime/indent/j.vim22
-rw-r--r--runtime/syntax/awk.vim67
-rw-r--r--runtime/syntax/config.vim20
-rw-r--r--runtime/syntax/crontab.vim70
-rw-r--r--runtime/syntax/diff.vim20
-rw-r--r--runtime/syntax/fortran.vim48
-rw-r--r--runtime/syntax/j.vim16
-rw-r--r--runtime/syntax/mplayerconf.vim55
-rw-r--r--runtime/syntax/rpcgen.vim14
-rw-r--r--runtime/syntax/sm.vim16
-rw-r--r--runtime/syntax/strace.vim7
-rw-r--r--runtime/syntax/valgrind.vim19
-rw-r--r--runtime/syntax/yacc.vim4
-rwxr-xr-xscripts/vim-patch.sh33
-rw-r--r--src/nvim/ex_cmds.lua29
-rw-r--r--src/nvim/ex_cmds2.c44
-rw-r--r--src/nvim/ex_cmds_defs.h1
-rw-r--r--src/nvim/ex_docmd.c48
-rw-r--r--src/nvim/if_cscope.c16
-rw-r--r--src/nvim/os/win_defs.h4
-rw-r--r--src/nvim/quickfix.c220
-rw-r--r--src/nvim/screen.c25
-rw-r--r--src/nvim/shada.c107
-rw-r--r--src/nvim/testdir/Makefile1
-rw-r--r--src/nvim/testdir/test_breakindent.in2
-rw-r--r--src/nvim/testdir/test_cdo.in107
-rw-r--r--src/nvim/testdir/test_cdo.ok66
-rw-r--r--src/nvim/testdir/test_eval.in33
-rw-r--r--src/nvim/testdir/test_eval.okbin11106 -> 10814 bytes
-rw-r--r--src/nvim/version.c14
-rw-r--r--test/functional/legacy/fixeol_spec.lua2
-rw-r--r--test/functional/shada/errors_spec.lua20
-rw-r--r--test/functional/shada/variables_spec.lua31
68 files changed, 1131 insertions, 564 deletions
diff --git a/.gitignore b/.gitignore
index 70899dfa8d..ed452c03a9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -67,3 +67,5 @@ local.mk
/runtime/doc/doctags
/runtime/doc/errors.log
+# clint errors, generated by `make lint`
+errors.json
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6c471ece71..43f283d8f7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,8 +6,13 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# Prefer our bundled versions of dependencies.
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
-list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
-set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
+if(CMAKE_CROSSCOMPILING AND NOT UNIX)
+ list(INSERT CMAKE_FIND_ROOT_PATH 0 ${DEPS_PREFIX})
+ list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX}/../host/bin)
+else()
+ list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
+ set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
+endif()
# used for check_c_compiler_flag
include(CheckCCompilerFlag)
diff --git a/uncrustify.cfg b/contrib/uncrustify.cfg
index 11da34d59a..11da34d59a 100644
--- a/uncrustify.cfg
+++ b/contrib/uncrustify.cfg
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 38d53249d1..ffba29efc7 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -759,7 +759,7 @@ OptionSet After setting an option. The pattern is
Note: It's a bad idea, to reset an option
during this autocommand, since this will
probably break plugins. You can always use
- |noa| to prevent triggering this autocommand.
+ |:noa| to prevent triggering this autocommand.
Could be used, to check for existence of the
'backupdir' and 'undodir' options and create
directories, if they don't exist yet.
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 075e581bf2..e23fc49d89 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1063,11 +1063,12 @@ There are nine types of registers: *registers* *E354*
2. 10 numbered registers "0 to "9
3. The small delete register "-
4. 26 named registers "a to "z or "A to "Z
-5. four read-only registers ":, "., "% and "#
-6. the expression register "=
-7. The selection and drop registers "*, "+ and "~
-8. The black hole register "_
-9. Last search pattern register "/
+5. three read-only registers ":, "., "%
+6. alternate buffer register "#
+7. the expression register "=
+8. The selection and drop registers "*, "+ and "~
+9. The black hole register "_
+10. Last search pattern register "/
1. Unnamed register "" *quote_quote* *quotequote*
Vim fills this register with text deleted with the "d", "c", "s", "x" commands
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index d85d41a295..ddf5b110cd 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -482,6 +482,8 @@ followed by another Vim command:
:argdo
:autocmd
:bufdo
+ :cdo
+ :cfdo
:command
:cscope
:debug
@@ -492,6 +494,8 @@ followed by another Vim command:
:help
:helpfind
:lcscope
+ :ldo
+ :lfdo
:make
:normal
:promptfind
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt
index 54d47eb28a..8c9cdc3800 100644
--- a/runtime/doc/diff.txt
+++ b/runtime/doc/diff.txt
@@ -1,4 +1,4 @@
-*diff.txt* For Vim version 7.4. Last change: 2015 Jan 19
+*diff.txt* For Vim version 7.4. Last change: 2015 Feb 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -306,6 +306,19 @@ name or a part of a buffer name. Examples:
Also see |'diffopt'| and the "diff" item of |'fillchars'|.
+ *diff-slow* *diff_translations*
+For very long lines, the diff syntax highlighting might be slow, especially
+since it tries to match all different kind of localisations. To disable
+localisations and speed up the syntax highlighting, set the global variable
+g:diff_translations to zero: >
+
+ let g:diff_translations = 0
+<
+After setting this variable, Reload the syntax script: >
+
+ set syntax=diff
+<
+
FINDING THE DIFFERENCES *diff-diffexpr*
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index ffa3f1d673..4fdc963f9c 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -795,7 +795,8 @@ USING THE ARGUMENT LIST
autocommand event is disabled by adding it to
'eventignore'. This considerably speeds up editing
each file.
- Also see |:windo|, |:tabdo| and |:bufdo|.
+ Also see |:windo|, |:tabdo|, |:bufdo|, |:cdo|, |:ldo|,
+ |:cfdo| and |:lfdo|.
Example: >
:args *.c
@@ -1144,7 +1145,7 @@ If you want to always use ":confirm", set the 'confirm' option.
|:diffsplit|, |:diffpatch|, |:pedit|, |:redir|,
|:source|, |:update|, |:visual|, |:vsplit|,
and |:qall| if 'confirm' is set.
- {only in Win32, Athena, Motif, GTK and Mac GUI}
+ {only in Win32, Motif, GTK and Mac GUI}
When ":browse" is not possible you get an error
message. If the |+browse| feature is missing or the
{command} doesn't support browsing, the {command} is
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 4ff0636b61..8864909e71 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 7.4. Last change: 2014 Nov 27
+*eval.txt* For Vim version 7.4. Last change: 2015 Jan 29
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -953,7 +953,7 @@ Decimal, Hexadecimal (starting with 0x or 0X), or Octal (starting with 0).
Floating point numbers can be written in two forms:
[-+]{N}.{M}
- [-+]{N}.{M}e[-+]{exp}
+ [-+]{N}.{M}[eE][-+]{exp}
{N} and {M} are numbers. Both {N} and {M} must be present and can only
contain digits.
@@ -3232,7 +3232,7 @@ foreground() Move the Vim window to the foreground. Useful when sent from
On Win32 systems this might not work, the OS does not always
allow a window to bring itself to the foreground. Use
|remote_foreground()| instead.
- {only in the Win32, Athena, Motif and GTK GUI versions and the
+ {only in the Win32, Motif and GTK GUI versions and the
Win32 console version}
@@ -4972,6 +4972,7 @@ printf({fmt}, {expr1} ...) *printf()*
s The text of the String argument is used. If a
precision is specified, no more bytes than the number
specified are used.
+ *printf-S*
S The text of the String argument is used. If a
precision is specified, no more display cells than the
number specified are used. Without the |+multi_byte|
@@ -5160,7 +5161,7 @@ remote_foreground({server}) *remote_foreground()*
Note: This does not restore the window if it was minimized,
like foreground() does.
This function is not available in the |sandbox|.
- {only in the Win32, Athena, Motif and GTK GUI versions and the
+ {only in the Win32, Motif and GTK GUI versions and the
Win32 console version}
@@ -6944,7 +6945,6 @@ folding Compiled with |folding| support.
footer Compiled with GUI footer support. |gui-footer|
gettext Compiled with message translation |multi-lang|
gui Compiled with GUI enabled.
-gui_athena Compiled with Athena GUI.
gui_gnome Compiled with Gnome support (gui_gtk is also defined).
gui_gtk Compiled with GTK+ GUI (any version).
gui_gtk2 Compiled with GTK+ 2 GUI (gui_gtk is also defined).
@@ -6952,7 +6952,6 @@ gui_mac Compiled with Macintosh GUI.
gui_motif Compiled with Motif GUI.
gui_running Vim is running in the GUI, or it will start soon.
gui_win32 Compiled with MS Windows Win32 GUI.
-gui_win32s idem, and Win32s system being used (Windows 3.1)
iconv Can use iconv() for conversion.
insert_expand Compiled with support for CTRL-X expansion commands in
Insert mode.
@@ -7596,7 +7595,7 @@ This does NOT work: >
:unlet v
< *E741*
If you try to change a locked variable you get an
- error message: "E741: Value of {name} is locked"
+ error message: "E741: Value is locked: {name}"
[depth] is relevant when locking a |List| or
|Dictionary|. It specifies how deep the locking goes:
diff --git a/runtime/doc/farsi.txt b/runtime/doc/farsi.txt
index d5b371ab40..5aa77d8a22 100644
--- a/runtime/doc/farsi.txt
+++ b/runtime/doc/farsi.txt
@@ -215,7 +215,7 @@ o Keyboard
Note:
ˇ stands for Farsi PSP (break without space)
- ˘ stands for Farsi PCN (for HAMZE attribute )
+ ˘ stands for Farsi PCN (for HAMZE attribute)
Restrictions
------------
diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt
index c74c31d1fa..1b0db53d6d 100644
--- a/runtime/doc/gui.txt
+++ b/runtime/doc/gui.txt
@@ -208,18 +208,6 @@ takes too much time or you don't like the cursor jumping to another line,
include the 'h' flag in 'guioptions'. Then the scrolling is limited by the
text of the current cursor line.
- *athena-intellimouse*
-If you have an Intellimouse and an X server that supports using the wheel,
-then you can use the wheel to scroll the text up and down in gvim. This works
-with XFree86 4.0 and later, and with some older versions when you add patches.
-See |scroll-mouse-wheel|.
-
-For older versions of XFree86 you must patch your X server. The following
-page has a bit of information about using the Intellimouse on Linux as well as
-links to the patches and X server binaries (may not have the one you need
-though):
- http://www.inria.fr/koala/colas/mouse-wheel-scroll/
-
==============================================================================
3. Mouse Control *gui-mouse*
diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt
index eef0aaefb6..6b022782d2 100644
--- a/runtime/doc/gui_w32.txt
+++ b/runtime/doc/gui_w32.txt
@@ -47,10 +47,6 @@ If you want Vim to start with a maximized window, add this command to your
vimrc or gvimrc file: >
au GUIEnter * simalt ~x
<
- *gui-w32s*
-There is a specific version of gvim.exe that runs under the Win32s subsystem
-of Windows 3.1 or 3.11. See |win32s|.
-
==============================================================================
2. Vim as default editor *vim-default-editor*
@@ -281,10 +277,6 @@ syntax on W95 & NT: >
:!start [/min] {command}
The optional "/min" causes the window to be minimized.
-On Win32s, you will have to go to another window instead. Don't forget that
-you must tell Windows 3.1x to keep executing a DOS command in the background
-while you switch back to Vim.
-
==============================================================================
5. Special colors *win32-colors*
@@ -293,7 +285,7 @@ On Win32, the normal DOS colors can be used. See |dos-colors|.
Additionally the system configured colors can also be used. These are known
by the names Sys_XXX, where XXX is the appropriate system color name, from the
following list (see the Win32 documentation for full descriptions). Case is
-ignored. Note: On Win32s not all of these colors are supported.
+ignored.
Sys_3DDKShadow Sys_3DFace Sys_BTNFace
Sys_3DHilight Sys_3DHighlight Sys_BTNHilight
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 75c986efcd..c98f43f324 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1128,6 +1128,8 @@ tag command action ~
|:cc| :cc go to specific error
|:cclose| :ccl[ose] close quickfix window
|:cd| :cd change directory
+|:cdo| :cdo execute command in each valid error list entry
+|:cfdo| :cfdo execute command in each file in error list
|:center| :ce[nter] format lines at the center
|:cexpr| :cex[pr] read errors from expr and jump to first
|:cfile| :cf[ile] read file with error messages and jump to first
@@ -1285,6 +1287,8 @@ tag command action ~
|:lchdir| :lch[dir] change directory locally
|:lclose| :lcl[ose] close location window
|:lcscope| :lcs[cope] like ":cscope" but uses location list
+|:ldo| :ld[o] execute command in valid location list entries
+|:lfdo| :lfd[o] execute command in each file in location list
|:left| :le[ft] left align lines
|:leftabove| :lefta[bove] make split window appear left or above
|:let| :let assign a value to a variable or option
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index 0825ca8848..431b6e1ad7 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -1,4 +1,4 @@
-*intro.txt* For Vim version 7.4. Last change: 2014 May 24
+*intro.txt* For Vim version 7.4. Last change: 2015 Jan 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -131,7 +131,7 @@ http://www.vim.org/maillist.php
Bug reports: *bugs* *bug-reports* *bugreport.vim*
-Send bug reports to: Vim Developers <vim_dev@vim.org>
+Send bug reports to: Vim Developers <vim-dev@vim.org>
This is a maillist, you need to become a member first and many people will see
the message. If you don't want that, e.g. because it is a security issue,
send it to <bugs@vim.org>, this only goes to the Vim maintainer (that's Bram).
diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt
index 2e3a0141ac..a084cd72d2 100644
--- a/runtime/doc/mbyte.txt
+++ b/runtime/doc/mbyte.txt
@@ -43,16 +43,6 @@ features. Unfortunately, every system has its own way to deal with multibyte
languages and it is quite complicated.
-COMPILING
-
-If you already have a compiled Vim program, check if the |+multi_byte| feature
-is included. The |:version| command can be used for this.
-
-If +multi_byte is not included, you should compile Vim with "normal", "big" or
-"huge" features. You can further tune what features are included. See the
-INSTALL files in the source directory.
-
-
LOCALE
First of all, you must make sure your current locale is set correctly. If
@@ -629,52 +619,6 @@ If you use a wrong "font" argument you will get an error message.
Also make sure that you set 'guifontset' before setting fonts for highlight
groups.
-
-USING RESOURCE FILES
-
-Instead of specifying 'guifontset', you can set X11 resources and Vim will
-pick them up. This is only for people who know how X resource files work.
-
-For Motif and Athena insert these three lines in your $HOME/.Xdefaults file:
-
- Vim.font: |base_font_name_list|
- Vim*fontSet: |base_font_name_list|
- Vim*fontList: your_language_font
-
-Note: Vim.font is for text area.
- Vim*fontSet is for menu.
- Vim*fontList is for menu (for Motif GUI)
-
-For example, when you are using Japanese and a 14 dots font, >
-
- Vim.font: -misc-fixed-medium-r-normal--14-*
- Vim*fontSet: -misc-fixed-medium-r-normal--14-*
- Vim*fontList: -misc-fixed-medium-r-normal--14-*
-<
-or: >
-
- Vim*font: k14,r14
- Vim*fontSet: k14,r14
- Vim*fontList: k14,r14
-<
-To have them take effect immediately you will have to do >
-
- xrdb -merge ~/.Xdefaults
-
-Otherwise you will have to stop and restart the X server before the changes
-take effect.
-
-
-The GTK+ version of GUI Vim does not use .Xdefaults, use ~/.gtkrc instead.
-The default mostly works OK. But for the menus you might have to change
-it. Example: >
-
- style "default"
- {
- fontset="-*-*-medium-r-normal--14-*-*-*-c-*-*-*"
- }
- widget_class "*" style "default"
-
==============================================================================
6. Fonts on MS-Windows *mbyte-fonts-MSwin*
@@ -1201,7 +1145,7 @@ internally.
Vim has comprehensive UTF-8 support. It works well in:
- xterm with utf-8 support enabled
-- Athena, Motif and GTK GUI
+- Motif and GTK GUI
- MS-Windows GUI
- several other platforms
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index e171c617db..610a1964f9 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -635,9 +635,9 @@ A jump table for the options with a short description can be found at |Q_op|.
(or Vim is run inside an xterm invoked with "-cjkwidth" option.),
this option should be set to "double" to match the width perceived
by Vim with the width of glyphs in the font. Perhaps it also has
- to be set to "double" under CJK Windows 9x/ME or Windows 2k/XP
- when the system locale is set to one of CJK locales. See Unicode
- Standard Annex #11 (http://www.unicode.org/reports/tr11).
+ to be set to "double" under CJK Windows XP when the system locale is
+ set to one of CJK locales.
+ See Unicode Standard Annex #11 (http://www.unicode.org/reports/tr11).
Vim may set this option automatically at startup time when Vim is
compiled with the |+termresponse| feature and if |t_u7| is set to the
@@ -1110,8 +1110,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'browsedir'* *'bsdir'*
'browsedir' 'bsdir' string (default: "last")
global
- {only for Motif, Athena, GTK, Mac and
- Win32 GUI}
+ {only for Motif, GTK, Mac and Win32 GUI}
Which directory to use for the file browser:
last Use same directory as with last file browser, where a
file was opened or saved.
@@ -1194,6 +1193,8 @@ A jump table for the options with a short description can be found at |Q_op|.
nofile only: The buffer name is fixed, it is not handled like a
file name. It is not modified in response to a |:cd|
command.
+ nofile only: When using ":e bufname" and already editing "bufname"
+ nothing changes, since there is no file to edit.
*E676*
"acwrite" implies that the buffer name is not related to a file, like
"nofile", but it will be written. Thus, in contrast to "nofile" and
@@ -3100,7 +3101,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'guioptions'* *'go'*
'guioptions' 'go' string (default "egmrLT" (MS-Windows),
- "aegimrLT" (GTK, Motif and Athena))
+ "aegimrLT" (GTK and Motif))
global
{only available when compiled with GUI enabled}
This option only has an effect in the GUI version of Vim. It is a
@@ -3161,10 +3162,9 @@ A jump table for the options with a short description can be found at |Q_op|.
*'go-g'*
'g' Grey menu items: Make menu items that are not active grey. If
'g' is not included inactive menu items are not shown at all.
- Exception: Athena will always use grey menu items.
*'go-T'*
- 'T' Include Toolbar. Currently only in Win32, GTK+, Motif,
- and Athena GUIs.
+ 'T' Include Toolbar. Currently only in Win32, GTK+, and
+ Motif GUIs.
*'go-r'*
'r' Right-hand scrollbar is always present.
*'go-R'*
@@ -3539,8 +3539,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|i_CTRL-^|.
The value is set to 1 when setting 'keymap' to a valid keymap name.
It is also used for the argument of commands like "r" and "f".
- The value 0 may not work correctly with Athena and Motif with some XIM
- methods. Use 'imdisable' to disable XIM then.
*'imsearch'* *'ims'*
'imsearch' 'ims' number (default 0, 2 when an input method is supported)
@@ -3556,8 +3554,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|c_CTRL-^|.
The value is set to 1 when it is not -1 and setting the 'keymap'
option to a valid keymap name.
- The value 0 may not work correctly with Athena and Motif with some XIM
- methods. Use 'imdisable' to disable XIM then.
*'imstatusfunc'* *'imsf'*
'imstatusfunc' 'imsf' string (default "")
diff --git a/runtime/doc/os_dos.txt b/runtime/doc/os_dos.txt
index 1c80f4d7a5..1601d65ffd 100644
--- a/runtime/doc/os_dos.txt
+++ b/runtime/doc/os_dos.txt
@@ -52,12 +52,9 @@ Will find "c:\user\piet\_vimrc" and the runtime files in "e:\vim\vim54".
See |$VIM| and |$VIMRUNTIME| for more information.
-Under Windows 95, you can set $VIM in your C:\autoexec.bat file. For
-example: >
- set VIM=D:\vim
-Under Windows NT, you can set environment variables for each user separately
-under "Start/Settings/Control Panel->System", or through the properties in the
-menu of "My Computer", under the Environment Tab.
+You can set environment variables for each user separately under
+"Start/Settings/Control Panel->System", or through the properties in the menu
+of "My Computer", under the Environment Tab.
==============================================================================
2. Using backslashes *dos-backslash*
@@ -246,16 +243,6 @@ the CTRL-C until it tries to read a key.
==============================================================================
8. Temp files *dos-temp-files*
-Only for the 16 bit and 32 bit DOS version:
-Vim puts temporary files (for filtering) in the first of these directories
-that exists and in which Vim can create a file:
- $TMP
- $TEMP
- C:\TMP
- C:\TEMP
- current directory
-
-For the Win32 version (both console and GUI):
Vim uses standard Windows functions to obtain a temporary file name (for
filtering). The first of these directories that exists and in which Vim can
create a file is used:
@@ -266,10 +253,10 @@ create a file is used:
==============================================================================
9. Shell option default *dos-shell*
-The default for the 'sh' ('shell') option is "command.com" on Windows 95 and
-"cmd.exe" on Windows NT. If SHELL is defined, Vim uses SHELL instead, and if
-SHELL is not defined but COMSPEC is, Vim uses COMSPEC. Vim starts external
-commands with "<shell> /c <command_name>". Typing CTRL-Z starts a new command
+The default for the 'sh' ('shell') option is "cmd.exe" on Windows.
+If SHELL is defined, Vim uses SHELL instead, and if SHELL is not defined
+but COMSPEC is, Vim uses COMSPEC. Vim starts external commands with
+"<shell> /c <command_name>". Typing CTRL-Z starts a new command
subshell. Return to Vim with "exit". |'shell'| |CTRL-Z|
If you are running a third-party shell, you may need to set the
diff --git a/runtime/doc/os_win32.txt b/runtime/doc/os_win32.txt
index 603dbcddce..57a6ad9f3a 100644
--- a/runtime/doc/os_win32.txt
+++ b/runtime/doc/os_win32.txt
@@ -7,7 +7,7 @@
*win32* *Win32* *MS-Windows*
This file documents the idiosyncrasies of the Win32 version of Vim.
-The Win32 version of Vim works on Windows NT, XP, Vista and Windows 7.
+The Win32 version of Vim works on Windows XP, Vista and Windows 7.
There are both console and GUI versions.
The 32 bit version also runs on 64 bit MS-Windows systems.
@@ -16,8 +16,7 @@ The 32 bit version also runs on 64 bit MS-Windows systems.
2. Startup |win32-startup|
3. Restore screen contents |win32-restore|
4. Using the mouse |win32-mouse|
-5. Running under Windows 3.1 |win32-win3.1|
-6. Win32 mini FAQ |win32-faq|
+5. Win32 mini FAQ |win32-faq|
Additionally, there are a number of common Win32 and DOS items:
File locations |dos-locations|
@@ -34,7 +33,6 @@ Win32 GUI |gui-w32|
Credits:
The Win32 version was written by George V. Reilly <george@reilly.org>.
-The original Windows NT port was done by Roger Knobbe <RogerK@wonderware.com>.
The GUI version was made by George V. Reilly and Robert Webb.
==============================================================================
@@ -98,35 +96,7 @@ When the mouse doesn't work, try disabling the "Quick Edit Mode" feature of
the console.
==============================================================================
-5. Running under Windows 3.1 *win32-win3.1*
-
- *win32s* *windows-3.1*
-There is a special version of Gvim that runs under Windows 3.1 and 3.11. You
-need the gvim.exe that was compiled with Visual C++ 4.1.
-
-To run the Win32 version under Windows 3.1, you need to install Win32s. You
-might have it already from another Win32 application which you have installed.
-If Vim doesn't seem to be running properly, get the latest version: 1.30c.
-You can find it at:
-
- http://support.microsoft.com/download/support/mslfiles/pw1118.exe
-
-(Microsoft moved it again, we don't know where it is now :-( ).
-
-The reason for having two versions of gvim.exe is that the Win32s version was
-compiled with VC++ 4.1. This is the last version of VC++ that supports Win32s
-programs. VC++ 5.0 is better, so that one was used for the Win32 version.
-Apart from that, there is no difference between the programs. If you are in a
-mixed environment, you can use the gvim.exe for Win32s on both.
-
-The Win32s version works the same way as the Win32 version under 95/NT. When
-running under Win32s the following differences apply:
-- You cannot use long file names, because Windows 3.1 doesn't support them!
-- When executing an external command, it doesn't return an exit code. After
- doing ":make" you have to do ":cn" yourself.
-
-==============================================================================
-6. Win32 mini FAQ *win32-faq*
+5. Win32 mini FAQ *win32-faq*
Q. How do I change the font?
A. In the GUI version, you can use the 'guifont' option. Example: >
@@ -134,14 +104,6 @@ A. In the GUI version, you can use the 'guifont' option. Example: >
< In the console version, you need to set the font of the console itself.
You cannot do this from within Vim.
-Q. How do I type dead keys on Windows NT?
-A. Dead keys work on NT 3.51. Just type them as you would in any other
- application.
- On NT 4.0, you need to make sure that the default locale (set in the
- Keyboard part of the Control Panel) is the same as the currently active
- locale. Otherwise the NT code will get confused and crash! This is a NT
- 4.0 problem, not really a Vim problem.
-
Q. I'm using Vim to edit a symbolically linked file on a Unix NFS file server.
When I write the file, Vim does not "write through" the symlink. Instead,
it deletes the symbolic link and creates a new file in its place. Why?
@@ -176,28 +138,6 @@ A. Basically what you need is to put a tee program that will copy its input
:set shellpipe=\|\ tee
< to your _vimrc.
-Q. I'm storing files on a remote machine that works with VisionFS, and files
- disappear!
-A. VisionFS can't handle certain dot (.) three letter extension file names.
- SCO declares this behavior required for backwards compatibility with 16bit
- DOS/Windows environments. The two commands below demonstrate the behavior:
->
- echo Hello > file.bat~
- dir > file.bat
-<
- The result is that the "dir" command updates the "file.bat~" file, instead
- of creating a new "file.bat" file. This same behavior is exhibited in Vim
- when editing an existing file named "foo.bat" because the default behavior
- of Vim is to create a temporary file with a '~' character appended to the
- name. When the file is written, it winds up being deleted.
-
- Solution: Add this command to your _vimrc file: >
- :set backupext=.temporary
-
-Q. How do I change the blink rate of the cursor?
-A. You can't! This is a limitation of the NT console. NT 5.0 is reported to
- be able to set the blink rate for all console windows at the same time.
-
*:!start*
Q. How can I run an external command or program asynchronously?
A. When using :! to run an external command, you can run it with "start": >
@@ -240,28 +180,6 @@ A. You have two possible solutions depending on what you want:
< The first command runs notepad minimized and the second one runs it
normally.
-Q. I'm using Win32s, and when I try to run an external command like "make",
- Vim doesn't wait for it to finish! Help!
-A. The problem is that a 32-bit application (Vim) can't get notification from
- Windows that a 16-bit application (your DOS session) has finished. Vim
- includes a work-around for this, but you must set up your DOS commands to
- run in a window, not full-screen. Unfortunately the default when you
- install Windows is full-screen. To change this:
- 1) Start PIF editor (in the Main program group).
- 2) Open the file "_DEFAULT.PIF" in your Windows directory.
- 3) Changes the display option from "Full Screen" to "Windowed".
- 4) Save and exit.
-
- To test, start Vim and type >
- :!dir C:\<CR>".
-< You should see a DOS box window appear briefly with the directory listing.
-
-Q. I use Vim under Win32s and NT. In NT, I can define the console to default to
- 50 lines, so that I get a 80x50 shell when I ':sh'. Can I do the same in
- W3.1x, or am I stuck with 80x25?
-A. Edit SYSTEM.INI and add 'ScreenLines=50' to the [NonWindowsApp] section. DOS
- prompts and external DOS commands will now run in a 50-line window.
-
*windows-icon*
Q. I don't like the Vim icon, can I change it?
A. Yes, place your favorite icon in bitmaps/vim.ico in a directory of
diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt
index 086d05613d..7565d1e976 100644
--- a/runtime/doc/print.txt
+++ b/runtime/doc/print.txt
@@ -677,7 +677,7 @@ It is possible to achieve a poor man's version of duplex printing using the PS
utility psselect. This utility has options -e and -o for printing just the
even or odd pages of a PS file respectively.
-First generate a PS file with the 'hardcopy' command, then generate a new
+First generate a PS file with the 'hardcopy' command, then generate new
files with all the odd and even numbered pages with: >
psselect -o test.ps odd.ps
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index 8c428e44ef..399933b512 100644
--- a/runtime/doc/quickfix.txt
+++ b/runtime/doc/quickfix.txt
@@ -291,6 +291,100 @@ use this code: >
au QuickfixCmdPost make call QfMakeConv()
+EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
+ *:cdo*
+:cdo[!] {cmd} Execute {cmd} in each valid entry in the quickfix list.
+ It works like doing this: >
+ :cfirst
+ :{cmd}
+ :cnext
+ :{cmd}
+ etc.
+< When the current file can't be |abandon|ed and the [!]
+ is not present, the command fails.
+ When an error is detected on one buffer, further
+ buffers will not be visited.
+ The last buffer (or where an error occurred) becomes
+ the current buffer.
+ {cmd} can contain '|' to concatenate several commands.
+ Only valid entries in the quickfix list are used.
+ Note: While this command is executing, the Syntax
+ autocommand event is disabled by adding it to
+ 'eventignore'. This considerably speeds up editing
+ each buffer.
+ Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
+ |:ldo|, |:cfdo| and |:lfdo|.
+
+ *:cfdo*
+:cfdo[!] {cmd} Execute {cmd} in each file in the quickfix list.
+ It works like doing this: >
+ :cfirst
+ :{cmd}
+ :cnfile
+ :{cmd}
+ etc.
+< When the current file can't be |abandon|ed and the [!]
+ is not present, the command fails.
+ When an error is detected on one buffer, further
+ buffers will not be visited.
+ The last buffer (or where an error occurred) becomes
+ the current buffer.
+ {cmd} can contain '|' to concatenate several commands.
+ Only valid entries in the quickfix list are used.
+ Note: While this command is executing, the Syntax
+ autocommand event is disabled by adding it to
+ 'eventignore'. This considerably speeds up editing
+ each buffer.
+ Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
+ |:cdo|, |:ldo| and |:lfdo|.
+
+ *:ldo*
+:ld[o][!] {cmd} Execute {cmd} in each valid entry in the location list
+ for the current window.
+ It works like doing this: >
+ :lfirst
+ :{cmd}
+ :lnext
+ :{cmd}
+ etc.
+< When the current file can't be |abandon|ed and the [!]
+ is not present, the command fails.
+ When an error is detected on one buffer, further
+ buffers will not be visited.
+ The last buffer (or where an error occurred) becomes
+ the current buffer.
+ {cmd} can contain '|' to concatenate several commands.
+ Only valid entries in the location list are used.
+ Note: While this command is executing, the Syntax
+ autocommand event is disabled by adding it to
+ 'eventignore'. This considerably speeds up editing
+ each buffer.
+ Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
+ |:cdo|, |:cfdo| and |:lfdo|.
+
+ *:lfdo*
+:lfdo[!] {cmd} Execute {cmd} in each file in the location list for
+ the current window.
+ It works like doing this: >
+ :lfirst
+ :{cmd}
+ :lnfile
+ :{cmd}
+ etc.
+< When the current file can't be |abandon|ed and the [!]
+ is not present, the command fails.
+ When an error is detected on one buffer, further
+ buffers will not be visited.
+ The last buffer (or where an error occurred) becomes
+ the current buffer.
+ {cmd} can contain '|' to concatenate several commands.
+ Only valid entries in the location list are used.
+ Note: While this command is executing, the Syntax
+ autocommand event is disabled by adding it to
+ 'eventignore'. This considerably speeds up editing
+ each buffer.
+ Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
+ |:cdo|, |:ldo| and |:cfdo|.
=============================================================================
2. The error window *quickfix-window*
diff --git a/runtime/doc/quotes.txt b/runtime/doc/quotes.txt
index 28b0e1c623..c35fb2f139 100644
--- a/runtime/doc/quotes.txt
+++ b/runtime/doc/quotes.txt
@@ -178,14 +178,14 @@ Hurrah for VIM!! It is "at your fingertips" like vi, and has the extensions
that vi sorely needs: highlighting for executing commands on blocks, an easily
navigable and digestible help screen, and more. (Paul Pax)
-The reason WHY I don't have this amazingly useful macro any more, is that I
+The reason WHY I don't have this amazingly useful macro anymore, is that I
now use VIM - and this is built in!! (Stephen Riehm, Germany)
I am a user of VIM and I love it. I use it to do all my programming, C,
C++, HTML what ever. (Tim Allwine)
I discovered VIM after years of struggling with the original vi, and I just
-can't live without it any more. (Emmanuel Mogenet, USA)
+can't live without it anymore. (Emmanuel Mogenet, USA)
Emacs has not a bit of chance to survive so long as VIM is around. Besides,
it also has the most detailed software documentation I have ever seen---much
diff --git a/runtime/doc/rileft.txt b/runtime/doc/rileft.txt
index b4d9347470..e4e495bb18 100644
--- a/runtime/doc/rileft.txt
+++ b/runtime/doc/rileft.txt
@@ -106,9 +106,6 @@ o Does not support reverse insert and rightleft modes on the command-line.
o Somewhat slower in right-to-left mode, because right-to-left motion is
emulated inside Vim, not by the controlling terminal.
-o When the Athena GUI is used, the bottom scrollbar works in the wrong
- direction. This is difficult to fix.
-
o When both 'rightleft' and 'revins' are on: 'textwidth' does not work.
Lines do not wrap at all; you just get a single, long line.
diff --git a/runtime/doc/scroll.txt b/runtime/doc/scroll.txt
index 8626a1a7f6..0b3d45e969 100644
--- a/runtime/doc/scroll.txt
+++ b/runtime/doc/scroll.txt
@@ -245,7 +245,7 @@ dragging the scrollbar of the current window. How many lines are scrolled
depends on your mouse driver. If the scroll action causes input focus
problems, see |intellimouse-wheel-problems|.
-For the X11 GUIs (Motif, Athena and GTK) scrolling the wheel generates key
+For the X11 GUIs (Motif and GTK) scrolling the wheel generates key
presses <ScrollWheelUp>, <ScrollWheelDown>, <ScrollWheelLeft> and
<ScrollWheelRight>. For example, if you push the scroll wheel upwards a
<ScrollWheelUp> key press is generated causing the window to scroll upwards
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 67550365a3..9d510f4be1 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt* For Vim version 7.4. Last change: 2015 Jan 07
+*syntax.txt* For Vim version 7.4. Last change: 2015 Feb 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1130,6 +1130,8 @@ there are very long lines in the file. To disable translations: >
:let diff_translations = 0
+Also see |diff-slow|.
+
DIRCOLORS *dircolors.vim* *ft-dircolors-syntax*
@@ -4676,7 +4678,7 @@ font={font-name} *highlight-font*
When setting the font for the "Normal" group, this becomes the default
font (until the 'guifont' option is changed; the last one set is
used).
- The following only works with Motif and Athena, not with other GUIs:
+ The following only works with Motif not with other GUIs:
When setting the font for the "Menu" group, the menus will be changed.
When setting the font for the "Tooltip" group, the tooltips will be
changed.
@@ -4864,11 +4866,6 @@ Menu Current font, background and foreground colors of the menus.
Also used for the toolbar.
Applicable highlight arguments: font, guibg, guifg.
- NOTE: For Motif and Athena the font argument actually
- specifies a fontset at all times, no matter if 'guifontset' is
- empty, and as such it is tied to the current |:language| when
- set.
-
*hl-Scrollbar*
Scrollbar Current background and foreground of the main window's
scrollbars.
@@ -4878,11 +4875,6 @@ Scrollbar Current background and foreground of the main window's
Tooltip Current font, background and foreground of the tooltips.
Applicable highlight arguments: font, guibg, guifg.
- NOTE: For Motif and Athena the font argument actually
- specifies a fontset at all times, no matter if 'guifontset' is
- empty, and as such it is tied to the current |:language| when
- set.
-
==============================================================================
13. Linking groups *:hi-link* *:highlight-link* *E412* *E413*
diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt
index 44e770dc12..84eceee34f 100644
--- a/runtime/doc/tabpage.txt
+++ b/runtime/doc/tabpage.txt
@@ -234,7 +234,8 @@ LOOPING OVER TAB PAGES:
current tab page.
{cmd} can contain '|' to concatenate several commands.
{cmd} must not open or close tab pages or reorder them.
- Also see |:windo|, |:argdo| and |:bufdo|.
+ Also see |:windo|, |:argdo|, |:bufdo|, |:cdo|, |:ldo|, |:cfdo|
+ and |:lfdo|.
==============================================================================
3. Other items *tab-page-other*
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt
index 618d4e5df9..9610555dce 100644
--- a/runtime/doc/term.txt
+++ b/runtime/doc/term.txt
@@ -357,7 +357,7 @@ adjust the various t_ codes. This avoids the problem that the xterm can
produce different codes, depending on the mode it is in (8-bit, VT102,
VT220, etc.). The result is that codes like <xF1> are no longer needed.
Note: This is only done on startup. If the xterm options are changed after
-Vim has started, the escape sequences may not be recognized any more.
+Vim has started, the escape sequences may not be recognized anymore.
*xterm-resize*
Window resizing with xterm only works if the allowWindowOps resource is
diff --git a/runtime/doc/uganda.txt b/runtime/doc/uganda.txt
index ee1c36d676..c228c65542 100644
--- a/runtime/doc/uganda.txt
+++ b/runtime/doc/uganda.txt
@@ -190,7 +190,7 @@ child, you should have the intention to do this for at least one year.
How do you know that the money will be spent right? First of all you have my
personal guarantee as the author of Vim. I trust the people that are working
-at the centre, I know them personally. Further more, the centre has been
+at the centre, I know them personally. Furthermore, the centre has been
co-sponsored and inspected by World Vision, Save the Children Fund and is now
under the supervision of Pacific Academy Outreach Society. The centre is
visited about once a year to check the progress (at our own cost). I have
diff --git a/runtime/doc/usr_03.txt b/runtime/doc/usr_03.txt
index a8139d60ca..5b6eaa295b 100644
--- a/runtime/doc/usr_03.txt
+++ b/runtime/doc/usr_03.txt
@@ -528,7 +528,7 @@ MATCHING ANY SINGLE CHARACTER
The . (dot) character matches any existing character. For example, the
pattern "c.m" matches a string whose first character is a c, whose second
-character is anything, and whose the third character is m. Example:
+character is anything, and whose third character is m. Example:
We use a computer that became the cummin winter. ~
xxx xxx xxx
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index 117e977e0d..d810e1ab37 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -333,8 +333,6 @@ N *+find_in_path* include file searches: |[I|, |:isearch|,
N *+folding* |folding|
*+footer* |gui-footer|
N *+gettext* message translations |multi-lang|
- *+GUI_Athena* Unix only: Athena |GUI|
- *+GUI_neXtaw* Unix only: neXtaw |GUI|
*+GUI_GTK* Unix only: GTK+ |GUI|
*+GUI_Motif* Unix only: Motif |GUI|
*+iconv* Compiled with the |iconv()| function
diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt
index 7b61dbe6d7..9d3a2f5118 100644
--- a/runtime/doc/vi_diff.txt
+++ b/runtime/doc/vi_diff.txt
@@ -57,15 +57,9 @@ argument when starting Vim.
Support for different systems.
Vim can be used on:
- - All Unix systems (it works on all systems it was tested on, although
- the GUI and Perl interface may not work everywhere).
- - MS-DOS in real-mode (no additional drivers required).
- - In protected mode on Windows 3.1 and MS-DOS (DPMI driver required).
- - Windows 95 and Windows NT, with support for long file names.
- - Macintosh
- Note that on some systems features need to be disabled to reduce
- resource usage, esp. on MS-DOS. For some outdated systems you need to
- use an older Vim version.
+ - Modern Unix systems (*BSD, Linux, etc.)
+ - Windows (XP SP 2 or greater)
+ - OS X
Multi level undo. |undo|
'u' goes backward in time, 'CTRL-R' goes forward again. Set option
@@ -83,7 +77,7 @@ Graphical User Interface (GUI). |gui|
Included support for GUI: menu's, mouse, scrollbars, etc. You can
define your own menus. Better support for CTRL/SHIFT/ALT keys in
combination with special keys and mouse. Supported for various
- platforms, such as X11 (with Motif and Athena interfaces), GTK, Win32
+ platforms, such as X11 (with a Motif interface), GTK, Win32
(Windows 95 and later), and Macintosh.
Multiple windows and buffers. |windows.txt|
@@ -347,9 +341,8 @@ Printing. |printing|
Mouse support. |mouse-using|
The mouse is supported in the GUI version, in an xterm for Unix, for
- BSDs with sysmouse, for Linux with gpm, for MS-DOS, and Win32. It
- can be used to position the cursor, select the visual area, paste a
- register, etc.
+ BSDs with sysmouse, for Linux with gpm, and for Win32. It can be used
+ to position the cursor, select the visual area, paste a register, etc.
Usage of key names. |<>| |key-notation|
Special keys now all have a name like <Up>, <End>, etc.
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index c009bec66e..56f57c21c5 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -1,4 +1,4 @@
-*windows.txt* For Vim version 7.4. Last change: 2014 Dec 05
+*windows.txt* For Vim version 7.4. Last change: 2015 Jan 31
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -702,7 +702,8 @@ can also get to them with the buffer list commands, like ":bnext".
the current window.
{cmd} can contain '|' to concatenate several commands.
{cmd} must not open or close windows or reorder them.
- Also see |:tabdo|, |:argdo| and |:bufdo|.
+ Also see |:tabdo|, |:argdo|, |:bufdo|, |:cdo|, |:ldo|,
+ |:cfdo| and |:lfdo|.
*:bufdo*
:[range]bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list or if
@@ -728,7 +729,8 @@ can also get to them with the buffer list commands, like ":bnext".
autocommand event is disabled by adding it to
'eventignore'. This considerably speeds up editing
each buffer.
- Also see |:tabdo|, |:argdo| and |:windo|.
+ Also see |:tabdo|, |:argdo|, |:windo|, |:cdo|, |:ldo|,
+ |:cfdo| and |:lfdo|.
Examples: >
@@ -984,8 +986,8 @@ list of buffers. |unlisted-buffer|
(the term "unlisted" is a bit confusing then...).
Each buffer has a unique number. That number will not change,
- so you can always go to a specific buffer with ":buffer N" or
- "N CTRL-^", where N is the buffer number.
+ thus you can always go to a specific buffer with ":buffer N"
+ or "N CTRL-^", where N is the buffer number.
Indicators (chars in the same column are mutually exclusive):
u an unlisted buffer (only displayed when [!] is used)
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index b06e702637..c9686b8502 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2015 Jan 07
+" Last Change: 2015 Jan 14
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -2032,6 +2032,10 @@ func! s:FTRules()
setf conf " Better than hog
return
endif
+ if path =~ '^/\(etc\|usr/share\)/polkit-1/rules\.d'
+ setf javascript
+ return
+ endif
try
let config_lines = readfile('/etc/udev/udev.conf')
catch /^Vim\%((\a\+)\)\=:E484/
diff --git a/runtime/ftplugin/j.vim b/runtime/ftplugin/j.vim
index bcd606ffa0..71ac4c5418 100644
--- a/runtime/ftplugin/j.vim
+++ b/runtime/ftplugin/j.vim
@@ -2,7 +2,7 @@
" Language: J
" Maintainer: David BĂĽrgin <676c7473@gmail.com>
" URL: https://github.com/glts/vim-j
-" Last Change: 2014-04-05
+" Last Change: 2015-01-11
if exists('b:did_ftplugin')
finish
@@ -16,39 +16,41 @@ setlocal iskeyword=48-57,A-Z,_,a-z
setlocal comments=:NB.
setlocal commentstring=NB.\ %s
setlocal formatoptions-=t
-setlocal shiftwidth=2 softtabstop=2 expandtab
+setlocal shiftwidth=2
+setlocal softtabstop=2
+setlocal expandtab
setlocal matchpairs=(:)
let b:undo_ftplugin = 'setlocal matchpairs< expandtab< softtabstop< shiftwidth< formatoptions< commentstring< comments< iskeyword<'
" Section movement with ]] ][ [[ []. The start/end patterns below are amended
" inside the function in order to avoid matching on the current cursor line.
-let s:sectionstart = '.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\>.*'
+let s:sectionstart = '\%(\s*Note\|.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\)\>.*'
let s:sectionend = '\s*)\s*'
function! s:SearchSection(end, backwards, visualmode) abort
if a:visualmode !=# ''
normal! gv
endif
- let flags = a:backwards ? 'bsW' : 'sW'
+ let l:flags = a:backwards ? 'bsW' : 'sW'
if a:end
- call search('^' . s:sectionend . (a:backwards ? '\n\_.\{-}\%#' : '$'), flags)
+ call search('^' . s:sectionend . (a:backwards ? '\n\_.\{-}\%#' : '$'), l:flags)
else
- call search('^' . s:sectionstart . (a:backwards ? '\n\_.\{-}\%#' : '$'), flags)
+ call search('^' . s:sectionstart . (a:backwards ? '\n\_.\{-}\%#' : '$'), l:flags)
endif
endfunction
-noremap <script> <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, '')<CR>
-xnoremap <script> <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, visualmode())<CR>
+noremap <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, '')<CR>
+xnoremap <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, visualmode())<CR>
sunmap <buffer> ]]
-noremap <script> <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, '')<CR>
-xnoremap <script> <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, visualmode())<CR>
+noremap <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, '')<CR>
+xnoremap <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, visualmode())<CR>
sunmap <buffer> ][
-noremap <script> <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, '')<CR>
-xnoremap <script> <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, visualmode())<CR>
+noremap <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, '')<CR>
+xnoremap <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, visualmode())<CR>
sunmap <buffer> [[
-noremap <script> <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, '')<CR>
-xnoremap <script> <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, visualmode())<CR>
+noremap <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, '')<CR>
+xnoremap <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, visualmode())<CR>
sunmap <buffer> []
let b:undo_ftplugin .= ' | silent! execute "unmap <buffer> ]]"'
@@ -66,7 +68,7 @@ endif
" Enhanced "%" matching (see ":help matchit")
if exists('loaded_matchit') && !exists('b:match_words')
let b:match_ignorecase = 0
- let b:match_words = '^.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(\:\s*0\|def\s\+0\|define\)\>:^\s*\:\s*$:^\s*)\s*$'
+ let b:match_words = '^\%(\s*Note\|.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(\:\s*0\|def\s\+0\|define\)\)\>:^\s*\:\s*$:^\s*)\s*$'
\ . ',\<\%(for\%(_\a\k*\)\=\|if\|select\|try\|whil\%(e\|st\)\)\.:\<\%(case\|catch[dt]\=\|else\%(if\)\=\|fcase\)\.:\<end\.'
let b:undo_ftplugin .= ' | unlet! b:match_ignorecase b:match_words'
endif
diff --git a/runtime/indent/fortran.vim b/runtime/indent/fortran.vim
index e76c64b671..2c83f26b58 100644
--- a/runtime/indent/fortran.vim
+++ b/runtime/indent/fortran.vim
@@ -1,9 +1,11 @@
" Vim indent file
-" Language: Fortran95 (and Fortran90, Fortran77, F and elf90)
-" Version: 0.40
-" Last Change: 2011 Dec. 28
-" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www.unb.ca/chem/ajit/>
+" Language: Fortran 2008 (and earlier versions: 2003, 95, 90, and 77)
+" Version: 0.41
+" Last Change: 2015 Jan. 15
+" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
" Usage: Do :help fortran-indent from Vim
+" Credits:
+" Useful suggestions were made by: Albert Oliver Serra.
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -36,8 +38,8 @@ if !exists("b:fortran_fixed_source")
else
" f90 and f95 allow both fixed and free source form
" assume fixed source form unless signs of free source form
- " are detected in the first five columns of the first 250 lines
- " Detection becomes more accurate and time-consuming if more lines
+ " are detected in the first five columns of the first s:lmax lines.
+ " Detection becomes more accurate and more time-consuming if more lines
" are checked. Increase the limit below if you keep lots of comments at
" the very top of each file and you have a fast computer
let s:lmax = 500
@@ -129,7 +131,7 @@ function FortranGetIndent(lnum)
if getline(v:lnum) =~? '^\s*\(\d\+\s\)\=\s*'
\. '\(else\|else\s*if\|else\s*where\|case\|'
\. 'end\s*\(if\|where\|select\|interface\|'
- \. 'type\|forall\|associate\|enum\)\)\>'
+ \. 'type\|forall\|associate\|enum\|block\)\)\>'
let ind = ind - &sw
" Fix indent for case statement immediately after select
if prevstat =~? '\<select\s\+\(case\|type\)\>'
@@ -141,8 +143,11 @@ function FortranGetIndent(lnum)
if prevstat =~ '&\s*$' && prev2stat !~ '&\s*$'
let ind = ind + &sw
endif
+ if prevstat =~ '&\s*$' && prevstat =~ '\<else\s*if\>'
+ let ind = ind - &sw
+ endif
"Line after last continuation line
- if prevstat !~ '&\s*$' && prev2stat =~ '&\s*$'
+ if prevstat !~ '&\s*$' && prev2stat =~ '&\s*$' && prevstat !~? '\<then\>'
let ind = ind - &sw
endif
diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim
index d64a0e5cd3..b97a905988 100644
--- a/runtime/indent/html.vim
+++ b/runtime/indent/html.vim
@@ -2,7 +2,7 @@
" Header: "{{{
" Maintainer: Bram Moolenaar
" Original Author: Andy Wokula <anwoku@yahoo.de>
-" Last Change: 2014 Aug 23
+" Last Change: 2015 Jan 11
" Version: 1.0
" Description: HTML indent script with cached state for faster indenting on a
" range of lines.
@@ -883,7 +883,7 @@ endfunc "}}}
" THE MAIN INDENT FUNCTION. Return the amount of indent for v:lnum.
func! HtmlIndent()
"{{{
- if prevnonblank(v:lnum - 1) <= 1
+ if prevnonblank(v:lnum - 1) < 1
" First non-blank line has no indent.
return 0
endif
diff --git a/runtime/indent/j.vim b/runtime/indent/j.vim
index e268e1fcd3..ea3d50936b 100644
--- a/runtime/indent/j.vim
+++ b/runtime/indent/j.vim
@@ -2,7 +2,7 @@
" Language: J
" Maintainer: David BĂĽrgin <676c7473@gmail.com>
" URL: https://github.com/glts/vim-j
-" Last Change: 2014-04-05
+" Last Change: 2015-01-11
if exists('b:did_indent')
finish
@@ -26,25 +26,25 @@ if !exists('g:j_indent_definitions')
endif
function GetJIndent() abort
- let prevlnum = prevnonblank(v:lnum-1)
- if prevlnum == 0
+ let l:prevlnum = prevnonblank(v:lnum - 1)
+ if l:prevlnum == 0
return 0
endif
- let indent = indent(prevlnum)
- let prevline = getline(prevlnum)
- if prevline =~# '^\s*\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|fcase\|for\%(_\a\k*\)\=\|if\|select\|try\|whil\%(e\|st\)\)\.\%(\%(\<end\.\)\@!.\)*$'
+ let l:indent = indent(l:prevlnum)
+ let l:prevline = getline(l:prevlnum)
+ if l:prevline =~# '^\s*\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|fcase\|for\%(_\a\k*\)\=\|if\|select\|try\|whil\%(e\|st\)\)\.\%(\%(\<end\.\)\@!.\)*$'
" Increase indentation after an initial control word that starts or
" continues a block and is not terminated by "end."
- let indent += shiftwidth()
- elseif g:j_indent_definitions && (prevline =~# '\<\%([1-4]\|13\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\>' || prevline =~# '^\s*:\s*$')
+ let l:indent += shiftwidth()
+ elseif g:j_indent_definitions && (l:prevline =~# '\<\%([1-4]\|13\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\>' || l:prevline =~# '^\s*:\s*$')
" Increase indentation in explicit definitions of adverbs, conjunctions,
" and verbs
- let indent += shiftwidth()
+ let l:indent += shiftwidth()
endif
" Decrease indentation in lines that start with either control words that
" continue or end a block, or the special items ")" and ":"
if getline(v:lnum) =~# '^\s*\%()\|:\|\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|end\|fcase\)\.\)'
- let indent -= shiftwidth()
+ let l:indent -= shiftwidth()
endif
- return indent
+ return l:indent
endfunction
diff --git a/runtime/syntax/awk.vim b/runtime/syntax/awk.vim
index f80a582226..40491eea1a 100644
--- a/runtime/syntax/awk.vim
+++ b/runtime/syntax/awk.vim
@@ -1,13 +1,15 @@
" Vim syntax file
" Language: awk, nawk, gawk, mawk
" Maintainer: Antonio Colombo <azc100@gmail.com>
-" Last Change: 2012 May 18
+" Last Change: 2014 Oct 21
" AWK ref. is: Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger
" The AWK Programming Language, Addison-Wesley, 1988
" GAWK ref. is: Arnold D. Robbins
" Effective AWK Programming, Third Edition, O'Reilly, 2001
+" Effective AWK Programming, Fourth Edition, O'Reilly, 2015
+" (also available with the gawk source distribution)
" MAWK is a "new awk" meaning it implements AWK ref.
" mawk conforms to the Posix 1003.2 (draft 11.3)
@@ -33,17 +35,27 @@ set cpo&vim
syn keyword awkStatement break continue delete exit
syn keyword awkStatement function getline next
syn keyword awkStatement print printf return
-" GAWK ref. p. 117
+" GAWK ref. Chapter 7
syn keyword awkStatement nextfile
-" AWK ref. p. 42, GAWK ref. p. 142-166
-syn keyword awkFunction atan2 close cos exp fflush int log rand sin sqrt srand
-syn keyword awkFunction gsub index length match split sprintf sub
-syn keyword awkFunction substr system
-" GAWK ref. p. 142-166
-syn keyword awkFunction asort gensub mktime strftime strtonum systime
+"
+" GAWK ref. Chapter 9, Functions
+"
+" Numeric Functions
+syn keyword awkFunction atan2 cos div exp int log rand sin sqrt srand
+" String Manipulation Functions
+syn keyword awkFunction asort asort1 gensub gsub index length match
+syn keyword awkFunction patsplit split sprintf strtonum sub substr
syn keyword awkFunction tolower toupper
-syn keyword awkFunction and or xor compl lshift rshift
-syn keyword awkFunction dcgettext bindtextdomain
+" Input Output Functions
+syn keyword awkFunction close fflush system
+" Time Functions
+syn keyword awkFunction mktime strftime systime
+" Bit Manipulation Functions
+syn keyword awkFunction and compl lshift or rshift xor
+" Getting Type Function
+syn keyword awkFunction isarray
+" String-Translation Functions
+syn keyword awkFunction bindtextdomain dcgettext dcngetext
syn keyword awkConditional if else
syn keyword awkRepeat while for
@@ -51,13 +63,16 @@ syn keyword awkRepeat while for
syn keyword awkTodo contained TODO
syn keyword awkPatterns BEGIN END
-" AWK ref. p. 36
-syn keyword awkVariables ARGC ARGV FILENAME FNR FS NF NR
-syn keyword awkVariables OFMT OFS ORS RLENGTH RS RSTART SUBSEP
-" GAWK ref. p. 120-126
-syn keyword awkVariables ARGIND BINMODE CONVFMT ENVIRON ERRNO
-syn keyword awkVariables FIELDWIDTHS IGNORECASE LINT PROCINFO
-syn keyword awkVariables RT RLENGTH TEXTDOMAIN
+
+" GAWK ref. Chapter 7
+" Built-in Variables That Control awk
+syn keyword awkVariables BINMODE CONVFMT FIELDWIDTHS FPAT FS
+syn keyword awkVariables IGNORECASE LINT OFMT OFS ORS PREC
+syn keyword awkVariables ROUNDMODE RS SUBSEP TEXTDOMAIN
+" Built-in Variables That Convey Information
+syn keyword awkVariables ARGC ARGV ARGIND ENVIRON ERRNO FILENAME
+syn keyword awkVariables FNR NF FUNCTAB NR PROCINFO RLENGTH RSTART
+syn keyword awkVariables RT SYMTAB
syn keyword awkRepeat do
@@ -115,15 +130,15 @@ syn case match
"syn match awkIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>"
" Arithmetic operators: +, and - take care of ++, and --
-"syn match awkOperator "+\|-\|\*\|/\|%\|="
-"syn match awkOperator "+=\|-=\|\*=\|/=\|%="
-"syn match awkOperator "^\|^="
+syn match awkOperator "+\|-\|\*\|/\|%\|="
+syn match awkOperator "+=\|-=\|\*=\|/=\|%="
+syn match awkOperator "^\|^="
" Comparison expressions.
-"syn match awkExpression "==\|>=\|=>\|<=\|=<\|\!="
-"syn match awkExpression "\~\|\!\~"
-"syn match awkExpression "?\|:"
-"syn keyword awkExpression in
+syn match awkExpression "==\|>=\|=>\|<=\|=<\|\!="
+syn match awkExpression "\~\|\!\~"
+syn match awkExpression "?\|:"
+syn keyword awkExpression in
" Boolean Logic (OR, AND, NOT)
"syn match awkBoolLogic "||\|&&\|\!"
@@ -187,8 +202,8 @@ if version >= 508 || !exists("did_awk_syn_inits")
HiLink awkFloat Float
HiLink awkFileIO Special
- "HiLink awkOperator Special
- "HiLink awkExpression Special
+ HiLink awkOperator Special
+ HiLink awkExpression Special
HiLink awkBoolLogic Special
HiLink awkPatterns Special
diff --git a/runtime/syntax/config.vim b/runtime/syntax/config.vim
index 20ca19ced0..cd83b24352 100644
--- a/runtime/syntax/config.vim
+++ b/runtime/syntax/config.vim
@@ -1,11 +1,13 @@
" Vim syntax file
" Language: configure.in script: M4 with sh
" Maintainer: Christian Hammesr <ch@lathspell.westend.com>
-" Last Change: 2008 Sep 03
+" Last Change: 2015 Jan 14
+" (patch from Yngve Inntjore Levinsen to detect AC_MSG)
+" (patch from Khym Chanur to add @Spell)
" Well, I actually even do not know much about m4. This explains why there
" is probably very much missing here, yet !
-" But I missed a good hilighting when editing my GNU autoconf/automake
+" But I missed good highlighting when editing my GNU autoconf/automake
" script, so I wrote this quick and dirty patch.
@@ -20,14 +22,19 @@ endif
" define the config syntax
syn match configdelimiter "[()\[\];,]"
syn match configoperator "[=|&\*\+\<\>]"
-syn match configcomment "\(dnl.*\)\|\(#.*\)"
+syn match configcomment "\(dnl.*\)\|\(#.*\)" contains=configDnl,@Spell
syn match configfunction "\<[A-Z_][A-Z0-9_]*\>"
syn match confignumber "[-+]\=\<\d\+\(\.\d*\)\=\>"
+syn keyword configDnl dnl contained
syn keyword configkeyword if then else fi test for in do done
syn keyword configspecial cat rm eval
-syn region configstring start=+"+ skip=+\\"+ end=+"+
-syn region configstring start=+'+ skip=+\\'+ end=+'+
-syn region configstring start=+`+ skip=+\\'+ end=+`+
+
+" This shortens the script, see syn-ext-match..
+syn region configstring start=+\z(["'`]\)+ skip=+\\\z1+ end=+\z1+ contains=@Spell
+
+" Anything inside AC_MSG_TYPE([...]) and AC_MSG_TYPE(...) is a string.
+syn region configstring matchgroup=configfunction start="AC_MSG_[A-Z]*\ze(\[" matchgroup=configdelimiter end="\])" contains=configdelimiter,@Spell
+syn region configstring matchgroup=configfunction start="AC_MSG_[A-Z]*\ze([^[]" matchgroup=configdelimiter end=")" contains=configdelimiter,@Spell
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
@@ -43,6 +50,7 @@ if version >= 508 || !exists("did_config_syntax_inits")
HiLink configdelimiter Delimiter
HiLink configoperator Operator
HiLink configcomment Comment
+ HiLink configDnl Comment
HiLink configfunction Function
HiLink confignumber Number
HiLink configkeyword Keyword
diff --git a/runtime/syntax/crontab.vim b/runtime/syntax/crontab.vim
index 36d75c4d13..fd1c30023f 100644
--- a/runtime/syntax/crontab.vim
+++ b/runtime/syntax/crontab.vim
@@ -5,7 +5,7 @@
" License: This file can be redistribued and/or modified under the same terms
" as Vim itself.
" Filenames: /tmp/crontab.* used by "crontab -e"
-" Last Change: 2012-05-16
+" Last Change: 2015-01-20
"
" crontab line format:
" Minutes Hours Days Months Days_of_Week Commands # comments
@@ -13,11 +13,17 @@
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
- syntax clear
+ syntax clear
elseif exists("b:current_syntax")
- finish
+ finish
endif
+syntax match crontabNick "^\s*@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\)\>" nextgroup=crontabCmd skipwhite
+
+syntax match crontabVar "^\s*\k\w*\s*="me=e-1
+
+syntax case ignore
+
syntax match crontabMin "^\s*[-0-9/,.*]\+" nextgroup=crontabHr skipwhite
syntax match crontabHr "\s[-0-9/,.*]\+" nextgroup=crontabDay skipwhite contained
syntax match crontabDay "\s[-0-9/,.*]\+" nextgroup=crontabMnth skipwhite contained
@@ -32,45 +38,41 @@ syntax region crontabCmd start="\S" end="$" skipwhite contained keepend contains
syntax match crontabCmnt "^\s*#.*" contains=@Spell
syntax match crontabPercent "[^\\]%.*"lc=1 contained
-syntax match crontabNick "^\s*@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\)\>" nextgroup=crontabCmd skipwhite
-
-syntax match crontabVar "^\s*\k\w*\s*="me=e-1
-
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_crontab_syn_inits")
- if version < 508
- let did_crontab_syn_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
-
- HiLink crontabMin Number
- HiLink crontabHr PreProc
- HiLink crontabDay Type
-
- HiLink crontabMnth Number
- HiLink crontabMnth12 Number
- HiLink crontabMnthS Number
- HiLink crontabMnthN Number
-
- HiLink crontabDow PreProc
- HiLink crontabDow7 PreProc
- HiLink crontabDowS PreProc
- HiLink crontabDowN PreProc
-
- HiLink crontabNick Special
- HiLink crontabVar Identifier
- HiLink crontabPercent Special
+ if version < 508
+ let did_crontab_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink crontabMin Number
+ HiLink crontabHr PreProc
+ HiLink crontabDay Type
+
+ HiLink crontabMnth Number
+ HiLink crontabMnth12 Number
+ HiLink crontabMnthS Number
+ HiLink crontabMnthN Number
+
+ HiLink crontabDow PreProc
+ HiLink crontabDow7 PreProc
+ HiLink crontabDowS PreProc
+ HiLink crontabDowN PreProc
+
+ HiLink crontabNick Special
+ HiLink crontabVar Identifier
+ HiLink crontabPercent Special
" comment out next line for to suppress unix commands coloring.
- HiLink crontabCmd Statement
+ HiLink crontabCmd Statement
- HiLink crontabCmnt Comment
+ HiLink crontabCmnt Comment
- delcommand HiLink
+ delcommand HiLink
endif
let b:current_syntax = "crontab"
diff --git a/runtime/syntax/diff.vim b/runtime/syntax/diff.vim
index ff69c5860b..885feaebdd 100644
--- a/runtime/syntax/diff.vim
+++ b/runtime/syntax/diff.vim
@@ -2,7 +2,7 @@
" Language: Diff (context or unified)
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Translations by Jakson Alves de Aquino.
-" Last Change: 2015 Jan 07
+" Last Change: 2015 Feb 03
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
@@ -123,13 +123,17 @@ syn match diffNoEOL "^\\ Non hai un salto de liña na fin da liña"
syn match diffCommon "^Subdirectorios comĂşns: .* e .*"
" he
-syn match diffOnly "^.*-ב קר ×צמנ .*"
-syn match diffIdentical "^םיהז םניה .*-ו .* םיצבקה$"
-syn match diffDiffer "^הזמ הז םינוש `.*'-ו `.*' םיצבקה$"
-syn match diffBDiffer "^הזמ הז םינוש `.*'-ו `.*' םיירניב םיצבק$"
-syn match diffIsA "^.* .*-ל .* .* תוושהל ןתינ ×ל$"
-syn match diffNoEOL "^\\ ץבוקה ףוסב השד.-הרוש ות רס."
-syn match diffCommon "^.*-ו .* :תוהז תויקית-תת$"
+" ^.* are expansive patterns for long lines, so disabled unless we can match
+" some specific hebrew chars
+if search('\%u05d5\|\%u05d1', 'nw', '', 100)
+ syn match diffOnly "^.*-ב קר ×צמנ .*"
+ syn match diffIdentical "^םיהז םניה .*-ו .* םיצבקה$"
+ syn match diffDiffer "^הזמ הז םינוש `.*'-ו `.*' םיצבקה$"
+ syn match diffBDiffer "^הזמ הז םינוש `.*'-ו `.*' םיירניב םיצבק$"
+ syn match diffIsA "^.* .*-ל .* .* תוושהל ןתינ ×ל$"
+ syn match diffNoEOL "^\\ ץבוקה ףוסב השד.-הרוש ות רס."
+ syn match diffCommon "^.*-ו .* :תוהז תויקית-תת$"
+endif
" hr
syn match diffOnly "^Samo u .*"
diff --git a/runtime/syntax/fortran.vim b/runtime/syntax/fortran.vim
index df33793bb2..120a999404 100644
--- a/runtime/syntax/fortran.vim
+++ b/runtime/syntax/fortran.vim
@@ -1,15 +1,15 @@
" Vim syntax file
" Language: Fortran 2008 (and earlier versions: 2003, 95, 90, and 77)
-" Version: 0.94
-" Last Change: 2012 June 18
-" Maintainer: Ajit J. Thakkar (ajit AT unb.ca); <http://www.unb.ca/chem/ajit/>
+" Version: 0.95
+" Last Change: 2015 Jan. 15
+" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
" Usage: For instructions, do :help fortran-syntax from Vim
" Credits:
" Version 0.1 was based on the fortran 77 syntax file by Mario Eusebio and
" Preben Guldberg. Useful suggestions were made by: Andrej Panjkov,
" Bram Moolenaar, Thomas Olsen, Michael Sternberg, Christian Reile,
" Walter Dieudonné, Alexander Wagner, Roman Bertle, Charles Rendleman,
-" Andrew Griffiths, Joe Krahn, and Hendrik Merx.
+" Andrew Griffiths, Joe Krahn, Hendrik Merx, and Matt Thompson.
if exists("b:current_syntax")
finish
@@ -298,6 +298,41 @@ if b:fortran_dialect == "f08"
syn keyword fortranIntrinsic bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr num_images parity popcnt poppar shifta shiftl shiftr this_image
syn keyword fortranIO newunit
syn keyword fortranType contiguous
+
+" CUDA fortran
+ syn match fortranTypeCUDA "\<attributes\>"
+ syn keyword fortranTypeCUDA host global device value
+ syn keyword fortranTypeCUDA shared constant pinned texture
+ syn keyword fortranTypeCUDA dim1 dim2 dim3 dim4
+ syn keyword fortranTypeCUDA cudadeviceprop cuda_count_kind cuda_stream_kind
+ syn keyword fortranTypeCUDA cudaEvent cudaFuncAttributes cudaArrayPtr
+ syn keyword fortranTypeCUDA cudaSymbol cudaChannelFormatDesc cudaPitchedPtr
+ syn keyword fortranTypeCUDA cudaExtent cudaMemcpy3DParms
+ syn keyword fortranTypeCUDA cudaFuncCachePreferNone cudaFuncCachePreferShared
+ syn keyword fortranTypeCUDA cudaFuncCachePreferL1 cudaLimitStackSize
+ syn keyword fortranTypeCUDA cudaLimitPrintfSize cudaLimitMallocHeapSize
+ syn keyword fortranTypeCUDA cudaSharedMemBankSizeDefault cudaSharedMemBankSizeFourByte cudaSharedMemBankSizeEightByte
+ syn keyword fortranTypeCUDA cudaEventDefault cudaEventBlockingSync cudaEventDisableTiming
+ syn keyword fortranTypeCUDA cudaMemcpyHostToDevice cudaMemcpyDeviceToHost
+ syn keyword fortranTypeCUDA cudaMemcpyDeviceToDevice
+ syn keyword fortranTypeCUDA cudaErrorNotReady cudaSuccess cudaErrorInvalidValue
+ syn keyword fortranTypeCUDA c_devptr
+
+ syn match fortranStringCUDA "blockidx%[xyz]"
+ syn match fortranStringCUDA "blockdim%[xyz]"
+ syn match fortranStringCUDA "griddim%[xyz]"
+ syn match fortranStringCUDA "threadidx%[xyz]"
+
+ syn keyword fortranIntrinsicCUDA warpsize syncthreads syncthreads_and syncthreads_count syncthreads_or threadfence threadfence_block threadfence_system gpu_time allthreads anythread ballot
+ syn keyword fortranIntrinsicCUDA atomicadd atomicsub atomicmax atomicmin atomicand atomicor atomicxor atomicexch atomicinc atomicdec atomiccas sizeof __shfl __shfl_up __shfl_down __shfl_xor
+ syn keyword fortranIntrinsicCUDA cudaChooseDevice cudaDeviceGetCacheConfig cudaDeviceGetLimit cudaDeviceGetSharedMemConfig cudaDeviceReset cudaDeviceSetCacheConfig cudaDeviceSetLimit cudaDeviceSetSharedMemConfig cudaDeviceSynchronize cudaGetDevice cudaGetDeviceCount cudaGetDeviceProperties cudaSetDevice cudaSetDeviceFlags cudaSetValidDevices
+ syn keyword fortranIntrinsicCUDA cudaThreadExit cudaThreadSynchronize cudaGetLastError cudaGetErrorString cudaPeekAtLastError cudaStreamCreate cudaStreamDestroy cudaStreamQuery cudaStreamSynchronize cudaStreamWaitEvent cudaEventCreate cudaEventCreateWithFlags cudaEventDestroy cudaEventElapsedTime cudaEventQuery cudaEventRecord cudaEventSynchronize
+ syn keyword fortranIntrinsicCUDA cudaFuncGetAttributes cudaFuncSetCacheConfig cudaFuncSetSharedMemConfig cudaSetDoubleForDevice cudaSetDoubleForHost cudaFree cudaFreeArray cudaFreeHost cudaGetSymbolAddress cudaGetSymbolSize
+ syn keyword fortranIntrinsicCUDA cudaHostAlloc cudaHostGetDevicePointer cudaHostGetFlags cudaHostRegister cudaHostUnregister cudaMalloc cudaMallocArray cudaMallocHost cudaMallocPitch cudaMalloc3D cudaMalloc3DArray
+ syn keyword fortranIntrinsicCUDA cudaMemcpy cudaMemcpyArraytoArray cudaMemcpyAsync cudaMemcpyFromArray cudaMemcpyFromSymbol cudaMemcpyFromSymbolAsync cudaMemcpyPeer cudaMemcpyPeerAsync cudaMemcpyToArray cudaMemcpyToSymbol cudaMemcpyToSymbolAsync cudaMemcpy2D cudaMemcpy2DArrayToArray cudaMemcpy2DAsync cudaMemcpy2DFromArray cudaMemcpy2DToArray cudaMemcpy3D cudaMemcpy3DAsync
+ syn keyword fortranIntrinsicCUDA cudaMemGetInfo cudaMemset cudaMemset2D cudaMemset3D cudaDeviceCanAccessPeer cudaDeviceDisablePeerAccess cudaDeviceEnablePeerAccess cudaPointerGetAttributes cudaDriverGetVersion cudaRuntimeGetVersion
+
+ syn region none matchgroup=fortranType start="<<<" end=">>>" contains=ALLBUT,none
endif
syn cluster fortranCommentGroup contains=fortranTodo
@@ -453,6 +488,11 @@ else
hi! def link fortranConditionalR fortranConditional
endif
+" CUDA
+hi def link fortranIntrinsicCUDA fortranIntrinsic
+hi def link fortranTypeCUDA fortranType
+hi def link fortranStringCUDA fortranString
+
hi def link fortranFormatSpec Identifier
hi def link fortranFloat Float
hi def link fortranPreCondit PreCondit
diff --git a/runtime/syntax/j.vim b/runtime/syntax/j.vim
index 0cdd59b887..4912942e8b 100644
--- a/runtime/syntax/j.vim
+++ b/runtime/syntax/j.vim
@@ -2,7 +2,7 @@
" Language: J
" Maintainer: David BĂĽrgin <676c7473@gmail.com>
" URL: https://github.com/glts/vim-j
-" Last Change: 2014-10-05
+" Last Change: 2015-01-11
if exists('b:current_syntax')
finish
@@ -23,12 +23,12 @@ syntax match jControl /\<\%(for\|goto\|label\)_\a\k*\./
" Standard library names. A few names need to be defined with ":syntax match"
" because they would otherwise take precedence over the corresponding jControl
" and jDefineExpression items.
-syntax keyword jStdlibNoun ARGV BINPATH CR CRLF DEL Debug EAV EMPTY FF FHS IF64 IFIOS IFJCDROID IFJHS IFQT IFRASPI IFUNIX IFWIN IFWINCE IFWINE IFWOW64 JB01 JBOXED JCHAR JCMPX JFL JINT JPTR JSIZES JSTR JTYPES JVERSION LF LF2 TAB UNAME UNXLIB andurl dbhelp libjqt
-syntax keyword jStdlibAdverb define each every fapplylines inv inverse items leaf rows table
+syntax keyword jStdlibNoun ARGV BINPATH CR CRLF DEL Debug EAV EMPTY FF FHS IF64 IFIOS IFJCDROID IFJHS IFQT IFRASPI IFUNIX IFWIN IFWINCE IFWINE IFWOW64 JB01 JBOXED JCHAR JCMPX JFL JINT JPTR JSIZES JSTR JTYPES JVERSION LF LF2 TAB UNAME UNXLIB dbhelp libjqt
+syntax keyword jStdlibAdverb define each every fapplylines inv inverse items leaf rows rxapply rxmerge table
syntax keyword jStdlibConjunction bind cuts def on
-syntax keyword jStdlibVerb AND Endian IFDEF Note OR XOR alpha17 alpha27 anddf android_exec_host andunzip apply boxopen boxxopen bx calendar cd cdcb cder cderx cdf charsub chopstring clear coclass cocreate cocurrent codestroy coerase cofind cofindv cofullname coinfo coinsert coname conames conew conl conouns conounsx copath copathnl copathnlx coreset costate cut cutLF cutopen cutpara datatype dbctx dberm dberr dbg dbjmp dblocals dblxq dblxs dbnxt dbq dbr dbret dbrr dbrrx dbrun dbs dbsig dbsq dbss dbst dbstack dbstk dbstop dbstopme dbstopnext dbstops dbtrace dbview deb debc delstring detab dfh dir dircompare dircompares dirfind dirpath dirss dirssrplc dirtree dirused dlb dltb dltbs dquote drop dropafter dropto dtb dtbs echo empty endian erase evtloop exit expand f2utf8 fappend fappends fboxname fc fcopynew fdir ferase fetch fexist fexists fgets file2url fixdotdot fliprgb fmakex foldpara foldtext fpathcreate fpathname fputs fread freadblock freadr freads frename freplace fsize fss fssrplc fstamp fstringreplace ftype fview fwrite fwritenew fwrites getargs getdate getenv getqtbin hfd hostpathsep ic install iospath isatty isotimestamp isutf8 jcwdpath joinstring jpathsep jsystemdefs list ljust load loadd mema memf memr memw nameclass namelist names nc nl pick quote require rjust rplc script scriptd setbreak show sign sminfo smoutput sort split splitnostring splitstring ss startupandroid startupconsole startupide stderr stdin stdout stringreplace symdat symget symset take takeafter taketo timespacex timestamp timex tmoutput toCRLF toHOST toJ todate todayno tolower topara toupper tsdiff tsrep tstamp type ucp ucpcount unxlib usleep utf8 uucp valdate wcsize weekday weeknumber weeksinyear winpathsep
+syntax keyword jStdlibVerb AND Endian IFDEF OR XOR anddf android_exec_am android_exec_host andunzip apply boxopen boxxopen bx calendar cd cdcb cder cderx cdf charsub chopstring cleartags clear coclass cocreate cocurrent codestroy coerase cofind cofindv cofullname coinfo coinsert compare coname conames conew conl conouns conounsx copath copathnl copathnlx coreset costate cut cutLF cutopen cutpara datatype dbctx dberm dberr dbg dbjmp dblocals dblxq dblxs dbnxt dbq dbr dbret dbrr dbrrx dbrun dbs dbsig dbsq dbss dbst dbstack dbstk dbstop dbstopme dbstopnext dbstops dbtrace dbview deb debc delstring detab dfh dir dircompare dircompares dirfind dirpath dirss dirssrplc dirtree dirused dlb dltb dltbs dquote drop dropafter dropto dtb dtbs echo empty endian erase evtloop exit expand f2utf8 fappend fappends fboxname fc fcompare fcompares fcopynew fdir ferase fetch fexist fexists fgets file2url fixdotdot fliprgb fmakex foldpara foldtext fpathcreate fpathname fputs fread freadblock freadr freads frename freplace fsize fss fssrplc fstamp fstringreplace ftype fview fwrite fwritenew fwrites getalpha getargs getdate getenv getqtbin hfd hostpathsep ic install iospath isatty isotimestamp isutf8 jcwdpath joinstring jpath jpathsep jsystemdefs launch list ljust load loadd loadtags mema memf memr memw nameclass namelist names nc nl pick quote require rjust rplc rxE rxall rxcomp rxcut rxeq rxerror rxfirst rxfree rxfrom rxhandles rxin rxindex rxinfo rxmatch rxmatches rxrplc rxutf8 script scriptd scripts setalpha setbreak shell show sign sminfo smoutput sort split splitnostring splitstring ss startupandroid startupconsole startupide stderr stdin stdout stringreplace symdat symget symset ta tagcp tagopen tagselect take takeafter taketo timespacex timestamp timex tmoutput toCRLF toHOST toJ todate todayno tolower topara toupper tsdiff tsrep tstamp type ucp ucpcount unxlib usleep utf8 uucp valdate wcsize weekday weeknumber weeksinyear winpathsep xedit
syntax match jStdlibNoun /\<\%(adverb\|conjunction\|dyad\|monad\|noun\|verb\)\>/
-syntax match jStdlibVerb /\<\%(assert\|break\|do\)\>\.\@!/
+syntax match jStdlibVerb /\<\%(Note\|\%(assert\|break\|do\)\.\@!\)\>/
" Numbers. Matching J numbers is difficult. In fact, the job cannot be done
" with regular expressions alone. Below is a sketch of the pattern used. It
@@ -75,12 +75,12 @@ syntax match jConjunction /;\.\|\^:\|![.:]/
" the next line. The trick is to split the problem into two regions and link
" them with "nextgroup=". The fold wrapper provides syntax folding.
syntax region jNounDefineFold
- \ matchgroup=NONE start=/\<\%(\%(0\|noun\)\s\+\%(\:\s*0\|def\s\+0\|define\)\>\)\@=/
+ \ matchgroup=NONE start=/\%(\%(\%(^\s*Note\)\|\<\%(0\|noun\)\s\+\%(\:\s*0\|def\s\+0\|define\)\)\>\)\@=/
\ keepend matchgroup=NONE end=/^\s*)\s*$/
\ contains=jNounDefineStart
\ fold
syntax region jNounDefineStart
- \ matchgroup=jDefineExpression start=/\<\%(0\|noun\)\s\+\%(\:\s*0\|def\s\+0\|define\)\>/
+ \ matchgroup=jDefineExpression start=/\%(\%(^\s*Note\)\|\<\%(0\|noun\)\s\+\%(\:\s*0\|def\s\+0\|define\)\)\>/
\ keepend matchgroup=NONE end=/$/
\ contains=@jStdlibItems,@jPrimitiveItems,jNumber,jString,jParenGroup,jParen,jComment
\ contained oneline skipempty nextgroup=jDefineEnd,jNounDefine
@@ -112,7 +112,7 @@ syntax region jParenGroup
\ oneline transparent
syntax keyword jTodo contained TODO FIXME XXX
-syntax match jComment /NB\..*$/ contains=jTodo,@Spell
+syntax match jComment /\<NB\..*$/ contains=jTodo,@Spell
syntax match jSharpBang /\%^#!.*$/
diff --git a/runtime/syntax/mplayerconf.vim b/runtime/syntax/mplayerconf.vim
index b348327f90..84ad2daf13 100644
--- a/runtime/syntax/mplayerconf.vim
+++ b/runtime/syntax/mplayerconf.vim
@@ -1,7 +1,8 @@
" Vim syntax file
-" Language: mplayer(1) configuration file
-" Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2007-06-17
+" Language: mplayer(1) configuration file
+" Maintainer: Dmitri Vereshchagin <dmitri.vereshchagin@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Latest Revision: 2015-01-24
if exists("b:current_syntax")
finish
@@ -19,7 +20,7 @@ syn region mplayerconfComment display oneline start='#' end='$'
syn keyword mplayerconfPreProc include
-syn keyword mplayerconfBoolean yes no
+syn keyword mplayerconfBoolean yes no true false
syn match mplayerconfNumber '\<\d\+\>'
@@ -68,7 +69,49 @@ syn keyword mplayerconfOption hardframedrop nomouseinput bandwidth dumpstream
\ audio-delay audio-preload endpos ffourcc
\ include info noautoexpand noskip o oac of
\ ofps ovc skiplimit v vobsubout vobsuboutid
- \ lameopts lavcopts nuvopts xvidencopts
+ \ lameopts lavcopts nuvopts xvidencopts a52drc
+ \ adapter af-add af-clr af-del af-pre
+ \ allow-dangerous-playlist-parsing ass
+ \ ass-border-color ass-bottom-margin ass-color
+ \ ass-font-scale ass-force-style ass-hinting
+ \ ass-line-spacing ass-styles ass-top-margin
+ \ ass-use-margins ausid bluray-angle
+ \ bluray-device border border-pos-x border-pos-y
+ \ cache-min cache-seek-min capture codecpath
+ \ codecs-file correct-pts crash-debug
+ \ doubleclick-time dvd-speed edl-backward-delay
+ \ edl-start-pts embeddedfonts fafmttag
+ \ field-dominance fontconfig force-avi-aspect
+ \ force-key-frames frameno-file fullscreen gamma
+ \ gui gui-include gui-wid heartbeat-cmd
+ \ heartbeat-interval hr-edl-seek
+ \ http-header-fields idle ignore-start
+ \ key-fifo-size list-properties menu-chroot
+ \ menu-keepdir menu-startup mixer-channel
+ \ monitor-orientation monitorpixelaspect
+ \ mouse-movements msgcharset msgcolor msglevel
+ \ msgmodule name noar nocache noconfig
+ \ noconsolecontrols nocorrect-pts nodouble
+ \ noedl-start-pts noencodedups
+ \ noflip-hebrew-commas nogui noidx noodml
+ \ nostop-xscreensaver nosub noterm-osd
+ \ osd-duration osd-fractions panscanrange
+ \ pausing playing-msg priority profile
+ \ progbar-align psprobe pvr radio referrer
+ \ refreshrate reuse-socket rtc rtc-device
+ \ rtsp-destination rtsp-port
+ \ rtsp-stream-over-http screenh show-profile
+ \ softvol softvol-max sub-paths subfont
+ \ term-osd-esc title tvscan udp-ip udp-master
+ \ udp-port udp-seek-threshold udp-slave
+ \ unrarexec use-filedir-conf use-filename-title
+ \ vf-add vf-clr vf-del vf-pre volstep volume
+ \ zrhdec zrydoff
+
+syn region mplayerconfString display oneline start=+"+ end=+"+
+syn region mplayerconfString display oneline start=+'+ end=+'+
+
+syn region mplayerconfProfile display oneline start='^\s*\[' end='\]'
hi def link mplayerconfTodo Todo
hi def link mplayerconfComment Comment
@@ -76,6 +119,8 @@ hi def link mplayerconfPreProc PreProc
hi def link mplayerconfBoolean Boolean
hi def link mplayerconfNumber Number
hi def link mplayerconfOption Keyword
+hi def link mplayerconfString String
+hi def link mplayerconfProfile Special
let b:current_syntax = "mplayerconf"
diff --git a/runtime/syntax/rpcgen.vim b/runtime/syntax/rpcgen.vim
index 548f8c807f..85036dc049 100644
--- a/runtime/syntax/rpcgen.vim
+++ b/runtime/syntax/rpcgen.vim
@@ -1,15 +1,11 @@
" Vim syntax file
" Language: rpcgen
-" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Sep 06, 2005
-" Version: 8
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Jan 13, 2015
+" Version: 10
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_RPCGEN
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
+if exists("b:current_syntax")
finish
endif
diff --git a/runtime/syntax/sm.vim b/runtime/syntax/sm.vim
index 2f9e6d7d01..ad96cdb3b5 100644
--- a/runtime/syntax/sm.vim
+++ b/runtime/syntax/sm.vim
@@ -1,15 +1,11 @@
" Vim syntax file
" Language: sendmail
-" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Sep 06, 2005
-" Version: 4
-" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
-
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
+" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Jan 13, 2015
+" Version: 6
+" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SM
+
+if exists("b:current_syntax")
finish
endif
diff --git a/runtime/syntax/strace.vim b/runtime/syntax/strace.vim
index 80cd262efc..0f686fd808 100644
--- a/runtime/syntax/strace.vim
+++ b/runtime/syntax/strace.vim
@@ -1,9 +1,8 @@
" Vim syntax file
" This is a GENERATED FILE. Please always refer to source file at the URI below.
" Language: strace output
-" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
-" Last Change: 2002-10-10
-" URL: http://trific.ath.cx/Ftp/vim/syntax/strace.vim
+" Maintainer: David Necas (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2015-01-16
" Setup
if version >= 600
@@ -17,7 +16,7 @@ endif
syn case match
" Parse the line
-syn match straceSpecialChar "\\\d\d\d\|\\." contained
+syn match straceSpecialChar "\\\o\{1,3}\|\\." contained
syn region straceString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=straceSpecialChar oneline
syn match straceNumber "\W[+-]\=\(\d\+\)\=\.\=\d\+\([eE][+-]\=\d\+\)\="lc=1
syn match straceNumber "\W0x\x\+"lc=1
diff --git a/runtime/syntax/valgrind.vim b/runtime/syntax/valgrind.vim
index c247927c2f..d099971826 100644
--- a/runtime/syntax/valgrind.vim
+++ b/runtime/syntax/valgrind.vim
@@ -2,7 +2,8 @@
" Language: Valgrind Memory Debugger Output
" Maintainer: Roger Luethi <rl@hellgate.ch>
" Program URL: http://devel-home.kde.org/~sewardj/
-" Last Change: 2014 Oct 02
+" Last Change: 2015 Jan 27
+" Included improvement by Dominique Pelle
"
" Notes: mostly based on strace.vim and xml.vim
"
@@ -15,6 +16,9 @@ endif
let s:keepcpo= &cpo
set cpo&vim
+" Lines can be long with demangled c++ functions.
+setlocal synmaxcol=8000
+
syn case match
syn sync minlines=50
@@ -29,8 +33,8 @@ syn region valgrindRegion
\ contains=valgrindPidChunk,valgrindLine
syn region valgrindPidChunk
- \ start=+\(^==\)\@<=+
- \ end=+\(==\)\@=+
+ \ start=+^==\zs+
+ \ end=+\ze==+
\ contained
\ contains=valgrindPid0,valgrindPid1,valgrindPid2,valgrindPid3,valgrindPid4,valgrindPid5,valgrindPid6,valgrindPid7,valgrindPid8,valgrindPid9
\ keepend
@@ -64,10 +68,11 @@ syn match valgrindSummary ".*SUMMARY:" contained
syn match valgrindLoc "\s\+\(by\|at\|Address\).*$" contained
\ contains=valgrindAt,valgrindAddr,valgrindFunc,valgrindBin,valgrindSrc
syn match valgrindAt "at\s\@=" contained
-syn match valgrindAddr "\(\W\)\@<=0x\x\+" contained
-syn match valgrindFunc "\(: \)\@<=\w\+" contained
-syn match valgrindBin "\((\(with\|\)in \)\@<=\S\+\()\)\@=" contained
-syn match valgrindSrc "\((\)\@<=[^)]*:\d\+\()\)\@=" contained
+syn match valgrindAddr "\W\zs0x\x\+" contained
+
+syn match valgrindFunc ": \zs\h[a-zA-Z0-9_:\[\]()<>&*+\-,=%!|^ ]*\ze([^)]*)$" contained
+syn match valgrindBin "(\(with\)\=in \zs\S\+)\@=" contained
+syn match valgrindSrc "(\zs[^)]*:\d\+)\@=" contained
" Define the default highlighting
diff --git a/runtime/syntax/yacc.vim b/runtime/syntax/yacc.vim
index 17a1cab6b7..714432be9d 100644
--- a/runtime/syntax/yacc.vim
+++ b/runtime/syntax/yacc.vim
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: Yacc
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Mar 20, 2014
-" Version: 11
+" Last Change: Jan 14, 2015
+" Version: 12
" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
"
" Options: {{{1
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index 4a567727d8..1f6c787b24 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -38,11 +38,10 @@ check_executable() {
get_vim_sources() {
check_executable git
- echo "Retrieving Vim sources."
+ cd "${VIM_SOURCE_DIR}"
if [[ ! -d ${VIM_SOURCE_DIR} ]]; then
echo "Cloning Vim sources into '${VIM_SOURCE_DIR}'."
git clone --depth=1000 https://github.com/vim/vim.git "${VIM_SOURCE_DIR}"
- cd "${VIM_SOURCE_DIR}"
else
if [[ ! -d "${VIM_SOURCE_DIR}/.git" ]]; then
echo "âś ${VIM_SOURCE_DIR} does not appear to be a git repository."
@@ -50,7 +49,6 @@ get_vim_sources() {
exit 1
fi
echo "Updating Vim sources in '${VIM_SOURCE_DIR}'."
- cd "${VIM_SOURCE_DIR}"
git pull &&
echo "âś” Updated Vim sources." ||
echo "âś Could not update Vim sources; ignoring error."
@@ -58,11 +56,8 @@ get_vim_sources() {
}
commit_message() {
- echo "vim-patch:${vim_version}
-
-${vim_message}
-
-${vim_commit_url}"
+ printf 'vim-patch:%s\n\n%s\n\n%s' "${vim_version}" \
+ "${vim_message}" "${vim_commit_url}"
}
assign_commit_details() {
@@ -102,8 +97,10 @@ get_vim_patch() {
# Collect patch details and store into variables.
vim_full="$(git show -1 --pretty=medium "${vim_commit}")"
+ # Patch surgery: preprocess the patch.
+ # - transform src/ paths to src/nvim/
vim_diff="$(git show -1 "${vim_commit}" \
- | sed -e 's/\( [ab]\/src\)/\1\/nvim/g')" # Change directory to src/nvim.
+ | LC_ALL=C sed -e 's/\( [ab]\/src\)/\1\/nvim/g')"
neovim_message="$(commit_message)"
neovim_pr="
\`\`\`
@@ -161,22 +158,20 @@ ${vim_diff}
list_vim_patches() {
get_vim_sources
- echo
- echo "Vim patches missing from Neovim:"
+ printf "\nVim patches missing from Neovim:\n"
# Get tags since 7.4.442.
- local vim_tags=$(cd "${VIM_SOURCE_DIR}" && \
- git tag --contains v7.4.442)
+ local vim_tags=$(cd "${VIM_SOURCE_DIR}" && git tag --contains v7.4.442)
# Get non-versioned commits since e2719096.
if git log -1 --grep='.' --invert-grep > /dev/null 2>&1 ; then
local vim_runtime_commits=$(cd "${VIM_SOURCE_DIR}" && \
- git log --format='%H' --grep='^patch' --grep='^updated for version' --invert-grep e2719096250a19ecdd9a35d13702879f163d2a50..HEAD)
- else
- # --invert-grep requires git 2.4+
+ git log --reverse --format='%H' --grep='^patch' --grep='^updated for version' \
+ --invert-grep e2719096250a19ecdd9a35d13702879f163d2a50..HEAD)
+ else # --invert-grep requires git 2.4+
echo "Warning: some runtime updates may not be listed (requires git 2.4+)."
local vim_runtime_commits=$(cd "${VIM_SOURCE_DIR}" && \
- git log --format='%H' --grep='Updated' e2719096250a19ecdd9a35d13702879f163d2a50..HEAD)
+ git log --reverse --format='%H' --grep='Updated' e2719096250a19ecdd9a35d13702879f163d2a50..HEAD)
fi
local vim_commit
@@ -191,7 +186,7 @@ list_vim_patches() {
else
# Untagged Vim patch (e.g. runtime updates), check the Neovim git log:
is_missing="$(cd "${NEOVIM_SOURCE_DIR}" &&
- git log -1 --no-merges --grep="vim\-patch:${vim_commit:0:7}" --pretty=format:"false")"
+ git log -1 --no-merges --grep="vim\-patch:${vim_commit:0:7}" --pretty=format:false)"
fi
if [[ ${is_missing} != "false" ]]; then
@@ -258,8 +253,6 @@ review_pr() {
echo "âś” Saved full pull request commit details to '${NEOVIM_SOURCE_DIR}/n${base_name}.patch'."
git show "${vim_commit}" > "${NEOVIM_SOURCE_DIR}/${base_name}.diff"
echo "âś” Saved Vim diff to '${NEOVIM_SOURCE_DIR}/${base_name}.diff'."
- git show "${vim_commit}" > "${NEOVIM_SOURCE_DIR}/${base_name}.patch"
- echo "âś” Saved full Vim commit details to '${NEOVIM_SOURCE_DIR}/${base_name}.patch'."
echo "You can use 'git clean' to remove these files when you're done."
echo
diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua
index b7a3505c99..702abf3cf0 100644
--- a/src/nvim/ex_cmds.lua
+++ b/src/nvim/ex_cmds.lua
@@ -34,6 +34,7 @@ local ADDR_ARGUMENTS = 2
local ADDR_LOADED_BUFFERS = 3
local ADDR_BUFFERS = 4
local ADDR_TABS = 5
+local ADDR_QUICKFIX = 6
-- The following table is described in ex_cmds_defs.h file.
return {
@@ -374,6 +375,12 @@ return {
func='ex_cd',
},
{
+ command='cdo',
+ flags=bit.bor(BANG, NEEDARG, EXTRA, NOTRLCOM, RANGE, NOTADR, DFLALL),
+ addr_type=ADDR_QUICKFIX,
+ func='ex_listdo',
+ },
+ {
command='center',
flags=bit.bor(TRLBAR, RANGE, WHOLEFOLD, EXTRA, CMDWIN, MODIFY),
addr_type=ADDR_LINES,
@@ -391,6 +398,14 @@ return {
addr_type=ADDR_LINES,
func='ex_cfile',
},
+ -- Even though 'cfdo' is alphabetically lower than 'cfile', it is after
+ -- 'cfile' in this cmd list to support the existing ":cf" abbreviation.
+ {
+ command='cfdo',
+ flags=bit.bor(BANG, NEEDARG, EXTRA, NOTRLCOM, RANGE, NOTADR, DFLALL),
+ addr_type=ADDR_QUICKFIX,
+ func='ex_listdo',
+ },
{
command='cfirst',
flags=bit.bor(RANGE, NOTADR, COUNT, TRLBAR, BANG),
@@ -1286,6 +1301,12 @@ return {
func='do_cscope',
},
{
+ command='ldo',
+ flags=bit.bor(BANG, NEEDARG, EXTRA, NOTRLCOM, RANGE, NOTADR, DFLALL),
+ addr_type=ADDR_QUICKFIX,
+ func='ex_listdo',
+ },
+ {
command='left',
flags=bit.bor(TRLBAR, RANGE, WHOLEFOLD, EXTRA, CMDWIN, MODIFY),
addr_type=ADDR_LINES,
@@ -1315,6 +1336,14 @@ return {
addr_type=ADDR_LINES,
func='ex_cfile',
},
+ -- Even though 'lfdo' is alphabetically lower than 'lfile', it is after
+ -- 'lfile' in this cmd list to support the existing ":lf" abbreviation.
+ {
+ command='lfdo',
+ flags=bit.bor(BANG, NEEDARG, EXTRA, NOTRLCOM, RANGE, NOTADR, DFLALL),
+ addr_type=ADDR_QUICKFIX,
+ func='ex_listdo',
+ },
{
command='lfirst',
flags=bit.bor(RANGE, NOTADR, COUNT, TRLBAR, BANG),
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 87a6283310..57153cf5a1 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -1868,7 +1868,7 @@ void ex_argdelete(exarg_T *eap)
}
/*
- * ":argdo", ":windo", ":bufdo", ":tabdo"
+ * ":argdo", ":windo", ":bufdo", ":tabdo", ":cdo", ":ldo", ":cfdo" and ":lfdo"
*/
void ex_listdo(exarg_T *eap)
{
@@ -1879,7 +1879,6 @@ void ex_listdo(exarg_T *eap)
char_u *save_ei = NULL;
char_u *p_shm_save;
-
if (eap->cmdidx != CMD_windo && eap->cmdidx != CMD_tabdo)
/* Don't do syntax HL autocommands. Skipping the syntax file is a
* great speed improvement. */
@@ -1914,7 +1913,10 @@ void ex_listdo(exarg_T *eap)
default:
break;
}
+
buf_T *buf = curbuf;
+ size_t qf_size = 0;
+
/* set pcmark now */
if (eap->cmdidx == CMD_bufdo) {
/* Advance to the first listed buffer after "eap->line1". */
@@ -1929,6 +1931,22 @@ void ex_listdo(exarg_T *eap)
if (buf != NULL) {
goto_buffer(eap, DOBUF_FIRST, FORWARD, buf->b_fnum);
}
+ } else if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo ||
+ eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo) {
+ qf_size = qf_get_size(eap);
+ assert(eap->line1 >= 0);
+ if (qf_size == 0 || (size_t)eap->line1 > qf_size) {
+ buf = NULL;
+ } else {
+ ex_cc(eap);
+
+ buf = curbuf;
+ i = eap->line1 - 1;
+ if (eap->addr_count <= 0) {
+ // Default to all quickfix/location list entries.
+ eap->line2 = qf_size;
+ }
+ }
} else {
setpcmark();
}
@@ -2009,9 +2027,27 @@ void ex_listdo(exarg_T *eap)
set_option_value((char_u *)"shm", 0L, p_shm_save, 0);
xfree(p_shm_save);
- /* If autocommands took us elsewhere, quit here */
- if (curbuf->b_fnum != next_fnum)
+ // If autocommands took us elsewhere, quit here.
+ if (curbuf->b_fnum != next_fnum) {
+ break;
+ }
+ }
+
+ if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo ||
+ eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo) {
+ assert(i >= 0);
+ if ((size_t)i >= qf_size || i >= eap->line2) {
break;
+ }
+
+ size_t qf_idx = qf_get_cur_idx(eap);
+
+ ex_cnext(eap);
+
+ // If jumping to the next quickfix entry fails, quit here.
+ if (qf_get_cur_idx(eap) == qf_idx) {
+ break;
+ }
}
if (eap->cmdidx == CMD_windo) {
diff --git a/src/nvim/ex_cmds_defs.h b/src/nvim/ex_cmds_defs.h
index 10d2eb688e..f46d1e6d47 100644
--- a/src/nvim/ex_cmds_defs.h
+++ b/src/nvim/ex_cmds_defs.h
@@ -72,6 +72,7 @@
#define ADDR_LOADED_BUFFERS 3
#define ADDR_BUFFERS 4
#define ADDR_TABS 5
+#define ADDR_QUICKFIX 6
typedef struct exarg exarg_T;
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 59bda9345e..fad497928c 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -1531,9 +1531,12 @@ static char_u * do_one_cmd(char_u **cmdlinep,
lnum = CURRENT_TAB_NR;
ea.line2 = lnum;
break;
+ case ADDR_QUICKFIX:
+ ea.line2 = qf_get_cur_valid_idx(&ea);
+ break;
}
ea.cmd = skipwhite(ea.cmd);
- lnum = get_address(&ea.cmd, ea.addr_type, ea.skip, ea.addr_count == 0);
+ lnum = get_address(&ea, &ea.cmd, ea.addr_type, ea.skip, ea.addr_count == 0);
if (ea.cmd == NULL) /* error detected */
goto doend;
if (lnum == MAXLNUM) {
@@ -1582,6 +1585,13 @@ static char_u * do_one_cmd(char_u **cmdlinep,
ea.line2 = ARGCOUNT;
}
break;
+ case ADDR_QUICKFIX:
+ ea.line1 = 1;
+ ea.line2 = qf_get_size(&ea);
+ if (ea.line2 == 0) {
+ ea.line2 = 1;
+ }
+ break;
}
++ea.addr_count;
}
@@ -1962,6 +1972,12 @@ static char_u * do_one_cmd(char_u **cmdlinep,
ea.line2 = ARGCOUNT;
}
break;
+ case ADDR_QUICKFIX:
+ ea.line2 = qf_get_size(&ea);
+ if (ea.line2 == 0) {
+ ea.line2 = 1;
+ }
+ break;
}
}
@@ -2945,6 +2961,8 @@ set_one_cmd_context (
case CMD_botright:
case CMD_browse:
case CMD_bufdo:
+ case CMD_cdo:
+ case CMD_cfdo:
case CMD_confirm:
case CMD_debug:
case CMD_folddoclosed:
@@ -2954,7 +2972,9 @@ set_one_cmd_context (
case CMD_keepjumps:
case CMD_keepmarks:
case CMD_keeppatterns:
+ case CMD_ldo:
case CMD_leftabove:
+ case CMD_lfdo:
case CMD_lockmarks:
case CMD_noautocmd:
case CMD_noswapfile:
@@ -3367,7 +3387,8 @@ skip_range (
*
* Return MAXLNUM when no Ex address was found.
*/
-static linenr_T get_address(char_u **ptr,
+static linenr_T get_address(exarg_T *eap,
+ char_u **ptr,
int addr_type, // flag: one of ADDR_LINES, ...
int skip, // only skip the address, don't use it
int to_other_file // flag: may jump to other file
@@ -3405,6 +3426,9 @@ static linenr_T get_address(char_u **ptr,
case ADDR_TABS:
lnum = CURRENT_TAB_NR;
break;
+ case ADDR_QUICKFIX:
+ lnum = qf_get_cur_valid_idx(eap);
+ break;
}
break;
@@ -3436,6 +3460,12 @@ static linenr_T get_address(char_u **ptr,
case ADDR_TABS:
lnum = LAST_TAB_NR;
break;
+ case ADDR_QUICKFIX:
+ lnum = qf_get_size(eap);
+ if (lnum == 0) {
+ lnum = 1;
+ }
+ break;
}
break;
@@ -3578,6 +3608,9 @@ static linenr_T get_address(char_u **ptr,
case ADDR_TABS:
lnum = CURRENT_TAB_NR;
break;
+ case ADDR_QUICKFIX:
+ lnum = qf_get_cur_valid_idx(eap);
+ break;
}
}
@@ -3702,6 +3735,12 @@ static char_u *invalid_range(exarg_T *eap)
return (char_u *)_(e_invrange);
}
break;
+ case ADDR_QUICKFIX:
+ assert(eap->line2 >= 0);
+ if (eap->line2 != 1 && (size_t)eap->line2 > qf_get_size(eap)) {
+ return (char_u *)_(e_invrange);
+ }
+ break;
}
}
return NULL;
@@ -4589,6 +4628,7 @@ static struct {
{ADDR_TABS, "tabs"},
{ADDR_BUFFERS, "buffers"},
{ADDR_WINDOWS, "windows"},
+ {ADDR_QUICKFIX, "quickfix"},
{-1, NULL}
};
@@ -7013,9 +7053,7 @@ static void ex_put(exarg_T *eap)
*/
static void ex_copymove(exarg_T *eap)
{
- long n;
-
- n = get_address(&eap->arg, eap->addr_type, FALSE, FALSE);
+ long n = get_address(eap, &eap->arg, eap->addr_type, false, false);
if (eap->arg == NULL) { /* error detected */
eap->nextcmd = NULL;
return;
diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c
index 3585c26ca2..b78dfdca11 100644
--- a/src/nvim/if_cscope.c
+++ b/src/nvim/if_cscope.c
@@ -1146,22 +1146,6 @@ static void clear_csinfo(size_t i)
csinfo[i].to_fp = NULL;
}
-#ifndef UNIX
-static char *GetWin32Error(void)
-{
- char *msg = NULL;
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
- NULL, GetLastError(), 0, (LPSTR)&msg, 0, NULL);
- if (msg != NULL) {
- /* remove trailing \r\n */
- char *pcrlf = strstr(msg, "\r\n");
- if (pcrlf != NULL)
- *pcrlf = '\0';
- }
- return msg;
-}
-#endif
-
/*
* PRIVATE: cs_insert_filelist
*
diff --git a/src/nvim/os/win_defs.h b/src/nvim/os/win_defs.h
index 6003d46d96..aad9672ba7 100644
--- a/src/nvim/os/win_defs.h
+++ b/src/nvim/os/win_defs.h
@@ -2,6 +2,7 @@
#define NVIM_OS_WIN_DEFS_H
#include <windows.h>
+#include <sys/stat.h>
#define TEMP_DIR_NAMES {"$TMP", "$TEMP", "$USERPROFILE", ""}
#define TEMP_FILE_PATH_MAXLEN _MAX_PATH
@@ -17,6 +18,9 @@
# ifndef restrict
# define restrict __restrict
# endif
+# ifndef S_IXUSR
+# define S_IXUSR S_IEXEC
+# endif
#endif
#ifdef _MSC_VER
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 8e6ae46a3b..3abf43cb8c 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -1202,7 +1202,7 @@ static void qf_clean_dir_stack(struct dir_stack_T **stackptr)
/*
* Check in which directory of the directory stack the given file can be
* found.
- * Returns a pointer to the directory name or NULL if not found
+ * Returns a pointer to the directory name or NULL if not found.
* Cleans up intermediate directory entries.
*
* TODO: How to solve the following problem?
@@ -2571,9 +2571,159 @@ static char_u *get_mef_name(void)
return name;
}
+/// Returns the number of valid entries in the current quickfix/location list.
+size_t qf_get_size(exarg_T *eap)
+ FUNC_ATTR_NONNULL_ALL
+{
+ qf_info_T *qi = &ql_info;
+ if (eap->cmdidx == CMD_ldo || eap->cmdidx == CMD_lfdo) {
+ // Location list.
+ qi = GET_LOC_LIST(curwin);
+ if (qi == NULL) {
+ return 0;
+ }
+ }
+
+ int prev_fnum = 0;
+ size_t sz = 0;
+ qfline_T *qfp;
+ size_t i;
+ assert(qi->qf_lists[qi->qf_curlist].qf_count >= 0);
+ for (i = 0, qfp = qi->qf_lists[qi->qf_curlist].qf_start;
+ i < (size_t)qi->qf_lists[qi->qf_curlist].qf_count && qfp != NULL;
+ i++, qfp = qfp->qf_next) {
+ if (!qfp->qf_valid) {
+ continue;
+ }
+
+ if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo) {
+ // Count all valid entries.
+ sz++;
+ } else if (qfp->qf_fnum > 0 && qfp->qf_fnum != prev_fnum) {
+ // Count the number of files.
+ sz++;
+ prev_fnum = qfp->qf_fnum;
+ }
+ }
+
+ return sz;
+}
+
+/// Returns the current index of the quickfix/location list.
+/// Returns 0 if there is an error.
+size_t qf_get_cur_idx(exarg_T *eap)
+ FUNC_ATTR_NONNULL_ALL
+{
+ qf_info_T *qi = &ql_info;
+
+ if (eap->cmdidx == CMD_ldo || eap->cmdidx == CMD_lfdo) {
+ // Location list.
+ qi = GET_LOC_LIST(curwin);
+ if (qi == NULL) {
+ return 0;
+ }
+ }
+
+ assert(qi->qf_lists[qi->qf_curlist].qf_index >= 0);
+ return (size_t)qi->qf_lists[qi->qf_curlist].qf_index;
+}
+
+/// Returns the current index in the quickfix/location list,
+/// counting only valid entries.
+/// Returns 1 if there are no valid entries.
+int qf_get_cur_valid_idx(exarg_T *eap)
+ FUNC_ATTR_NONNULL_ALL
+{
+ qf_info_T *qi = &ql_info;
+
+ if (eap->cmdidx == CMD_ldo || eap->cmdidx == CMD_lfdo) {
+ // Location list.
+ qi = GET_LOC_LIST(curwin);
+ if (qi == NULL) {
+ return 1;
+ }
+ }
+
+ qf_list_T *qfl = &qi->qf_lists[qi->qf_curlist];
+
+ // Check if the list has valid errors.
+ if (qfl->qf_count <= 0 || qfl->qf_nonevalid) {
+ return 1;
+ }
+
+ int prev_fnum = 0;
+ int eidx = 0;
+ qfline_T *qfp;
+ size_t i;
+ assert(qfl->qf_index >= 0);
+ for (i = 1, qfp = qfl->qf_start;
+ i <= (size_t)qfl->qf_index && qfp != NULL;
+ i++, qfp = qfp->qf_next) {
+ if (!qfp->qf_valid) {
+ continue;
+ }
+
+ if (eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo) {
+ if (qfp->qf_fnum > 0 && qfp->qf_fnum != prev_fnum) {
+ // Count the number of files.
+ eidx++;
+ prev_fnum = qfp->qf_fnum;
+ }
+ } else {
+ eidx++;
+ }
+ }
+
+ return eidx != 0 ? eidx : 1;
+}
+
+/// Get the 'n'th valid error entry in the quickfix or location list.
+///
+/// Used by :cdo, :ldo, :cfdo and :lfdo commands.
+/// For :cdo and :ldo, returns the 'n'th valid error entry.
+/// For :cfdo and :lfdo, returns the 'n'th valid file entry.
+static size_t qf_get_nth_valid_entry(qf_info_T *qi, size_t n, bool fdo)
+ FUNC_ATTR_NONNULL_ALL
+{
+ qf_list_T *qfl = &qi->qf_lists[qi->qf_curlist];
+
+ // Check if the list has valid errors.
+ if (qfl->qf_count <= 0 || qfl->qf_nonevalid) {
+ return 1;
+ }
+
+ int prev_fnum = 0;
+ size_t eidx = 0;
+ size_t i;
+ qfline_T *qfp;
+ assert(qfl->qf_count >= 0);
+ for (i = 1, qfp = qfl->qf_start;
+ i <= (size_t)qfl->qf_count && qfp != NULL;
+ i++, qfp = qfp->qf_next) {
+ if (qfp->qf_valid) {
+ if (fdo) {
+ if (qfp->qf_fnum > 0 && qfp->qf_fnum != prev_fnum) {
+ // Count the number of files.
+ eidx++;
+ prev_fnum = qfp->qf_fnum;
+ }
+ } else {
+ eidx++;
+ }
+ }
+
+ if (eidx == n) {
+ break;
+ }
+ }
+
+ return i <= (size_t)qfl->qf_count ? i : 1;
+}
+
/*
* ":cc", ":crewind", ":cfirst" and ":clast".
* ":ll", ":lrewind", ":lfirst" and ":llast".
+ * ":cdo", ":ldo", ":cfdo" and ":lfdo".
*/
void ex_cc(exarg_T *eap)
{
@@ -2582,7 +2732,10 @@ void ex_cc(exarg_T *eap)
if (eap->cmdidx == CMD_ll
|| eap->cmdidx == CMD_lrewind
|| eap->cmdidx == CMD_lfirst
- || eap->cmdidx == CMD_llast) {
+ || eap->cmdidx == CMD_llast
+ || eap->cmdidx == CMD_llast
+ || eap->cmdidx == CMD_ldo
+ || eap->cmdidx == CMD_lfdo) {
qi = GET_LOC_LIST(curwin);
if (qi == NULL) {
EMSG(_(e_loclist));
@@ -2590,21 +2743,42 @@ void ex_cc(exarg_T *eap)
}
}
- qf_jump(qi, 0,
- eap->addr_count > 0
- ? (int)eap->line2
- : (eap->cmdidx == CMD_cc || eap->cmdidx == CMD_ll)
- ? 0
- : (eap->cmdidx == CMD_crewind || eap->cmdidx == CMD_lrewind
- || eap->cmdidx == CMD_cfirst || eap->cmdidx == CMD_lfirst)
- ? 1
- : 32767,
- eap->forceit);
+ int errornr;
+ if (eap->addr_count > 0) {
+ errornr = (int)eap->line2;
+ } else if (eap->cmdidx == CMD_cc || eap->cmdidx == CMD_ll) {
+ errornr = 0;
+ } else if (eap->cmdidx == CMD_crewind || eap->cmdidx == CMD_lrewind
+ || eap->cmdidx == CMD_cfirst || eap->cmdidx == CMD_lfirst) {
+ errornr = 1;
+ } else {
+ errornr = 32767;
+ }
+
+ // For cdo and ldo commands, jump to the nth valid error.
+ // For cfdo and lfdo commands, jump to the nth valid file entry.
+ if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo ||
+ eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo) {
+ size_t n;
+ if (eap->addr_count > 0) {
+ assert(eap->line1 >= 0);
+ n = (size_t)eap->line1;
+ } else {
+ n = 1;
+ }
+ size_t valid_entry = qf_get_nth_valid_entry(qi, n,
+ eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo);
+ assert(valid_entry <= INT_MAX);
+ errornr = (int)valid_entry;
+ }
+
+ qf_jump(qi, 0, errornr, eap->forceit);
}
/*
* ":cnext", ":cnfile", ":cNext" and ":cprevious".
* ":lnext", ":lNext", ":lprevious", ":lnfile", ":lNfile" and ":lpfile".
+ * ":cdo", ":ldo", ":cfdo" and ":lfdo".
*/
void ex_cnext(exarg_T *eap)
{
@@ -2615,7 +2789,10 @@ void ex_cnext(exarg_T *eap)
|| eap->cmdidx == CMD_lprevious
|| eap->cmdidx == CMD_lnfile
|| eap->cmdidx == CMD_lNfile
- || eap->cmdidx == CMD_lpfile) {
+ || eap->cmdidx == CMD_lpfile
+ || eap->cmdidx == CMD_lpfile
+ || eap->cmdidx == CMD_ldo
+ || eap->cmdidx == CMD_lfdo) {
qi = GET_LOC_LIST(curwin);
if (qi == NULL) {
EMSG(_(e_loclist));
@@ -2623,15 +2800,26 @@ void ex_cnext(exarg_T *eap)
}
}
- qf_jump(qi, (eap->cmdidx == CMD_cnext || eap->cmdidx == CMD_lnext)
+ int errornr;
+ if (eap->addr_count > 0 &&
+ (eap->cmdidx != CMD_cdo && eap->cmdidx != CMD_ldo &&
+ eap->cmdidx != CMD_cfdo && eap->cmdidx != CMD_lfdo)) {
+ errornr = (int)eap->line2;
+ } else {
+ errornr = 1;
+ }
+
+ qf_jump(qi, (eap->cmdidx == CMD_cnext || eap->cmdidx == CMD_lnext
+ || eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo)
? FORWARD
- : (eap->cmdidx == CMD_cnfile || eap->cmdidx == CMD_lnfile)
+ : (eap->cmdidx == CMD_cnfile || eap->cmdidx == CMD_lnfile
+ || eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo)
? FORWARD_FILE
: (eap->cmdidx == CMD_cpfile || eap->cmdidx == CMD_lpfile
|| eap->cmdidx == CMD_cNfile || eap->cmdidx == CMD_lNfile)
? BACKWARD_FILE
: BACKWARD,
- eap->addr_count > 0 ? (int)eap->line2 : 1, eap->forceit);
+ errornr, eap->forceit);
}
/*
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 9fdb476748..c4264cbcee 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -2934,14 +2934,16 @@ win_line (
}
}
- /* Decide which of the highlight attributes to use. */
- attr_pri = TRUE;
- if (area_attr != 0)
- char_attr = area_attr;
- else if (search_attr != 0)
- char_attr = search_attr;
- /* Use line_attr when not in the Visual or 'incsearch' area
- * (area_attr may be 0 when "noinvcur" is set). */
+ // Decide which of the highlight attributes to use.
+ attr_pri = true;
+
+ if (area_attr != 0) {
+ char_attr = hl_combine_attr(line_attr, area_attr);
+ } else if (search_attr != 0) {
+ char_attr = hl_combine_attr(line_attr, search_attr);
+ }
+ // Use line_attr when not in the Visual or 'incsearch' area
+ // (area_attr may be 0 when "noinvcur" is set).
else if (line_attr != 0 && ((fromcol == -10 && tocol == MAXCOL)
|| vcol < fromcol || vcol_prev < fromcol_prev
|| vcol >= tocol))
@@ -3323,16 +3325,15 @@ win_line (
* Found last space before word: check for line break.
*/
if (wp->w_p_lbr && vim_isbreak(c) && !vim_isbreak(*ptr)) {
- char_u *p = ptr - (
- has_mbyte ? mb_l :
- 1);
+ int mb_off = has_mbyte ? (*mb_head_off)(line, ptr - 1) : 0;
+ char_u *p = ptr - (mb_off + 1);
// TODO: is passing p for start of the line OK?
n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol, NULL) - 1;
if (c == TAB && n_extra + col > wp->w_width) {
n_extra = (int)wp->w_buffer->b_p_ts
- vcol % (int)wp->w_buffer->b_p_ts - 1;
}
- c_extra = ' ';
+ c_extra = mb_off > 0 ? MB_FILLER_CHAR : ' ';
if (ascii_iswhite(c)) {
if (c == TAB)
/* See "Tab alignment" below. */
diff --git a/src/nvim/shada.c b/src/nvim/shada.c
index 340c14066a..42e514aa95 100644
--- a/src/nvim/shada.c
+++ b/src/nvim/shada.c
@@ -122,7 +122,7 @@ KHASH_SET_INIT_STR(strset)
// E576: Missing '>'
// E577: Illegal register name
// E886: Can't rename viminfo file to %s!
-// Now only five of them are used:
+// Now only six of them are used:
// E137: ShaDa file is not writeable (for pre-open checks)
// E138: All %s.tmp.X files exist, cannot write ShaDa file!
// RCERR (E576) for critical read errors.
@@ -130,6 +130,7 @@ KHASH_SET_INIT_STR(strset)
// RERR (E575) for various errors inside read ShaDa file.
// SERR (E886) for various “system” errors (always contains output of
// strerror)
+// WERR (E574) for various ignorable write errors
/// Common prefix for all errors inside ShaDa file
///
@@ -148,6 +149,9 @@ KHASH_SET_INIT_STR(strset)
/// Common prefix for all “rename” errors
#define RNERR "E136: "
+/// Common prefix for all ignorable “write” errors
+#define WERR "E574: "
+
/// Flags for shada_read_file and children
typedef enum {
kShaDaWantInfo = 1, ///< Load non-mark information
@@ -198,6 +202,9 @@ typedef enum {
///< a ShaDa file.
kSDWriteFailed, ///< Writing was not successfull (e.g. because there
///< was no space left on device).
+ kSDWriteIgnError, ///< Writing resulted in a error which can be ignored
+ ///< (e.g. when trying to dump a function reference or
+ ///< self-referencing container in a variable).
} ShaDaWriteResult;
/// Flags for shada_read_next_item
@@ -1666,11 +1673,14 @@ static char *shada_filename(const char *file)
/// @param[in] entry Entry written.
/// @param[in] max_kbyte Maximum size of an item in KiB. Zero means no
/// restrictions.
-static bool shada_pack_entry(msgpack_packer *const packer,
- ShadaEntry entry,
- const size_t max_kbyte)
+///
+/// @return kSDWriteSuccessfull, kSDWriteFailed or kSDWriteIgnError.
+static ShaDaWriteResult shada_pack_entry(msgpack_packer *const packer,
+ ShadaEntry entry,
+ const size_t max_kbyte)
FUNC_ATTR_NONNULL_ALL
{
+ ShaDaWriteResult ret = kSDWriteFailed;
msgpack_sbuffer sbuf;
msgpack_sbuffer_init(&sbuf);
msgpack_packer *spacker = msgpack_packer_new(&sbuf, &msgpack_sbuffer_write);
@@ -1742,6 +1752,9 @@ static bool shada_pack_entry(msgpack_packer *const packer,
msgpack_pack_array(spacker, arr_size);
PACK_BIN(cstr_as_string(entry.data.global_var.name));
if (vim_to_msgpack(spacker, &entry.data.global_var.value) == FAIL) {
+ ret = kSDWriteIgnError;
+ EMSG2(_(WERR "Failed to write variable %s"),
+ entry.data.global_var.name);
goto shada_pack_entry_error;
}
DUMP_ADDITIONAL_ELEMENTS(entry.data.global_var.additional_elements);
@@ -1946,11 +1959,11 @@ static bool shada_pack_entry(msgpack_packer *const packer,
}
msgpack_packer_free(spacker);
msgpack_sbuffer_destroy(&sbuf);
- return true;
+ return kSDWriteSuccessfull;
shada_pack_entry_error:
msgpack_packer_free(spacker);
msgpack_sbuffer_destroy(&sbuf);
- return false;
+ return ret;
}
#undef PACK_STRING
@@ -1965,13 +1978,13 @@ shada_pack_entry_error:
/// is assumed that entry was already converted.
/// @param[in] max_kbyte Maximum size of an item in KiB. Zero means no
/// restrictions.
-static bool shada_pack_encoded_entry(msgpack_packer *const packer,
- const vimconv_T *const sd_conv,
- PossiblyFreedShadaEntry entry,
- const size_t max_kbyte)
+static ShaDaWriteResult shada_pack_encoded_entry(msgpack_packer *const packer,
+ const vimconv_T *const sd_conv,
+ PossiblyFreedShadaEntry entry,
+ const size_t max_kbyte)
FUNC_ATTR_NONNULL_ALL
{
- bool ret = true;
+ ShaDaWriteResult ret = kSDWriteSuccessfull;
if (entry.can_free_entry) {
ret = shada_pack_entry(packer, entry.data, max_kbyte);
shada_free_shada_entry(&entry.data);
@@ -2244,9 +2257,7 @@ static inline ShaDaWriteResult shada_read_when_writing(
assert(false);
}
case kSDItemUnknown: {
- if (!shada_pack_entry(packer, entry, 0)) {
- ret = kSDWriteFailed;
- }
+ ret = shada_pack_entry(packer, entry, 0);
shada_free_shada_entry(&entry);
break;
}
@@ -2262,9 +2273,7 @@ static inline ShaDaWriteResult shada_read_when_writing(
}
case kSDItemHistoryEntry: {
if (entry.data.history_item.histtype >= HIST_COUNT) {
- if (!shada_pack_entry(packer, entry, 0)) {
- ret = kSDWriteFailed;
- }
+ ret = shada_pack_entry(packer, entry, 0);
shada_free_shada_entry(&entry);
break;
}
@@ -2275,9 +2284,7 @@ static inline ShaDaWriteResult shada_read_when_writing(
case kSDItemRegister: {
const int idx = op_reg_index(entry.data.reg.name);
if (idx < 0) {
- if (!shada_pack_entry(packer, entry, 0)) {
- ret = kSDWriteFailed;
- }
+ ret = shada_pack_entry(packer, entry, 0);
shada_free_shada_entry(&entry);
break;
}
@@ -2286,9 +2293,7 @@ static inline ShaDaWriteResult shada_read_when_writing(
}
case kSDItemVariable: {
if (!in_strset(&wms->dumped_variables, entry.data.global_var.name)) {
- if (!shada_pack_entry(packer, entry, 0)) {
- ret = kSDWriteFailed;
- }
+ ret = shada_pack_entry(packer, entry, 0);
}
shada_free_shada_entry(&entry);
break;
@@ -2296,9 +2301,7 @@ static inline ShaDaWriteResult shada_read_when_writing(
case kSDItemGlobalMark: {
const int idx = mark_global_index(entry.data.filemark.name);
if (idx < 0) {
- if (!shada_pack_entry(packer, entry, 0)) {
- ret = kSDWriteFailed;
- }
+ ret = shada_pack_entry(packer, entry, 0);
shada_free_shada_entry(&entry);
break;
}
@@ -2465,7 +2468,7 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
}
// Write header
- if (!shada_pack_entry(packer, (ShadaEntry) {
+ if (shada_pack_entry(packer, (ShadaEntry) {
.type = kSDItemHeader,
.timestamp = os_time(),
.data = {
@@ -2486,7 +2489,7 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
}),
}
}
- }, 0)) {
+ }, 0) == kSDWriteFailed) {
ret = kSDWriteFailed;
goto shada_write_exit;
}
@@ -2526,7 +2529,7 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
};
i++;
}
- if (!shada_pack_entry(packer, buflist_entry, 0)) {
+ if (shada_pack_entry(packer, buflist_entry, 0) == kSDWriteFailed) {
xfree(buflist_entry.data.buffer_list.buffers);
ret = kSDWriteFailed;
goto shada_write_exit;
@@ -2552,7 +2555,8 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
} else {
copy_tv(&vartv, &tgttv);
}
- if (!shada_pack_entry(packer, (ShadaEntry) {
+ ShaDaWriteResult spe_ret;
+ if ((spe_ret = shada_pack_entry(packer, (ShadaEntry) {
.type = kSDItemVariable,
.timestamp = cur_timestamp,
.data = {
@@ -2562,7 +2566,7 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
.additional_elements = NULL,
}
}
- }, max_kbyte)) {
+ }, max_kbyte)) == kSDWriteFailed) {
clear_tv(&vartv);
clear_tv(&tgttv);
ret = kSDWriteFailed;
@@ -2570,8 +2574,10 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
}
clear_tv(&vartv);
clear_tv(&tgttv);
- int kh_ret;
- (void) kh_put(strset, &wms->dumped_variables, name, &kh_ret);
+ if (spe_ret == kSDWriteSuccessfull) {
+ int kh_ret;
+ (void) kh_put(strset, &wms->dumped_variables, name, &kh_ret);
+ }
} while (var_iter != NULL);
}
@@ -2828,9 +2834,9 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
do { \
for (size_t i_ = 0; i_ < ARRAY_SIZE(wms_array); i_++) { \
if (wms_array[i_].data.type != kSDItemMissing) { \
- if (!shada_pack_encoded_entry(packer, &sd_writer->sd_conv, \
- wms_array[i_], \
- max_kbyte)) { \
+ if (shada_pack_encoded_entry(packer, &sd_writer->sd_conv, \
+ wms_array[i_], \
+ max_kbyte) == kSDWriteFailed) { \
ret = kSDWriteFailed; \
goto shada_write_exit; \
} \
@@ -2840,8 +2846,8 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
PACK_WMS_ARRAY(wms->global_marks);
PACK_WMS_ARRAY(wms->registers);
for (size_t i = 0; i < wms->jumps_size; i++) {
- if (!shada_pack_encoded_entry(packer, &sd_writer->sd_conv, wms->jumps[i],
- max_kbyte)) {
+ if (shada_pack_encoded_entry(packer, &sd_writer->sd_conv, wms->jumps[i],
+ max_kbyte) == kSDWriteFailed) {
ret = kSDWriteFailed;
goto shada_write_exit;
}
@@ -2849,8 +2855,8 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
#define PACK_WMS_ENTRY(wms_entry) \
do { \
if (wms_entry.data.type != kSDItemMissing) { \
- if (!shada_pack_encoded_entry(packer, &sd_writer->sd_conv, wms_entry, \
- max_kbyte)) { \
+ if (shada_pack_encoded_entry(packer, &sd_writer->sd_conv, wms_entry, \
+ max_kbyte) == kSDWriteFailed) { \
ret = kSDWriteFailed; \
goto shada_write_exit; \
} \
@@ -2877,16 +2883,16 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
for (size_t i = 0; i < file_markss_to_dump; i++) {
PACK_WMS_ARRAY(all_file_markss[i]->marks);
for (size_t j = 0; j < all_file_markss[i]->changes_size; j++) {
- if (!shada_pack_encoded_entry(packer, &sd_writer->sd_conv,
- all_file_markss[i]->changes[j],
- max_kbyte)) {
+ if (shada_pack_encoded_entry(packer, &sd_writer->sd_conv,
+ all_file_markss[i]->changes[j],
+ max_kbyte) == kSDWriteFailed) {
ret = kSDWriteFailed;
goto shada_write_exit;
}
}
for (size_t j = 0; j < all_file_markss[i]->additional_marks_size; j++) {
- if (!shada_pack_entry(packer, all_file_markss[i]->additional_marks[j],
- 0)) {
+ if (shada_pack_entry(packer, all_file_markss[i]->additional_marks[j],
+ 0) == kSDWriteFailed) {
shada_free_shada_entry(&all_file_markss[i]->additional_marks[j]);
ret = kSDWriteFailed;
goto shada_write_exit;
@@ -2903,16 +2909,15 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
if (dump_one_history[i]) {
hms_insert_whole_neovim_history(&wms->hms[i]);
HMS_ITER(&wms->hms[i], cur_entry, {
- if (!shada_pack_encoded_entry(
+ if (shada_pack_encoded_entry(
packer, &sd_writer->sd_conv, (PossiblyFreedShadaEntry) {
.data = cur_entry->data,
.can_free_entry = cur_entry->can_free_entry,
- }, max_kbyte)) {
+ }, max_kbyte) == kSDWriteFailed) {
ret = kSDWriteFailed;
break;
}
})
- hms_dealloc(&wms->hms[i]);
if (ret == kSDWriteFailed) {
goto shada_write_exit;
}
@@ -2921,6 +2926,11 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
}
shada_write_exit:
+ for (size_t i = 0; i < HIST_COUNT; i++) {
+ if (dump_one_history[i]) {
+ hms_dealloc(&wms->hms[i]);
+ }
+ }
kh_dealloc(file_marks, &wms->file_marks);
kh_dealloc(bufset, &removable_bufs);
msgpack_packer_free(packer);
@@ -3043,6 +3053,7 @@ shada_write_file_nomerge: {}
const ShaDaWriteResult sw_ret = shada_write(&sd_writer, (nomerge
? NULL
: &sd_reader));
+ assert(sw_ret != kSDWriteIgnError);
#ifndef UNIX
sd_writer.close(&sd_writer);
#endif
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile
index 8c3e99c624..1a414a8847 100644
--- a/src/nvim/testdir/Makefile
+++ b/src/nvim/testdir/Makefile
@@ -29,6 +29,7 @@ SCRIPTS := test_eval.out \
test_charsearch.out \
test_close_count.out \
test_command_count.out \
+ test_cdo.out \
SCRIPTS_GUI := test16.out
diff --git a/src/nvim/testdir/test_breakindent.in b/src/nvim/testdir/test_breakindent.in
index b05aef7f8d..5a8e580c4a 100644
--- a/src/nvim/testdir/test_breakindent.in
+++ b/src/nvim/testdir/test_breakindent.in
@@ -101,7 +101,7 @@ fygjyl:let line2 = @0
:$put =line2
:"
:let g:test="Test 14: breakindent + visual blockwise delete #1"
-:set all& breakindent
+:set all& breakindent shada+=nX-test-breakindent.shada
:30vnew
:normal! 3a1234567890
:normal! a abcde
diff --git a/src/nvim/testdir/test_cdo.in b/src/nvim/testdir/test_cdo.in
new file mode 100644
index 0000000000..fb80ea1164
--- /dev/null
+++ b/src/nvim/testdir/test_cdo.in
@@ -0,0 +1,107 @@
+Tests for the :cdo, :cfdo, :ldo and :lfdo commands
+
+STARTTEST
+:so small.vim
+:if !has('quickfix') | e! test.ok | wq! test.out | endif
+
+:call writefile(["Line1", "Line2", "Line3"], 'Xtestfile1')
+:call writefile(["Line1", "Line2", "Line3"], 'Xtestfile2')
+:call writefile(["Line1", "Line2", "Line3"], 'Xtestfile3')
+
+:function RunTests(cchar)
+: let nl="\n"
+
+: enew
+: " Try with an empty list
+: exe a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+
+: " Populate the list and then try
+: exe a:cchar . "getexpr ['non-error 1', 'Xtestfile1:1:3:Line1', 'non-error 2', 'Xtestfile2:2:2:Line2', 'non-error 3', 'Xtestfile3:3:1:Line3']"
+: exe a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+
+: " Run command only on selected error lines
+: enew
+: exe "2,3" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: " Boundary condition tests
+: enew
+: exe "1,1" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: enew
+: exe "3" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: " Range test commands
+: enew
+: exe "%" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: enew
+: exe "1,$" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: enew
+: exe a:cchar . 'prev'
+: exe "." . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: " Invalid error lines test
+: enew
+: exe "27" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: exe "4,5" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+
+: " Run commands from an unsaved buffer
+: let v:errmsg=''
+: enew
+: setlocal modified
+: exe "2,2" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: if v:errmsg =~# 'No write since last change'
+: let g:result .= 'Unsaved file change test passed' . nl
+: else
+: let g:result .= 'Unsaved file change test failed' . nl
+: endif
+
+: " If the executed command fails, then the operation should be aborted
+: enew!
+: let subst_count = 0
+: exe a:cchar . "do s/Line/xLine/ | let subst_count += 1"
+: if subst_count == 1 && getline('.') == 'xLine1'
+: let g:result .= 'Abort command on error test passed' . nl
+: else
+: let g:result .= 'Abort command on error test failed' . nl
+: endif
+
+: exe "2,2" . a:cchar . "do! let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+
+: " List with no valid error entries
+: edit! +2 Xtestfile1
+: exe a:cchar . "getexpr ['non-error 1', 'non-error 2', 'non-error 3']"
+: exe a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: exe "2" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: let v:errmsg=''
+: exe "%" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: exe "1,$" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: exe "." . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: let g:result .= v:errmsg
+
+: " List with only one valid entry
+: exe a:cchar . "getexpr ['Xtestfile3:3:1:Line3']"
+: exe a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+
+: " Tests for :cfdo and :lfdo commands
+: exe a:cchar . "getexpr ['non-error 1', 'Xtestfile1:1:3:Line1', 'Xtestfile1:2:1:Line2', 'non-error 2', 'Xtestfile2:2:2:Line2', 'non-error 3', 'Xtestfile3:2:3:Line2', 'Xtestfile3:3:1:Line3']"
+: exe a:cchar . "fdo let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: exe "3" . a:cchar . "fdo let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: exe "2,3" . a:cchar . "fdo let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: exe "%" . a:cchar . "fdo let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: exe "1,$" . a:cchar . "fdo let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+: exe a:cchar . 'pfile'
+: exe "." . a:cchar . "fdo let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+
+: " List with only one valid entry
+: exe a:cchar . "getexpr ['Xtestfile2:2:5:Line2']"
+: exe a:cchar . "fdo let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl"
+:endfunction
+
+:let result=''
+:" Tests for the :cdo quickfix list command
+:call RunTests('c')
+:let result .= "\n"
+:" Tests for the :ldo location list command
+:call RunTests('l')
+
+:edit! test.out
+:0put =result
+:wq!
+ENDTEST
+
diff --git a/src/nvim/testdir/test_cdo.ok b/src/nvim/testdir/test_cdo.ok
new file mode 100644
index 0000000000..ddcff4bbb8
--- /dev/null
+++ b/src/nvim/testdir/test_cdo.ok
@@ -0,0 +1,66 @@
+Xtestfile1 1L 3C
+Xtestfile2 2L 2C
+Xtestfile3 3L 1C
+Xtestfile2 2L 2C
+Xtestfile3 3L 1C
+Xtestfile1 1L 3C
+Xtestfile3 3L 1C
+Xtestfile1 1L 3C
+Xtestfile2 2L 2C
+Xtestfile3 3L 1C
+Xtestfile1 1L 3C
+Xtestfile2 2L 2C
+Xtestfile3 3L 1C
+Xtestfile2 2L 2C
+Unsaved file change test passed
+Abort command on error test passed
+Xtestfile2 2L 2C
+Xtestfile3 3L 1C
+Xtestfile1 1L 3C
+Xtestfile2 2L 2C
+Xtestfile3 2L 3C
+Xtestfile3 2L 3C
+Xtestfile2 2L 2C
+Xtestfile3 2L 3C
+Xtestfile1 1L 3C
+Xtestfile2 2L 2C
+Xtestfile3 2L 3C
+Xtestfile1 1L 3C
+Xtestfile2 2L 2C
+Xtestfile3 2L 3C
+Xtestfile2 2L 2C
+Xtestfile2 2L 5C
+
+Xtestfile1 1L 3C
+Xtestfile2 2L 2C
+Xtestfile3 3L 1C
+Xtestfile2 2L 2C
+Xtestfile3 3L 1C
+Xtestfile1 1L 3C
+Xtestfile3 3L 1C
+Xtestfile1 1L 3C
+Xtestfile2 2L 2C
+Xtestfile3 3L 1C
+Xtestfile1 1L 3C
+Xtestfile2 2L 2C
+Xtestfile3 3L 1C
+Xtestfile2 2L 2C
+Unsaved file change test passed
+Abort command on error test passed
+Xtestfile2 2L 2C
+Xtestfile3 3L 1C
+Xtestfile1 1L 3C
+Xtestfile2 2L 2C
+Xtestfile3 2L 3C
+Xtestfile3 2L 3C
+Xtestfile2 2L 2C
+Xtestfile3 2L 3C
+Xtestfile1 1L 3C
+Xtestfile2 2L 2C
+Xtestfile3 2L 3C
+Xtestfile1 1L 3C
+Xtestfile2 2L 2C
+Xtestfile3 2L 3C
+Xtestfile2 2L 2C
+Xtestfile2 2L 5C
+
diff --git a/src/nvim/testdir/test_eval.in b/src/nvim/testdir/test_eval.in
index b2b982a434..54cdb03ba2 100644
--- a/src/nvim/testdir/test_eval.in
+++ b/src/nvim/testdir/test_eval.in
@@ -2,12 +2,18 @@ Test for various eval features. vim: set ft=vim :
Note: system clipboard is saved, changed and restored.
+clipboard contents
+something else
+
STARTTEST
:so small.vim
:set noswapfile
:lang C
:fun AppendRegContents(reg)
- call append('$', printf('%s: type %s; value: %s (%s), expr: %s (%s)', a:reg, getregtype(a:reg), getreg(a:reg), string(getreg(a:reg, 0, 1)), getreg(a:reg, 1), string(getreg(a:reg, 1, 1))))
+ call AppendRegParts(a:reg, getregtype(a:reg), getreg(a:reg), string(getreg(a:reg, 0, 1)), getreg(a:reg, 1), string(getreg(a:reg, 1, 1)))
+:endfun
+:fun AppendRegParts(reg, type, cont, strcont, cont1, strcont1)
+ call append('$', printf('%s: type %s; value: %s (%s), expr: %s (%s)', a:reg, a:type, a:cont, a:strcont, a:cont1, a:strcont1))
endfun
:command -nargs=? AR :call AppendRegContents(<q-args>)
:fun SetReg(...)
@@ -121,18 +127,23 @@ call SetReg('/', ["abc/\n"])
call SetReg('=', ['"abc/"'])
call SetReg('=', ["\"abc/\n\""])
$put ='{{{1 System clipboard'
+if has('clipboard')
" Save and restore system clipboard.
" If no connection to X-Server is possible, test should succeed.
-:let _clipreg = ['+', getreg('+'), getregtype('+')]
-:let _clipopt = &cb
-:let &cb='unnamedplus'
-:1y
-:AR +
-:tabdo :windo :echo "hi"
-:3y
-:AR +
-:let &cb=_clipopt
-:call call('setreg', _clipreg)
+let _clipreg = ['*', getreg('*'), getregtype('*')]
+let _clipopt = &cb
+let &cb='unnamed'
+5y
+AR *
+tabdo :windo :echo "hi"
+6y
+AR *
+let &cb=_clipopt
+call call('setreg', _clipreg)
+else
+ call AppendRegParts('*', 'V', "clipboard contents\n", "['clipboard contents']", "clipboard contents\n", "['clipboard contents']")
+ call AppendRegParts('*', 'V', "something else\n", "['something else']", "something else\n", "['something else']")
+endif
$put ='{{{1 Errors'
call ErrExe('call setreg()')
call ErrExe('call setreg(1)')
diff --git a/src/nvim/testdir/test_eval.ok b/src/nvim/testdir/test_eval.ok
index 2cdb8f5da8..cf7a5cd418 100644
--- a/src/nvim/testdir/test_eval.ok
+++ b/src/nvim/testdir/test_eval.ok
Binary files differ
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 3d26f643dc..b097ac4702 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -135,7 +135,7 @@ static int included_patches[] = {
// 861 NA
// 860,
// 859,
- // 858,
+ 858,
// 857,
// 856,
// 855 NA
@@ -311,7 +311,7 @@ static int included_patches[] = {
// 685,
// 684,
// 683 NA
- // 682,
+ 682,
// 681 NA
// 680,
// 679 NA
@@ -322,13 +322,13 @@ static int included_patches[] = {
// 674 NA
673,
// 672,
- // 671,
+ 671,
670,
// 669 NA
668,
667,
// 666 NA
- // 665,
+ 665,
// 664 NA
// 663 NA
// 662,
@@ -381,15 +381,15 @@ static int included_patches[] = {
615,
// 614,
// 613,
- // 612,
+ 612,
// 611 NA
// 610 NA
609,
- // 608,
+ 608,
// 607,
606,
// 605,
- // 604,
+ 604,
// 603,
602,
601,
diff --git a/test/functional/legacy/fixeol_spec.lua b/test/functional/legacy/fixeol_spec.lua
index 578178d707..2d1824c8cd 100644
--- a/test/functional/legacy/fixeol_spec.lua
+++ b/test/functional/legacy/fixeol_spec.lua
@@ -1,7 +1,7 @@
-- Tests for 'fixeol'
local helpers = require('test.functional.helpers')
-local feed, insert, source = helpers.feed, helpers.insert, helpers.source
+local feed = helpers.feed
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
describe('fixeol', function()
diff --git a/test/functional/shada/errors_spec.lua b/test/functional/shada/errors_spec.lua
index 62b9e6c84d..f6265bf24b 100644
--- a/test/functional/shada/errors_spec.lua
+++ b/test/functional/shada/errors_spec.lua
@@ -1,6 +1,7 @@
-- ShaDa errors handling support
local helpers = require('test.functional.helpers')
-local nvim_command, eq, exc_exec = helpers.command, helpers.eq, helpers.exc_exec
+local nvim_command, eq, exc_exec, redir_exec =
+ helpers.command, helpers.eq, helpers.exc_exec, helpers.redir_exec
local shada_helpers = require('test.functional.shada.helpers')
local reset, clear, get_shada_rw =
@@ -492,4 +493,21 @@ $
eq('Vim(wshada):E576: Error while reading ShaDa file: last entry specified that it occupies 47 bytes, but file ended earlier', exc_exec('wshada ' .. shada_fname))
eq(0, exc_exec('wshada! ' .. shada_fname))
end)
+
+ it('errors when a funcref is stored in a variable', function()
+ nvim_command('let F = function("tr")')
+ nvim_command('set shada+=!')
+ eq('\nE475: Invalid argument: attempt to dump function reference'
+ .. '\nE574: Failed to write variable F',
+ redir_exec('wshada'))
+ end)
+
+ it('errors when a self-referencing list is stored in a variable', function()
+ nvim_command('let L = []')
+ nvim_command('call add(L, L)')
+ nvim_command('set shada+=!')
+ eq('\nE475: Invalid argument: container references itself'
+ .. '\nE574: Failed to write variable L',
+ redir_exec('wshada'))
+ end)
end)
diff --git a/test/functional/shada/variables_spec.lua b/test/functional/shada/variables_spec.lua
index 6225971e5f..22054db353 100644
--- a/test/functional/shada/variables_spec.lua
+++ b/test/functional/shada/variables_spec.lua
@@ -1,7 +1,7 @@
-- ShaDa variables saving/reading support
local helpers = require('test.functional.helpers')
-local meths, funcs, nvim_command, eq =
- helpers.meths, helpers.funcs, helpers.command, helpers.eq
+local meths, funcs, nvim_command, eq, exc_exec =
+ helpers.meths, helpers.funcs, helpers.command, helpers.eq, helpers.exc_exec
local shada_helpers = require('test.functional.shada.helpers')
local reset, set_additional_cmd, clear =
@@ -136,4 +136,31 @@ describe('ShaDa support code', function()
eq({['\171']={{'\171'}, {['\171']='\171'}, {a='Test'}}},
meths.get_var('NESTEDVAR'))
end)
+
+ it('errors and writes when a funcref is stored in a variable',
+ function()
+ nvim_command('let F = function("tr")')
+ meths.set_var('U', '10')
+ nvim_command('set shada+=!')
+ set_additional_cmd('set shada+=!')
+ eq('Vim(wshada):E475: Invalid argument: attempt to dump function reference',
+ exc_exec('wshada'))
+ meths.set_option('shada', '')
+ reset()
+ eq('10', meths.get_var('U'))
+ end)
+
+ it('errors and writes when a self-referencing list is stored in a variable',
+ function()
+ meths.set_var('L', {})
+ nvim_command('call add(L, L)')
+ meths.set_var('U', '10')
+ nvim_command('set shada+=!')
+ eq('Vim(wshada):E475: Invalid argument: container references itself',
+ exc_exec('wshada'))
+ meths.set_option('shada', '')
+ set_additional_cmd('set shada+=!')
+ reset()
+ eq('10', meths.get_var('U'))
+ end)
end)