aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MAINTAIN.md6
-rw-r--r--packaging/logo.icobin3518 -> 15086 bytes
-rw-r--r--runtime/autoload/dist/ft.vim19
-rw-r--r--runtime/doc/api.txt25
-rw-r--r--runtime/doc/builtin.txt10
-rw-r--r--runtime/doc/eval.txt4
-rw-r--r--runtime/doc/filetype.txt6
-rw-r--r--runtime/doc/ft_sql.txt8
-rw-r--r--runtime/doc/insert.txt2
-rw-r--r--runtime/doc/intro.txt2
-rw-r--r--runtime/doc/options.txt108
-rw-r--r--runtime/doc/pi_netrw.txt2
-rw-r--r--runtime/doc/syntax.txt3
-rw-r--r--runtime/filetype.vim17
-rw-r--r--runtime/ftplugin/c.vim5
-rw-r--r--runtime/indent/ada.vim3
-rw-r--r--runtime/indent/awk.vim3
-rw-r--r--runtime/indent/cdl.vim4
-rw-r--r--runtime/indent/chaiscript.vim3
-rw-r--r--runtime/indent/cmake.vim4
-rw-r--r--runtime/indent/d.vim4
-rw-r--r--runtime/indent/dictconf.vim4
-rw-r--r--runtime/indent/dictdconf.vim2
-rw-r--r--runtime/indent/dylan.vim5
-rw-r--r--runtime/indent/falcon.vim3
-rw-r--r--runtime/indent/gitolite.vim4
-rw-r--r--runtime/indent/idlang.vim4
-rw-r--r--runtime/indent/make.vim4
-rw-r--r--runtime/indent/mma.vim3
-rw-r--r--runtime/indent/nginx.vim4
-rw-r--r--runtime/indent/objc.vim6
-rw-r--r--runtime/indent/occam.vim4
-rw-r--r--runtime/indent/postscr.vim6
-rw-r--r--runtime/indent/prolog.vim3
-rw-r--r--runtime/indent/sas.vim4
-rw-r--r--runtime/indent/sml.vim5
-rw-r--r--runtime/indent/systemverilog.vim3
-rw-r--r--runtime/lua/vim/filetype.lua5
-rw-r--r--runtime/optwin.vim2
-rw-r--r--runtime/syntax/dep3patch.vim4
-rw-r--r--runtime/syntax/lua.vim11
-rw-r--r--runtime/syntax/neomuttrc.vim365
-rw-r--r--runtime/syntax/sml.vim7
-rw-r--r--runtime/syntax/vim.vim8
-rwxr-xr-xscripts/bump-deps.sh104
-rw-r--r--scripts/bump_deps.lua343
-rw-r--r--src/nvim/api/autocmd.c16
-rw-r--r--src/nvim/autocmd.c160
-rw-r--r--src/nvim/buffer.c39
-rw-r--r--src/nvim/buffer.h7
-rw-r--r--src/nvim/change.c6
-rw-r--r--src/nvim/diff.c14
-rw-r--r--src/nvim/edit.c42
-rw-r--r--src/nvim/ex_cmds.c8
-rw-r--r--src/nvim/ex_docmd.c4
-rw-r--r--src/nvim/ex_docmd.h1
-rw-r--r--src/nvim/ex_getln.c2
-rw-r--r--src/nvim/fileio.c38
-rw-r--r--src/nvim/getchar.c39
-rw-r--r--src/nvim/globals.h2
-rw-r--r--src/nvim/memline.c159
-rw-r--r--src/nvim/memory.c2
-rw-r--r--src/nvim/option.c66
-rw-r--r--src/nvim/quickfix.c4
-rw-r--r--src/nvim/spell.c2
-rw-r--r--src/nvim/state.c5
-rw-r--r--src/nvim/syntax.c79
-rw-r--r--src/nvim/testdir/test_autocmd.vim34
-rw-r--r--src/nvim/testdir/test_diffmode.vim37
-rw-r--r--src/nvim/testdir/test_edit.vim23
-rw-r--r--src/nvim/testdir/test_filetype.vim53
-rw-r--r--src/nvim/testdir/test_highlight.vim8
-rw-r--r--src/nvim/testdir/test_ins_complete.vim19
-rw-r--r--src/nvim/testdir/test_registers.vim18
-rw-r--r--src/nvim/testdir/test_trycatch.vim27
-rw-r--r--src/nvim/window.c68
-rw-r--r--test/functional/api/autocmd_spec.lua48
-rw-r--r--test/functional/autocmd/show_spec.lua150
-rw-r--r--test/functional/editor/macro_spec.lua47
-rw-r--r--test/functional/editor/mode_insert_spec.lua24
-rw-r--r--test/functional/lua/buffer_updates_spec.lua9
-rw-r--r--test/functional/ui/diff_spec.lua127
-rw-r--r--test/functional/ui/highlight_spec.lua22
-rw-r--r--test/functional/ui/input_spec.lua8
-rw-r--r--test/unit/buffer_spec.lua42
-rw-r--r--third-party/CMakeLists.txt4
86 files changed, 1991 insertions, 623 deletions
diff --git a/MAINTAIN.md b/MAINTAIN.md
index 7df91b7d57..2b390270a9 100644
--- a/MAINTAIN.md
+++ b/MAINTAIN.md
@@ -76,6 +76,12 @@ These "bundled" dependencies can be updated by bumping their versions in `third-
- [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
- [tree-sitter](https://github.com/tree-sitter/tree-sitter)
+`scripts/bump-dep.sh` is a script that can automate this process for `LuaJIT`, `Luv`, `libuv` & `tree-sitter`. See usage guide:
+ - Run `./scripts/bump-deps.sh --dep Luv --version 1.43.0-0` to update a dependency.
+ See `./scripts/bump-deps.sh -h` for more detailed usage
+ - Run `./scripts/bump-deps.sh --pr` to create a pr
+ To generate the default PR title and body, the script uses the most recent commit (not in `master`) with prefix `build(deps): `
+
These dependencies are "vendored" (inlined), we need to update the sources manually:
- [libmpack](https://github.com/libmpack/libmpack)
- [xdiff](https://github.com/git/git/tree/master/xdiff)
diff --git a/packaging/logo.ico b/packaging/logo.ico
index a4523501b9..117ca1633a 100644
--- a/packaging/logo.ico
+++ b/packaging/logo.ico
Binary files differ
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index c52def1051..f473d5f80b 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -1,7 +1,7 @@
" Vim functions for file type detection
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2022 Mar 05
+" Last Change: 2022 Apr 06
" These functions are moved here from runtime/filetype.vim to make startup
" faster.
@@ -899,6 +899,23 @@ func dist#ft#FTtf()
setf tf
endfunc
+" Determine if a *.src file is Kuka Robot Language
+func dist#ft#FTsrc()
+ if exists("g:filetype_src")
+ exe "setf " .. g:filetype_src
+ elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|\%(global\s\+\)\?def\>\)'
+ setf krl
+ endif
+endfunc
+
+" Determine if a *.dat file is Kuka Robot Language
+func dist#ft#FTdat()
+ if exists("g:filetype_dat")
+ exe "setf " .. g:filetype_dat
+ elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|defdat\>\)'
+ setf krl
+ endif
+endfunc
" Restore 'cpoptions'
let &cpo = s:cpo_save
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index b383c5eaef..095f74b65d 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -3240,7 +3240,7 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()*
<
Parameters: ~
- {event} (String|Array) The event or events to register
+ {event} (string|array) The event or events to register
this autocommand
{opts} Dictionary of autocommand options:
• group (string|integer) optional: the
@@ -3252,9 +3252,26 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()*
Cannot be used with {pattern}.
• desc (string) optional: description of the
autocommand.
- • callback (function|string) optional: Lua
- function or Vim function (as string) to execute
- on event. Cannot be used with {command}
+ • callback (function|string) optional: if a
+ string, the name of a Vimscript function to
+ call when this autocommand is triggered.
+ Otherwise, a Lua function which is called when
+ this autocommand is triggered. Cannot be used
+ with {command}. Lua callbacks can return true
+ to delete the autocommand; in addition, they
+ accept a single table argument with the
+ following keys:
+ • id: (number) the autocommand id
+ • event: (string) the name of the event that
+ triggered the autocommand |autocmd-events|
+ • group: (number|nil) the autocommand group id,
+ if it exists
+ • match: (string) the expanded value of
+ |<amatch>|
+ • buf: (number) the expanded value of |<abuf>|
+ • file: (string) the expanded value of
+ |<afile>|
+
• command (string) optional: Vim command to
execute on event. Cannot be used with
{callback}
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 062f39f3e7..61010be4ef 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1517,8 +1517,10 @@ deepcopy({expr} [, {noref}]) *deepcopy()* *E698*
delete({fname} [, {flags}]) *delete()*
Without {flags} or with {flags} empty: Deletes the file by the
- name {fname}. This also works when {fname} is a symbolic link.
- A symbolic link itself is deleted, not what it points to.
+ name {fname}.
+
+ This also works when {fname} is a symbolic link. The symbolic
+ link itself is deleted, not what it points to.
When {flags} is "d": Deletes the directory by the name
{fname}. This fails when directory {fname} is not empty.
@@ -5376,8 +5378,10 @@ printf({fmt}, {expr1} ...) *printf()*
When used as a |method| the base is passed as the second
argument: >
Compute()->printf("result: %d")
+<
+ You can use `call()` to pass the items as a list.
-< Often used items are:
+ Often used items are:
%s string
%6S string right-aligned in 6 display cells
%6s string right-aligned in 6 bytes
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index ca2334500c..e3d4ef2085 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -196,7 +196,7 @@ position in the sequence.
List creation ~
*E696* *E697*
-A List is created with a comma separated list of items in square brackets.
+A List is created with a comma-separated list of items in square brackets.
Examples: >
:let mylist = [1, two, 3, "four"]
:let emptylist = []
@@ -446,7 +446,7 @@ ordering.
Dictionary creation ~
*E720* *E721* *E722* *E723*
-A Dictionary is created with a comma separated list of entries in curly
+A Dictionary is created with a comma-separated list of entries in curly
braces. Each entry has a key and a value, separated by a colon. Each key can
only appear once. Examples: >
:let mydict = {1: 'one', 2: 'two', 3: 'three'}
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index bd3acfcac7..357c5d1cec 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -140,6 +140,7 @@ variables can be used to overrule the filetype used for certain extensions:
*.asm g:asmsyntax |ft-asm-syntax|
*.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax|
*.bas g:filetype_bas |ft-basic-syntax|
+ *.dat g:filetype_dat
*.frm g:filetype_frm |ft-form-syntax|
*.fs g:filetype_fs |ft-forth-syntax|
*.i g:filetype_i |ft-progress-syntax|
@@ -149,10 +150,15 @@ variables can be used to overrule the filetype used for certain extensions:
*.pl g:filetype_pl
*.pp g:filetype_pp |ft-pascal-syntax|
*.prg g:filetype_prg
+ *.src g:filetype_src
*.sh g:bash_is_sh |ft-sh-syntax|
*.tex g:tex_flavor |ft-tex-plugin|
*.w g:filetype_w |ft-cweb-syntax|
+For a few filetypes the global variable is used only when the filetype could
+not be detected:
+ *.r g:filetype_r |ft-rexx-syntax|
+
*filetype-ignore*
To avoid that certain files are being inspected, the g:ft_ignore_pat variable
is used. The default value is set like this: >
diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt
index fccbbce17f..6972fe0768 100644
--- a/runtime/doc/ft_sql.txt
+++ b/runtime/doc/ft_sql.txt
@@ -555,7 +555,7 @@ the SQL completion plugin. >
< 1. After typing SELECT press <C-C>t to display a list of tables.
2. Highlight the table you need the column list for.
3. Press <Enter> to choose the table from the list.
- 4. Press <C-C>l to request a comma separated list of all columns
+ 4. Press <C-C>l to request a comma-separated list of all columns
for this table.
5. Based on the table name chosen in step 3, the plugin attempts to
decide on a reasonable table alias. You are then prompted to
@@ -609,7 +609,7 @@ your |init.vim|: >
>
omni_sql_use_tbl_alias
< - Default: a
- - This setting is only used when generating a comma separated
+ - This setting is only used when generating a comma-separated
column list. By default the map is <C-C>l. When generating
a column list, an alias can be prepended to the beginning of each
column, for example: e.emp_id, e.emp_name. This option has three
@@ -693,9 +693,9 @@ plugin. >
<C-C>c
< - Displays a list of columns for a specific table. >
<C-C>l
-< - Displays a comma separated list of columns for a specific table. >
+< - Displays a comma-separated list of columns for a specific table. >
<C-C>L
-< - Displays a comma separated list of columns for a specific table.
+< - Displays a comma-separated list of columns for a specific table.
This should only be used when the completion window is active. >
<Right>
< - Displays a list of columns for the table currently highlighted in
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 05bf0fe4ba..8cb0a05023 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -258,7 +258,7 @@ CTRL-] Trigger abbreviation, without inserting a character.
*i_backspacing*
The effect of the <BS>, CTRL-W, and CTRL-U depend on the 'backspace' option
-(unless 'revins' is set). This is a comma separated list of items:
+(unless 'revins' is set). This is a comma-separated list of items:
item action ~
indent allow backspacing over autoindent
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index 54999fa163..09739085a3 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -120,7 +120,7 @@ Vim would never have become what it is now, without the help of these people!
Daniel Elstner GTK+ 2 port
Eric Fischer Mac port, 'cindent', and other improvements
Benji Fisher Answering lots of user questions
- Bill Foster Athena GUI port
+ Bill Foster Athena GUI port (later removed)
Google Lets me work on Vim one day a week
Loic Grenie xvim (ideas for multi windows version)
Sven Guckes Vim promoter and previous WWW page maintainer
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 123577778f..8d353804a4 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -69,7 +69,7 @@ achieve special effects. These options come in three forms:
:se[t] {option}+={value} *:set+=*
Add the {value} to a number option, or append the
{value} to a string option. When the option is a
- comma separated list, a comma is added, unless the
+ comma-separated list, a comma is added, unless the
value was empty.
If the option is a list of flags, superfluous flags
are removed. When adding a flag that was already
@@ -79,7 +79,7 @@ achieve special effects. These options come in three forms:
:se[t] {option}^={value} *:set^=*
Multiply the {value} to a number option, or prepend
the {value} to a string option. When the option is a
- comma separated list, a comma is added, unless the
+ comma-separated list, a comma is added, unless the
value was empty.
Also see |:set-args| above.
@@ -87,7 +87,7 @@ achieve special effects. These options come in three forms:
Subtract the {value} from a number option, or remove
the {value} from a string option, if it is there.
If the {value} is not found in a string option, there
- is no error or warning. When the option is a comma
+ is no error or warning. When the option is a comma-
separated list, a comma is deleted, unless the option
becomes empty.
When the option is a list of flags, {value} must be
@@ -779,7 +779,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'backupcopy' 'bkc' string (Vi default for Unix: "yes", otherwise: "auto")
global or local to buffer |global-local|
When writing a file and a backup is made, this option tells how it's
- done. This is a comma separated list of words.
+ done. This is a comma-separated list of words.
The main values are:
"yes" make a copy of the file and overwrite the original one
@@ -803,10 +803,10 @@ A jump table for the options with a short description can be found at |Q_op|.
file.
- When the file is a link the new file will not be a link.
- The "auto" value is the middle way: When Vim sees that renaming file
- is possible without side effects (the attributes can be passed on and
- the file is not a link) that is used. When problems are expected, a
- copy will be made.
+ The "auto" value is the middle way: When Vim sees that renaming the
+ file is possible without side effects (the attributes can be passed on
+ and the file is not a link) that is used. When problems are expected,
+ a copy will be made.
The "breaksymlink" and "breakhardlink" values can be used in
combination with any of "yes", "no" and "auto". When included, they
@@ -825,13 +825,13 @@ A jump table for the options with a short description can be found at |Q_op|.
When a copy is made, the original file is truncated and then filled
with the new text. This means that protection bits, owner and
- symbolic links of the original file are unmodified. The backup file
+ symbolic links of the original file are unmodified. The backup file,
however, is a new file, owned by the user who edited the file. The
group of the backup is set to the group of the original file. If this
fails, the protection bits for the group are made the same as for
others.
- When the file is renamed this is the other way around: The backup has
+ When the file is renamed, this is the other way around: The backup has
the same attributes of the original file, and the newly written file
is owned by the current user. When the file was a (hard/symbolic)
link, the new file will not! That's why the "auto" value doesn't
@@ -893,7 +893,7 @@ A jump table for the options with a short description can be found at |Q_op|.
accidentally overwriting existing files with a backup file. You might
prefer using ".bak", but make sure that you don't have files with
".bak" that you want to keep.
- Only normal file name characters can be used, "/\*?[|<>" are illegal.
+ Only normal file name characters can be used; "/\*?[|<>" are illegal.
If you like to keep a lot of backups, you could use a BufWritePre
autocommand to change 'backupext' just before writing the file to
@@ -939,7 +939,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'belloff'* *'bo'*
'belloff' 'bo' string (default "all")
global
- Specifies for which events the bell will not be rung. It is a comma
+ Specifies for which events the bell will not be rung. It is a comma-
separated list of items. For each item that is present, the bell
will be silenced. This is most useful to specify specific events in
insert mode to be silenced.
@@ -1077,16 +1077,16 @@ A jump table for the options with a short description can be found at |Q_op|.
This option specifies what happens when a buffer is no longer
displayed in a window:
<empty> follow the global 'hidden' option
- hide hide the buffer (don't unload it), also when 'hidden'
- is not set
- unload unload the buffer, also when 'hidden' is set or using
- |:hide|
- delete delete the buffer from the buffer list, also when
- 'hidden' is set or using |:hide|, like using
- |:bdelete|
- wipe wipe out the buffer from the buffer list, also when
- 'hidden' is set or using |:hide|, like using
- |:bwipeout|
+ hide hide the buffer (don't unload it), even if 'hidden' is
+ not set
+ unload unload the buffer, even if 'hidden' is set; the
+ |:hide| command will also unload the buffer
+ delete delete the buffer from the buffer list, even if
+ 'hidden' is set; the |:hide| command will also delete
+ the buffer, making it behave like |:bdelete|
+ wipe wipe the buffer from the buffer list, even if
+ 'hidden' is set; the |:hide| command will also wipe
+ out the buffer, making it behave like |:bwipeout|
CAREFUL: when "unload", "delete" or "wipe" is used changes in a buffer
are lost without a warning. Also, these values may break autocommands
@@ -1340,7 +1340,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'colorcolumn'* *'cc'*
'colorcolumn' 'cc' string (default "")
local to window
- 'colorcolumn' is a comma separated list of screen columns that are
+ 'colorcolumn' is a comma-separated list of screen columns that are
highlighted with ColorColumn |hl-ColorColumn|. Useful to align
text. Will make screen redrawing slower.
The screen column can be an absolute number, or a number preceded with
@@ -1373,7 +1373,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'comments' 'com' string (default
"s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-")
local to buffer
- A comma separated list of strings that can start a comment line. See
+ A comma-separated list of strings that can start a comment line. See
|format-comments|. See |option-backslash| about using backslashes to
insert a space.
@@ -1390,7 +1390,7 @@ A jump table for the options with a short description can be found at |Q_op|.
This option specifies how keyword completion |ins-completion| works
when CTRL-P or CTRL-N are used. It is also used for whole-line
completion |i_CTRL-X_CTRL-L|. It indicates the type of completion
- and the places to scan. It is a comma separated list of flags:
+ and the places to scan. It is a comma-separated list of flags:
. scan the current buffer ('wrapscan' is ignored)
w scan buffers from other windows
b scan other loaded buffers that are in the buffer list
@@ -1447,7 +1447,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'completeopt'* *'cot'*
'completeopt' 'cot' string (default: "menu,preview")
global
- A comma separated list of options for Insert mode completion
+ A comma-separated list of options for Insert mode completion
|ins-completion|. The supported values are:
menu Use a popup menu to show the possible completions. The
@@ -1852,7 +1852,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'cursorlineopt'* *'culopt'*
'cursorlineopt' 'culopt' string (default: "number,line")
local to window
- Comma separated list of settings for how 'cursorline' is displayed.
+ Comma-separated list of settings for how 'cursorline' is displayed.
Valid values:
"line" Highlight the text line of the cursor with
CursorLine |hl-CursorLine|.
@@ -2117,7 +2117,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'display'* *'dy'*
'display' 'dy' string (default "lastline,msgsep", Vi default: "")
global
- Change the way text is displayed. This is comma separated list of
+ Change the way text is displayed. This is comma-separated list of
flags:
lastline When included, as much as possible of the last line
in a window will be displayed. "@@@" is put in the
@@ -2235,7 +2235,7 @@ A jump table for the options with a short description can be found at |Q_op|.
A list of autocommand event names, which are to be ignored.
When set to "all" or when "all" is one of the items, all autocommand
events are ignored, autocommands will not be executed.
- Otherwise this is a comma separated list of event names. Example: >
+ Otherwise this is a comma-separated list of event names. Example: >
:set ei=WinEnter,WinLeave
<
*'expandtab'* *'et'* *'noexpandtab'* *'noet'*
@@ -2447,7 +2447,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'fillchars' 'fcs' string (default "")
global or local to window |global-local|
Characters to fill the statuslines and vertical separators.
- It is a comma separated list of items:
+ It is a comma-separated list of items:
item default Used for ~
stl:c ' ' or '^' statusline of the current window
@@ -2628,7 +2628,7 @@ A jump table for the options with a short description can be found at |Q_op|.
search,tag,undo")
global
Specifies for which type of commands folds will be opened, if the
- command moves the cursor into a closed fold. It is a comma separated
+ command moves the cursor into a closed fold. It is a comma-separated
list of items.
NOTE: When the command is part of a mapping this option is not used.
Add the |zv| command to the mapping to get the same effect.
@@ -2819,7 +2819,7 @@ A jump table for the options with a short description can be found at |Q_op|.
\,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor
\,sm:block-blinkwait175-blinkoff150-blinkon175
-< The option is a comma separated list of parts. Each part consists of a
+< The option is a comma-separated list of parts. Each part consists of a
mode-list and an argument-list:
mode-list:argument-list,mode-list:argument-list,..
The mode-list is a dash separated list of these modes:
@@ -3119,7 +3119,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'helplang'* *'hlg'*
'helplang' 'hlg' string (default: messages language or empty)
global
- Comma separated list of languages. Vim will use the first language
+ Comma-separated list of languages. Vim will use the first language
for which the desired help can be found. The English help will always
be used as a last resort. You can add "en" to prefer English over
another language, but that will only find tags that exist in that
@@ -3139,10 +3139,14 @@ A jump table for the options with a short description can be found at |Q_op|.
when it is |abandon|ed. When on a buffer becomes hidden when it is
|abandon|ed. A buffer displayed in another window does not become
hidden, of course.
+
Commands that move through the buffer list sometimes hide a buffer
- although the 'hidden' option is off: when the buffer is modified,
- 'autowrite' is off or writing is not possible, and the '!' flag was
- used. See also |windows|.
+ although the 'hidden' option is off when these three are true:
+ - the buffer is modified
+ - 'autowrite' is off or writing is not possible
+ - the '!' flag was used
+ Also see |windows|.
+
To hide a specific buffer use the 'bufhidden' option.
'hidden' is set for one command with ":hide {command}" |:hide|.
@@ -3573,7 +3577,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'keymodel'* *'km'*
'keymodel' 'km' string (default "")
global
- List of comma separated words, which enable special things that keys
+ List of comma-separated words, which enable special things that keys
can do. These values can be used:
startsel Using a shifted special key starts selection (either
Select mode or Visual mode, depending on "key" being
@@ -3748,7 +3752,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'lispwords'* *'lw'*
'lispwords' 'lw' string (default is very long)
global or local to buffer |global-local|
- Comma separated list of words that influence the Lisp indenting.
+ Comma-separated list of words that influence the Lisp indenting.
|'lisp'|
*'list'* *'nolist'*
@@ -3773,7 +3777,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Vi default: "eol:$")
global or local to window |global-local|
Strings to use in 'list' mode and for the |:list| command. It is a
- comma separated list of string settings.
+ comma-separated list of string settings.
*lcs-eol*
eol:c Character to show at the end of each line. When
@@ -4230,7 +4234,7 @@ A jump table for the options with a short description can be found at |Q_op|.
m:no,ml:up-arrow,v:rightup-arrow")
global
This option tells Vim what the mouse pointer should look like in
- different modes. The option is a comma separated list of parts, much
+ different modes. The option is a comma-separated list of parts, much
like used for 'guicursor'. Each part consist of a mode/location-list
and an argument-list:
mode-list:shape,mode-list:shape,..
@@ -5101,7 +5105,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'selectmode'* *'slm'*
'selectmode' 'slm' string (default "")
global
- This is a comma separated list of words, which specifies when to start
+ This is a comma-separated list of words, which specifies when to start
Select mode instead of Visual mode, when a selection is started.
Possible values:
mouse when using the mouse
@@ -5116,7 +5120,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Vi default: "blank,buffers,curdir,folds,
help,options,tabpages,winsize")
global
- Changes the effect of the |:mksession| command. It is a comma
+ Changes the effect of the |:mksession| command. It is a comma-
separated list of words. Each word enables saving and restoring
something:
word save and restore ~
@@ -5160,7 +5164,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Vi default: "")
global
When non-empty, the shada file is read upon startup and written
- when exiting Vim (see |shada-file|). The string should be a comma
+ when exiting Vim (see |shada-file|). The string should be a comma-
separated list of parameters, each consisting of a single character
identifying the particular parameter, followed by a number or string
which specifies the value of that parameter. If a particular
@@ -5779,7 +5783,7 @@ A jump table for the options with a short description can be found at |Q_op|.
commands. It must end in ".{encoding}.add". You need to include the
path, otherwise the file is placed in the current directory.
*E765*
- It may also be a comma separated list of names. A count before the
+ It may also be a comma-separated list of names. A count before the
|zg| and |zw| commands can be used to access each. This allows using
a personal word list file and a project word list file.
When a word is added while this option is empty Vim will set it for
@@ -5799,7 +5803,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'spelllang'* *'spl'*
'spelllang' 'spl' string (default "en")
local to buffer
- A comma separated list of word list names. When the 'spell' option is
+ A comma-separated list of word list names. When the 'spell' option is
on spellchecking will be done for these languages. Example: >
set spelllang=en_us,nl,medical
< This means US English, Dutch and medical words are recognized. Words
@@ -5839,7 +5843,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'spelloptions'* *'spo'*
'spelloptions' 'spo' string (default "")
local to buffer
- A comma separated list of options for spell checking:
+ A comma-separated list of options for spell checking:
camel When a word is CamelCased, assume "Cased" is a
separate word: every upper-case character in a word
that comes after a lower case character indicates the
@@ -6159,7 +6163,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'suffixesadd'* *'sua'*
'suffixesadd' 'sua' string (default "")
local to buffer
- Comma separated list of suffixes, which are used when searching for a
+ Comma-separated list of suffixes, which are used when searching for a
file for the "gf", "[I", etc. commands. Example: >
:set suffixesadd=.java
<
@@ -6191,7 +6195,7 @@ A jump table for the options with a short description can be found at |Q_op|.
This option controls the behavior when switching between buffers.
Mostly for |quickfix| commands some values are also used for other
commands, as mentioned below.
- Possible values (comma separated list):
+ Possible values (comma-separated list):
useopen If included, jump to the first open window that
contains the specified buffer (if there is one).
Otherwise: Do not examine other windows.
@@ -6449,7 +6453,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'termpastefilter'* *'tpf'*
'termpastefilter' 'tpf' string (default: "BS,HT,ESC,DEL")
global
- A comma separated list of options for specifying control characters
+ A comma-separated list of options for specifying control characters
to be removed from the text pasted into the terminal window. The
supported values are:
@@ -6789,7 +6793,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'viewoptions'* *'vop'*
'viewoptions' 'vop' string (default: "folds,cursor,curdir")
global
- Changes the effect of the |:mkview| command. It is a comma separated
+ Changes the effect of the |:mkview| command. It is a comma-separated
list of words. Each word enables saving and restoring something:
word save and restore ~
cursor cursor position in file and in window
@@ -6805,7 +6809,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'virtualedit'* *'ve'*
'virtualedit' 've' string (default "")
global or local to window |global-local|
- A comma separated list of these words:
+ A comma-separated list of these words:
block Allow virtual editing in Visual block mode.
insert Allow virtual editing in Insert mode.
all Allow virtual editing in all modes.
@@ -6962,7 +6966,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'wildmode' 'wim' string (default: "full")
global
Completion mode that is used for the character specified with
- 'wildchar'. It is a comma separated list of up to four parts. Each
+ 'wildchar'. It is a comma-separated list of up to four parts. Each
part specifies what to do for each consecutive use of 'wildchar'. The
first part specifies the behavior for the first use of 'wildchar',
The second part for the second use, etc.
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index 8257152b11..2fe3d3d8e0 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -2814,7 +2814,7 @@ your browsing preferences. (see also: |netrw-settings|)
= 2: wide listing (multiple files in columns)
= 3: tree style listing
- *g:netrw_list_hide* comma separated pattern list for hiding files
+ *g:netrw_list_hide* comma-separated pattern list for hiding files
Patterns are regular expressions (see |regexp|)
There's some special support for git-ignore
files: you may add the output from the helper
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 2d239d9198..6875f43b86 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -4830,6 +4830,7 @@ in their own color.
:hi[ghlight] {group-name}
List one highlight group.
+ *highlight-clear* *:hi-clear*
:hi[ghlight] clear Reset all highlighting to the defaults. Removes all
highlighting for groups added by the user!
Uses the current value of 'background' to decide which
@@ -4889,7 +4890,7 @@ the same syntax file on all UIs.
*inverse* *italic* *standout*
*nocombine* *strikethrough*
cterm={attr-list} *attr-list* *highlight-cterm* *E418*
- attr-list is a comma separated list (without spaces) of the
+ attr-list is a comma-separated list (without spaces) of the
following items (in any order):
bold
underline
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 2f4b03606c..255414aca6 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: 2022 Jan 31
+" Last Change: 2022 Apr 07
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -947,6 +947,11 @@ au BufNewFile,BufRead *.jl setf julia
" Kixtart
au BufNewFile,BufRead *.kix setf kix
+" Kuka Robot Language
+au BufNewFile,BufRead *.src\c call dist#ft#FTsrc()
+au BufNewFile,BufRead *.dat\c call dist#ft#FTdat()
+au BufNewFile,BufRead *.sub\c setf krl
+
" Kimwitu[++]
au BufNewFile,BufRead *.k setf kwt
@@ -1343,9 +1348,10 @@ au BufNewFile,BufRead *.pm
au BufNewFile,BufRead *.pod setf pod
" Php, php3, php4, etc.
-" Also Phtml (was used for PHP 2 in the past)
-" Also .ctp for Cake template file
-au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp setf php
+" Also Phtml (was used for PHP 2 in the past).
+" Also .ctp for Cake template file.
+" Also .phpt for php tests.
+au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp,*.phpt setf php
" PHP config
au BufNewFile,BufRead php.ini-* setf dosini
@@ -2043,6 +2049,9 @@ au BufNewFile,BufRead *.vala setf vala
" Vera
au BufNewFile,BufRead *.vr,*.vri,*.vrh setf vera
+" Vagrant (uses Ruby syntax)
+au BufNewFile,BufRead Vagrantfile setf ruby
+
" Verilog HDL
au BufNewFile,BufRead *.v setf verilog
diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim
index d4564a4aec..cfaf26f66c 100644
--- a/runtime/ftplugin/c.vim
+++ b/runtime/ftplugin/c.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2021 Sep 21
+" Last Change: 2022 Apr 08
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -31,7 +31,8 @@ if exists('&ofu')
endif
" Set 'comments' to format dashed lists in comments.
-setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
+" Also include ///, used for Doxygen.
+ setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
" When the matchit plugin is loaded, this makes the % command skip parens and
" braces in comments properly.
diff --git a/runtime/indent/ada.vim b/runtime/indent/ada.vim
index 6c8ab05267..582d033b23 100644
--- a/runtime/indent/ada.vim
+++ b/runtime/indent/ada.vim
@@ -16,6 +16,7 @@
" 15.10.2006 MK Bram's suggestion for runtime integration
" 05.11.2006 MK Bram suggested to save on spaces
" 19.09.2007 NO g: missing before ada#Comment
+" 2022 April: b:undo_indent added by Doug Kearns
" Help Page: ft-vim-indent
"------------------------------------------------------------------------------
" ToDo:
@@ -35,6 +36,8 @@ setlocal indentexpr=GetAdaIndent()
setlocal indentkeys-=0{,0}
setlocal indentkeys+=0=~then,0=~end,0=~elsif,0=~when,0=~exception,0=~begin,0=~is,0=~record
+let b:undo_indent = "setl inde< indk<"
+
" Only define the functions once.
if exists("*GetAdaIndent")
finish
diff --git a/runtime/indent/awk.vim b/runtime/indent/awk.vim
index e65331977c..cf8132241c 100644
--- a/runtime/indent/awk.vim
+++ b/runtime/indent/awk.vim
@@ -24,6 +24,7 @@
" 29-04-2002 Fixed problems in function headers and max line width
" Added support for two-line if's without curly braces
" Fixed hang: 2011 Aug 31
+" 2022 April: b:undo_indent added by Doug Kearns
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -36,6 +37,8 @@ setlocal indentexpr=GetAwkIndent()
" Mmm, copied from the tcl indent program. Is this okay?
setlocal indentkeys-=:,0#
+let b:undo_indent = "setl inde< indk<"
+
" Only define the function once.
if exists("*GetAwkIndent")
finish
diff --git a/runtime/indent/cdl.vim b/runtime/indent/cdl.vim
index 0e3c6152b0..2c0fc7988e 100644
--- a/runtime/indent/cdl.vim
+++ b/runtime/indent/cdl.vim
@@ -1,7 +1,7 @@
" Description: Comshare Dimension Definition Language (CDL)
" Maintainer: Raul Segura Acevedo <raulseguraaceved@netscape.net> (Invalid email address)
" Doug Kearns <dougkearns@gmail.com>
-" Last Change: Fri Nov 30 13:35:48 2001 CST
+" Last Change: 2022 Apr 06
if exists("b:did_indent")
"finish
@@ -12,6 +12,8 @@ setlocal indentexpr=CdlGetIndent(v:lnum)
setlocal indentkeys&
setlocal indentkeys+==~else,=~endif,=~then,;,),=
+let b:undo_indent = "setl inde< indk<"
+
" Only define the function once.
if exists("*CdlGetIndent")
"finish
diff --git a/runtime/indent/chaiscript.vim b/runtime/indent/chaiscript.vim
index 445281cc46..b7a3fe5896 100644
--- a/runtime/indent/chaiscript.vim
+++ b/runtime/indent/chaiscript.vim
@@ -1,6 +1,7 @@
" Vim indent file
" Language: ChaiScript
" Maintainer: Jason Turner <lefticus 'at' gmail com>
+" Last Change: 2022 Apr 06
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -11,6 +12,8 @@ let b:did_indent = 1
setlocal indentexpr=GetChaiScriptIndent()
setlocal autoindent
+let b:undo_indent = "setl ai< inde<"
+
" Only define the function once.
if exists("*GetChaiScriptIndent")
finish
diff --git a/runtime/indent/cmake.vim b/runtime/indent/cmake.vim
index 845bdd7655..af27c0d49b 100644
--- a/runtime/indent/cmake.vim
+++ b/runtime/indent/cmake.vim
@@ -3,7 +3,7 @@
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>
" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
-" Last Change: 2017 Sep 24
+" Last Change: 2022 Apr 06
"
" Licence: The CMake license applies to this file. See
" https://cmake.org/licensing
@@ -17,6 +17,8 @@ let b:did_indent = 1
setlocal indentexpr=CMakeGetIndent(v:lnum)
setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE(
+let b:undo_indent = "setl inde< indk<"
+
" Only define the function once.
if exists("*CMakeGetIndent")
finish
diff --git a/runtime/indent/d.vim b/runtime/indent/d.vim
index 57f9125890..80c9a2f559 100644
--- a/runtime/indent/d.vim
+++ b/runtime/indent/d.vim
@@ -2,7 +2,7 @@
" Language: D
" Maintainer: Jason Mills <jmills@cs.mun.ca> (Invalid email address)
" Doug Kearns <dougkearns@gmail.com>
-" Last Change: 2005 Nov 22
+" Last Change: 2022 Apr 06
" Version: 0.1
"
" Please email me with bugs, comments, and suggestion. Put vim in the subject
@@ -19,4 +19,6 @@ let b:did_indent = 1
" D indenting is a lot like the built-in C indenting.
setlocal cindent
+let b:undo_indent = "setl cin<"
+
" vim: ts=8 noet
diff --git a/runtime/indent/dictconf.vim b/runtime/indent/dictconf.vim
index 2e15c76146..fa40585a92 100644
--- a/runtime/indent/dictconf.vim
+++ b/runtime/indent/dictconf.vim
@@ -1,7 +1,7 @@
" Vim indent file
" Language: dict(1) configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2006-12-20
+" Last Change: 2022 Apr 06
if exists("b:did_indent")
finish
@@ -11,3 +11,5 @@ let b:did_indent = 1
setlocal indentkeys=0{,0},!^F,o,O cinwords= autoindent smartindent
setlocal nosmartindent
inoremap <buffer> # X#
+
+let b:undo_indent = "setl ai< cinw< indk< si< | silent! iunmap <buffer> #"
diff --git a/runtime/indent/dictdconf.vim b/runtime/indent/dictdconf.vim
index 5c4fbdafb5..5c0e7c566c 100644
--- a/runtime/indent/dictdconf.vim
+++ b/runtime/indent/dictdconf.vim
@@ -11,3 +11,5 @@ let b:did_indent = 1
setlocal indentkeys=0{,0},!^F,o,O cinwords= autoindent smartindent
setlocal nosmartindent
inoremap <buffer> # X#
+
+let b:undo_indent = "setl ai< cinw< indk< si< | silent! iunmap <buffer> #"
diff --git a/runtime/indent/dylan.vim b/runtime/indent/dylan.vim
index 55255ddfa9..e2a6d1039c 100644
--- a/runtime/indent/dylan.vim
+++ b/runtime/indent/dylan.vim
@@ -3,7 +3,7 @@
" Maintainer: Brent A. Fulgham <bfulgham@debian.org> (Invalid email address)
" Doug Kearns <dougkearns@gmail.com>
" Version: 0.01
-" Last Change: 2017 Jun 13
+" Last Change: 2022 Apr 06
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -15,6 +15,9 @@ setlocal indentkeys+==~begin,=~block,=~case,=~cleanup,=~define,=~end,=~else,=~el
" Define the appropriate indent function but only once
setlocal indentexpr=DylanGetIndent()
+
+let b:undo_indent = "setl inde< indk<"
+
if exists("*DylanGetIndent")
finish
endif
diff --git a/runtime/indent/falcon.vim b/runtime/indent/falcon.vim
index 664ad61aa5..a58ccad870 100644
--- a/runtime/indent/falcon.vim
+++ b/runtime/indent/falcon.vim
@@ -3,6 +3,7 @@
" Maintainer: Steven Oliver <oliver.steven@gmail.com>
" Website: https://steveno@github.com/steveno/falconpl-vim.git
" Credits: This is, to a great extent, a copy n' paste of ruby.vim.
+" 2022 April: b:undo_indent added by Doug Kearns
" 1. Setup {{{1
" ============
@@ -20,6 +21,8 @@ setlocal indentexpr=FalconGetIndent(v:lnum)
setlocal indentkeys=0{,0},0),0],!^F,o,O,e
setlocal indentkeys+==~case,=~catch,=~default,=~elif,=~else,=~end,=~\"
+let b:undo_indent = "setl inde< indk< si<"
+
" Define the appropriate indent function but only once
if exists("*FalconGetIndent")
finish
diff --git a/runtime/indent/gitolite.vim b/runtime/indent/gitolite.vim
index b36f30a494..22be6872cb 100644
--- a/runtime/indent/gitolite.vim
+++ b/runtime/indent/gitolite.vim
@@ -4,7 +4,7 @@
" (https://raw.githubusercontent.com/sitaramc/gitolite/master/contrib/vim/indent/gitolite.vim)
" Maintainer: Sitaram Chamarty <sitaramc@gmail.com>
" (former Maintainer: Teemu Matilainen <teemu.matilainen@iki.fi>)
-" Last Change: 2017 Oct 05
+" Last Change: 2022 Apr 06
if exists("b:did_indent")
finish
@@ -15,6 +15,8 @@ setlocal autoindent
setlocal indentexpr=GetGitoliteIndent()
setlocal indentkeys=o,O,*<Return>,!^F,=repo,\",=
+let b:undo_indent = "setl ai< inde< indk<"
+
" Only define the function once.
if exists("*GetGitoliteIndent")
finish
diff --git a/runtime/indent/idlang.vim b/runtime/indent/idlang.vim
index e6a1d73775..1519865ab5 100644
--- a/runtime/indent/idlang.vim
+++ b/runtime/indent/idlang.vim
@@ -2,7 +2,7 @@
" Language: IDL (ft=idlang)
" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com> (Invalid email address)
" Doug Kearns <dougkearns@gmail.com>
-" Last change: 2017 Jun 13
+" Last change: 2022 Apr 06
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -14,6 +14,8 @@ setlocal indentkeys=o,O,0=endif,0=ENDIF,0=endelse,0=ENDELSE,0=endwhile,0=ENDWHIL
setlocal indentexpr=GetIdlangIndent(v:lnum)
+let b:undo_indent = "setl inde< indk<"
+
" Only define the function once.
if exists("*GetIdlangIndent")
finish
diff --git a/runtime/indent/make.vim b/runtime/indent/make.vim
index 76c8f83399..4d1838b3aa 100644
--- a/runtime/indent/make.vim
+++ b/runtime/indent/make.vim
@@ -2,7 +2,7 @@
" Language: Makefile
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Last Change: 24 Sep 2021
+" Last Change: 2022 Apr 06
if exists("b:did_indent")
finish
@@ -13,7 +13,7 @@ setlocal indentexpr=GetMakeIndent()
setlocal indentkeys=!^F,o,O,<:>,=else,=endif
setlocal nosmartindent
-let b:undo_indent = "setl ai< inde< indk<"
+let b:undo_indent = "setl inde< indk< si<"
if exists("*GetMakeIndent")
finish
diff --git a/runtime/indent/mma.vim b/runtime/indent/mma.vim
index ebf98b9a38..9dbfd74d66 100644
--- a/runtime/indent/mma.vim
+++ b/runtime/indent/mma.vim
@@ -3,6 +3,7 @@
" Maintainer: Steve Layland <layland@wolfram.com> (Invalid email address)
" Doug Kearns <dougkearns@gmail.com>
" Last Change: Sat May 10 18:56:22 CDT 2005
+" 2022 April: b:undo_indent added by Doug Kearns
" Source: http://vim.sourceforge.net/scripts/script.php?script_id=1274
" http://members.wolfram.com/layland/vim/indent/mma.vim
"
@@ -26,6 +27,8 @@ setlocal indentexpr=GetMmaIndent()
setlocal indentkeys+=0[,0],0(,0)
setlocal nosi "turn off smart indent so we don't over analyze } blocks
+let b:undo_indent = "setl inde< indk< si<"
+
if exists("*GetMmaIndent")
finish
endif
diff --git a/runtime/indent/nginx.vim b/runtime/indent/nginx.vim
index d4afec1c11..8cef7662e0 100644
--- a/runtime/indent/nginx.vim
+++ b/runtime/indent/nginx.vim
@@ -1,7 +1,7 @@
" Vim indent file
" Language: nginx.conf
" Maintainer: Chris Aumann <me@chr4.org>
-" Last Change: Apr 15, 2017
+" Last Change: 2022 Apr 06
if exists("b:did_indent")
finish
@@ -15,3 +15,5 @@ setlocal cindent
" Just make sure that the comments are not reset as defs would be.
setlocal cinkeys-=0#
+
+let b:undo_indent = "setl inde< cin< cink<"
diff --git a/runtime/indent/objc.vim b/runtime/indent/objc.vim
index a5451a5a11..1d107050dd 100644
--- a/runtime/indent/objc.vim
+++ b/runtime/indent/objc.vim
@@ -1,9 +1,7 @@
" Vim indent file
" Language: Objective-C
" Maintainer: Kazunobu Kuriyama <kazunobu.kuriyama@nifty.com>
-" Last Change: 2004 May 16
-"
-
+" Last Change: 2022 Apr 06
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -19,6 +17,8 @@ setlocal indentexpr=GetObjCIndent()
setlocal indentkeys-=:
setlocal indentkeys+=<:>
+let b:undo_indent = "setl cin< inde< indk<"
+
" Only define the function once.
if exists("*GetObjCIndent")
finish
diff --git a/runtime/indent/occam.vim b/runtime/indent/occam.vim
index 2979ac16ac..673940a7ec 100644
--- a/runtime/indent/occam.vim
+++ b/runtime/indent/occam.vim
@@ -2,7 +2,7 @@
" Language: occam
" Maintainer: Mario Schweigler <ms44@kent.ac.uk> (Invalid email address)
" Doug Kearns <dougkearns@gmail.com>
-" Last Change: 23 April 2003
+" Last Change: 2022 Apr 06
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -17,6 +17,8 @@ setlocal indentexpr=GetOccamIndent()
setlocal indentkeys=o,O,0=:
"}}}
+let b:undo_indent = "setl inde< indk<"
+
" Only define the function once
if exists("*GetOccamIndent")
finish
diff --git a/runtime/indent/postscr.vim b/runtime/indent/postscr.vim
index 0691cd237c..66094e3ed0 100644
--- a/runtime/indent/postscr.vim
+++ b/runtime/indent/postscr.vim
@@ -2,8 +2,8 @@
" Language: PostScript
" Maintainer: Mike Williams <mrw@netcomuk.co.uk> (Invalid email address)
" Doug Kearns <dougkearns@gmail.com>
-" Last Change: 2nd July 2001
-"
+" Last Change: 2022 Apr 06
+
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -14,6 +14,8 @@ let b:did_indent = 1
setlocal indentexpr=PostscrIndentGet(v:lnum)
setlocal indentkeys+=0],0=>>,0=%%,0=end,0=restore,0=grestore indentkeys-=:,0#,e
+let b:undo_indent = "setl inde< indk<"
+
" Catch multiple instantiations
if exists("*PostscrIndentGet")
finish
diff --git a/runtime/indent/prolog.vim b/runtime/indent/prolog.vim
index ac03c28064..0c4fd541f9 100644
--- a/runtime/indent/prolog.vim
+++ b/runtime/indent/prolog.vim
@@ -4,6 +4,7 @@
" Doug Kearns <dougkearns@gmail.com>
" Revised on: 2002.02.18. 23:34:05
" Last change by: Takuya Fujiwara, 2018 Sep 23
+" 2022 April: b:undo_indent added by Doug Kearns
" TODO:
" checking with respect to syntax highlighting
@@ -21,6 +22,8 @@ setlocal indentexpr=GetPrologIndent()
setlocal indentkeys-=:,0#
setlocal indentkeys+=0%,-,0;,>,0)
+let b:undo_indent = "setl inde< indk<"
+
" Only define the function once.
"if exists("*GetPrologIndent")
" finish
diff --git a/runtime/indent/sas.vim b/runtime/indent/sas.vim
index 9cc9e025c4..bbbbbf02eb 100644
--- a/runtime/indent/sas.vim
+++ b/runtime/indent/sas.vim
@@ -2,7 +2,7 @@
" Language: SAS
" Maintainer: Zhen-Huan Hu <wildkeny@gmail.com>
" Version: 3.0.3
-" Last Change: Jun 26, 2018
+" Last Change: 2022 Apr 06
if exists("b:did_indent")
finish
@@ -12,6 +12,8 @@ let b:did_indent = 1
setlocal indentexpr=GetSASIndent()
setlocal indentkeys+=;,=~data,=~proc,=~macro
+let b:undo_indent = "setl inde< indk<"
+
if exists("*GetSASIndent")
finish
endif
diff --git a/runtime/indent/sml.vim b/runtime/indent/sml.vim
index e760a8e350..a0b0c3e911 100644
--- a/runtime/indent/sml.vim
+++ b/runtime/indent/sml.vim
@@ -7,10 +7,11 @@
" Mike Leary <leary@nwlink.com>
" Markus Mottl <markus@oefai.at>
" OCaml URL: http://www.oefai.at/~markus/vim/indent/ocaml.vim
-" Last Change: 2003 Jan 04 - Adapted to SML
+" Last Change: 2022 Apr 06
" 2002 Nov 06 - Some fixes (JY)
" 2002 Oct 28 - Fixed bug with indentation of ']' (MM)
" 2002 Oct 22 - Major rewrite (JY)
+" 2022 April: b:undo_indent added by Doug Kearns
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -26,6 +27,8 @@ setlocal nosmartindent
setlocal textwidth=80
setlocal shiftwidth=2
+let b:undo_indent = "setl et< inde< indk< lisp< si< sw< tw<"
+
" Comment formatting
if (has("comments"))
set comments=sr:(*,mb:*,ex:*)
diff --git a/runtime/indent/systemverilog.vim b/runtime/indent/systemverilog.vim
index 16fb4515c5..f6114dc1fd 100644
--- a/runtime/indent/systemverilog.vim
+++ b/runtime/indent/systemverilog.vim
@@ -2,6 +2,7 @@
" Language: SystemVerilog
" Maintainer: kocha <kocha.lsifrontend@gmail.com>
" Last Change: 05-Feb-2017 by Bilal Wasim
+" 2022 April: b:undo_indent added by Doug Kearns
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -16,6 +17,8 @@ setlocal indentkeys+==endclass,=endpackage,=endsequence,=endclocking
setlocal indentkeys+==endinterface,=endgroup,=endprogram,=endproperty,=endchecker
setlocal indentkeys+==`else,=`endif
+let b:undo_indent = "setl inde< indk<"
+
" Only define the function once.
if exists("*SystemVerilogIndent")
finish
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index 65edaed530..7958de97b1 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -457,6 +457,7 @@ local extension = {
al = "perl",
ctp = "php",
php = "php",
+ phpt = "php",
phtml = "php",
pike = "pike",
pmod = "pike",
@@ -1060,6 +1061,7 @@ local filename = {
Puppetfile = "ruby",
[".irbrc"] = "ruby",
irbrc = "ruby",
+ Vagrantfile = "ruby",
["smb.conf"] = "samba",
screenrc = "screen",
[".screenrc"] = "screen",
@@ -1427,6 +1429,9 @@ local pattern = {
return "git"
end
end,
+ [".*%.[Dd][Aa][Tt]"] = function() vim.fn["dist#ft#FTdat"]() end,
+ [".*%.[Ss][Rr][Cc]"] = function() vim.fn["dist#ft#FTsrc"]() end,
+ [".*%.[Ss][Uu][Bb]"] = "krl",
-- Neovim only
[".*/queries/.*%.scm"] = "query", -- tree-sitter queries
-- END PATTERN
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index 0e3f2d935e..a13e945098 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2021 Dec 12
+" Last Change: 2022 Apr 07
" If there already is an option window, jump to that one.
let buf = bufnr('option-window')
diff --git a/runtime/syntax/dep3patch.vim b/runtime/syntax/dep3patch.vim
index 8b2cee629c..cb0eda8931 100644
--- a/runtime/syntax/dep3patch.vim
+++ b/runtime/syntax/dep3patch.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Debian DEP3 Patch headers
" Maintainer: Gabriel Filion <gabster@lelutin.ca>
-" Last Change: 2021-01-09
+" Last Change: 2022 Apr 06
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/dep3patch.vim
"
" Specification of the DEP3 patch header format is available at:
@@ -28,7 +28,7 @@ syn region dep3patchMultiField matchgroup=dep3patchKey start="^Bug\%(-[[:graph:]
syn region dep3patchMultiField matchgroup=dep3patchKey start="^Forwarded\ze: *" end="$" contained contains=dep3patchHTTPUrl,dep3patchForwardedShort oneline keepend
syn region dep3patchMultiField matchgroup=dep3patchKey start="^\%(Author\|From\)\ze: *" end="$" contained contains=dep3patchEmail oneline keepend
syn region dep3patchMultiField matchgroup=dep3patchKey start="^\%(Reviewed-by\|Acked-by\)\ze: *" end="$" contained contains=dep3patchEmail oneline keepend
-syn region dep3patchMultiField matchgroup=dep3patchKey start="^Last-Updated\ze: *" end="$" contained contains=dep3patchISODate oneline keepend
+syn region dep3patchMultiField matchgroup=dep3patchKey start="^Last-Update\ze: *" end="$" contained contains=dep3patchISODate oneline keepend
syn region dep3patchMultiField matchgroup=dep3patchKey start="^Applied-Upstream\ze: *" end="$" contained contains=dep3patchHTTPUrl,dep3patchCommitID oneline keepend
syn match dep3patchHTTPUrl contained "\vhttps?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$"
diff --git a/runtime/syntax/lua.vim b/runtime/syntax/lua.vim
index f313c14e7a..b398e2e5c6 100644
--- a/runtime/syntax/lua.vim
+++ b/runtime/syntax/lua.vim
@@ -2,7 +2,7 @@
" Language: Lua 4.0, Lua 5.0, Lua 5.1 and Lua 5.2
" Maintainer: Marcus Aurelius Farias <masserahguard-lua 'at' yahoo com>
" First Author: Carlos Augusto Teixeira Mendes <cmendes 'at' inf puc-rio br>
-" Last Change: 2012 Aug 12
+" Last Change: 2022 Mar 31
" Options: lua_version = 4 or 5
" lua_subversion = 0 (4.0, 5.0) or 1 (5.1) or 2 (5.2)
" default 5.2
@@ -319,6 +319,15 @@ elseif lua_version == 5
syn match luaFunc /\<debug\.upvalueid\>/
syn match luaFunc /\<debug\.upvaluejoin\>/
endif
+ if lua_subversion >= 3
+ "https://www.lua.org/manual/5.3/manual.html#6.5
+ syn match luaFunc /\<utf8\.char\>/
+ syn match luaFunc /\<utf8\.charpattern\>/
+ syn match luaFunc /\<utf8\.codes\>/
+ syn match luaFunc /\<utf8\.codepoint\>/
+ syn match luaFunc /\<utf8\.len\>/
+ syn match luaFunc /\<utf8\.offset\>/
+ endif
endif
" Define the default highlighting.
diff --git a/runtime/syntax/neomuttrc.vim b/runtime/syntax/neomuttrc.vim
index bd73de49ea..421b11ffa3 100644
--- a/runtime/syntax/neomuttrc.vim
+++ b/runtime/syntax/neomuttrc.vim
@@ -2,10 +2,10 @@
" Language: NeoMutt setup files
" Maintainer: Richard Russon <rich@flatcap.org>
" Previous Maintainer: Guillaume Brogi <gui-gui@netcourrier.com>
-" Last Change: 2020-06-21
+" Last Change: 2022-04-08
" Original version based on syntax/muttrc.vim
-" This file covers NeoMutt 2020-06-19
+" This file covers NeoMutt 2022-04-08
" quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -115,6 +115,8 @@ syntax region muttrcIndexFormatStr contained skipwhite keepend start=+"+ sk
syntax region muttrcIndexFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
syntax region muttrcMixFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
syntax region muttrcMixFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
+syntax region muttrcPatternFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPatternFormatEscapes,muttrcPatternFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
+syntax region muttrcPatternFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPatternFormatEscapes,muttrcPatternFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
syntax region muttrcPGPCmdFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
syntax region muttrcPGPCmdFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
syntax region muttrcPGPFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
@@ -144,35 +146,37 @@ function! s:escapesConditionals(baseName, sequence, padding, conditional)
endif
endfunction
-" CHECKED 2020-06-21
-" Ref: alias_format_str() in alias/dlgalias.c
+" CHECKED 2022-04-08
+" Ref: alias_format_str() in alias/dlg_alias.c
call s:escapesConditionals('AliasFormat', '[acfnrt]', 1, 0)
-" Ref: attach_format_str() in recvattach.c
+" Ref: attach_format_str() in attach/dlg_attach.c
call s:escapesConditionals('AttachFormat', '[CcDdeFfIMmnQsTtuX]', 1, 1)
-" Ref: compose_format_str() in compose.c
+" Ref: compose_format_str() in compose/cbar.c
call s:escapesConditionals('ComposeFormat', '[ahlv]', 1, 1)
-" Ref: folder_format_str() in browser.c
+" Ref: folder_format_str() in browser/browser.c
call s:escapesConditionals('FolderFormat', '[CDdFfgilmNnstu]', 1, 0)
-" Ref: group_index_format_str() in browser.c
+" Ref: group_index_format_str() in nntp/browse.c
call s:escapesConditionals('GroupIndexFormat', '[CdfMNns]', 1, 1)
" Ref: index_format_str() in hdrline.c
call s:escapesConditionals('IndexFormat', '[AaBbCDdEefgHIiJKLlMmNnOPqRrSsTtuvWXxYyZ(<[{]\|@\i\+@\|G[a-zA-Z]\+\|Fp\=\|z[cst]\|cr\=', 1, 1)
" Ref: mix_format_str() in remailer.c
call s:escapesConditionals('MixFormat', '[acns]', 1, 0)
+" Ref: pattern_format_str() in pattern/dlg_pattern.c
+call s:escapesConditionals('PatternFormat', '[den]', 1, 0)
" Ref: pgp_command_format_str() in ncrypt/pgpinvoke.c
call s:escapesConditionals('PGPCmdFormat', '[afprs]', 0, 1)
-" Ref: crypt_format_str() in ncrypt/crypt_gpgme.c
-" Ref: pgp_entry_format_str() in ncrypt/pgpkey.c
+" Ref: crypt_format_str() in ncrypt/dlg_gpgme.c
+" Ref: pgp_entry_format_str() in ncrypt/dlg_pgp.c
" Note: crypt_format_str() supports 'p', but pgp_entry_fmt() does not
call s:escapesConditionals('PGPFormat', '[AaCcFfKkLlnptu[]', 0, 0)
-" Ref: query_format_str() in alias/dlgquery.c
+" Ref: query_format_str() in alias/dlg_query.c
call s:escapesConditionals('QueryFormat', '[acent]', 1, 1)
-" Ref: sidebar_format_str() in sidebar.c
+" Ref: sidebar_format_str() in sidebar/window.c
call s:escapesConditionals('SidebarFormat', '[!BDdFLNnorStZ]', 1, 1)
" Ref: smime_command_format_str() in ncrypt/smime.c
call s:escapesConditionals('SmimeFormat', '[aCcdfiks]', 0, 1)
" Ref: status_format_str() in status.c
-call s:escapesConditionals('StatusFormat', '[bDdFfhLlMmnoPpRrSstuVv]', 1, 1)
+call s:escapesConditionals('StatusFormat', '[bDdFfhLlMmnoPpRrSsTtuVv]', 1, 1)
syntax region muttrcPGPTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes
syntax region muttrcTimeEscapes contained start=+%(+ end=+)+ contains=muttrcStrftimeEscapes
@@ -187,6 +191,7 @@ syntax match muttrcVarEqualsFolderFmt contained skipwhite "=" nextgroup=mutt
syntax match muttrcVarEqualsGrpIdxFmt contained skipwhite "=" nextgroup=muttrcGroupIndexFormatStr
syntax match muttrcVarEqualsIdxFmt contained skipwhite "=" nextgroup=muttrcIndexFormatStr
syntax match muttrcVarEqualsMixFmt contained skipwhite "=" nextgroup=muttrcMixFormatStr
+syntax match muttrcVarEqualsPatternFmt contained skipwhite "=" nextgroup=muttrcPatternFormatStr
syntax match muttrcVarEqualsPGPCmdFmt contained skipwhite "=" nextgroup=muttrcPGPCmdFormatStr
syntax match muttrcVarEqualsPGPFmt contained skipwhite "=" nextgroup=muttrcPGPFormatStr
syntax match muttrcVarEqualsQueryFmt contained skipwhite "=" nextgroup=muttrcQueryFormatStr
@@ -197,9 +202,9 @@ syntax match muttrcVarEqualsStrftimeFmt contained skipwhite "=" nextgroup=mutt
syntax match muttrcVPrefix contained /[?&]/ nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
-" CHECKED 2020-06-21
-" List of the different screens in mutt (see Menus in keymap.c)
-syntax keyword muttrcMenu contained alias attach browser compose editor generic index key_select_pgp key_select_smime mix pager pgp postpone query smime
+" CHECKED 2022-04-08
+" List of the different screens in NeoMutt (see MenuNames in menu/type.c)
+syntax keyword muttrcMenu contained alias attach autocrypt browser compose editor generic index key_select_pgp key_select_smime mix pager pgp postpone query smime
syntax match muttrcMenuList "\S\+" contained contains=muttrcMenu
syntax match muttrcMenuCommas /,/ contained
@@ -234,12 +239,12 @@ syntax match muttrcEscapedVariable contained "\\\$[a-zA-Z_-]\+"
syntax match muttrcBadAction contained "[^<>]\+" contains=muttrcEmail
syntax match muttrcAction contained "<[^>]\{-}>" contains=muttrcBadAction,muttrcFunction,muttrcKeyName
-" CHECKED 2020-06-21
-" First, functions that take regular expressions:
+" CHECKED 2022-04-08
+" First, hooks that take regular expressions:
syntax match muttrcRXHookNot contained /!\s*/ skipwhite nextgroup=muttrcRXHookString,muttrcRXHookStringNL
syntax match muttrcRXHooks /\<\%(account\|append\|close\|crypt\|folder\|mbox\|open\|pgp\)-hook\>/ skipwhite nextgroup=muttrcRXHookNot,muttrcRXHookString,muttrcRXHookStringNL
-" Now, functions that take patterns
+" Now, hooks that take patterns
syntax match muttrcPatHookNot contained /!\s*/ skipwhite nextgroup=muttrcPattern
syntax match muttrcPatHooks /\<\%(charset\|iconv\|index-format\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcPattern
syntax match muttrcPatHooks /\<\%(message\|reply\|send\|send2\|save\|fcc\|fcc-save\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcOptPattern
@@ -295,10 +300,10 @@ syntax match muttrcAliasNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrc
syntax match muttrcUnAliasKey contained "\s*\w\+\s*" skipwhite nextgroup=muttrcUnAliasKey,muttrcUnAliasNL
syntax match muttrcUnAliasNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcUnAliasKey,muttrcUnAliasNL
-" CHECKED 2020-06-21
-" List of letters in Flags in pattern.c
+" CHECKED 2022-04-08
+" List of letters in Flags in pattern/flags.c
" Parameter: none
-syntax match muttrcSimplePat contained "!\?\^\?[~][ADEFGgklNOPpQRSTuUvV#$=]"
+syntax match muttrcSimplePat contained "!\?\^\?[~][ADEFGgklNOPpQRSTUuVv#$=]"
" Parameter: range
syntax match muttrcSimplePat contained "!\?\^\?[~][mnXz]\s*\%([<>-][0-9]\+[kM]\?\|[0-9]\+[kM]\?[-]\%([0-9]\+[kM]\?\)\?\)"
" Parameter: date
@@ -306,7 +311,7 @@ syntax match muttrcSimplePat contained "!\?\^\?[~][dr]\s*\%(\%(-\?[0-9]\{1,2}\%(
" Parameter: regex
syntax match muttrcSimplePat contained "!\?\^\?[~][BbCcefHhIiLMstwxYy]\s*" nextgroup=muttrcSimplePatRXContainer
" Parameter: pattern
-syntax match muttrcSimplePat contained "!\?\^\?[%][bBcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatString
+syntax match muttrcSimplePat contained "!\?\^\?[%][BbCcefHhiLstxy]\s*" nextgroup=muttrcSimplePatString
" Parameter: pattern
syntax match muttrcSimplePat contained "!\?\^\?[=][bcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatString
syntax region muttrcSimplePat contained keepend start=+!\?\^\?[~](+ end=+)+ contains=muttrcSimplePat
@@ -369,8 +374,8 @@ syntax keyword muttrcMonoAttrib contained bold none normal reverse standout unde
syntax keyword muttrcMono contained mono skipwhite nextgroup=muttrcColorField,muttrcColorCompose
syntax match muttrcMonoLine "^\s*mono\s\+\S\+" skipwhite nextgroup=muttrcMonoAttrib contains=muttrcMono
-" CHECKED 2020-06-21
-" List of fields in Fields in color.c
+" CHECKED 2022-04-08
+" List of fields in ColorFields in color/commmand.c
syntax keyword muttrcColorField skipwhite contained
\ attachment attach_headers body bold error hdrdefault header index index_author
\ index_collapsed index_date index_flags index_label index_number index_size index_subject
@@ -383,8 +388,8 @@ syntax match muttrcColorField contained "\<quoted\d\=\>"
syntax match muttrcColorCompose skipwhite contained /\s*compose\s*/ nextgroup=muttrcColorComposeField
-" CHECKED 2020-06-21
-" List of fields in ComposeFields in color.c
+" CHECKED 2022-04-08
+" List of fields in ComposeColorFields in color/command.c
syntax keyword muttrcColorComposeField skipwhite contained
\ header security_both security_encrypt security_none security_sign
\ nextgroup=muttrcColorFG,muttrcColorFGNL
@@ -411,20 +416,21 @@ function! s:boolQuadGen(type, vars, deprecated)
endfunction
-" CHECKED 2020-06-21
+" CHECKED 2022-04-08
" List of DT_BOOL in MuttVars in mutt_config.c
call s:boolQuadGen('Bool', [
- \ 'abort_backspace', 'allow_8bit', 'allow_ansi', 'arrow_cursor', 'ascii_chars', 'askbcc',
- \ 'askcc', 'ask_follow_up', 'ask_x_comment_to', 'attach_save_without_prompting',
- \ 'attach_split', 'autocrypt', 'autocrypt_reply', 'autoedit', 'auto_subscribe', 'auto_tag',
+ \ 'abort_backspace', 'allow_8bit', 'allow_ansi', 'arrow_cursor', 'ascii_chars', 'ask_bcc',
+ \ 'ask_cc', 'ask_follow_up', 'ask_x_comment_to', 'attach_save_without_prompting',
+ \ 'attach_split', 'autocrypt', 'autocrypt_reply', 'auto_edit', 'auto_subscribe', 'auto_tag',
\ 'beep', 'beep_new', 'bounce_delivered', 'braille_friendly',
\ 'browser_abbreviate_mailboxes', 'change_folder_next', 'check_mbox_size', 'check_new',
- \ 'collapse_all', 'collapse_flagged', 'collapse_unread', 'confirmappend', 'confirmcreate',
- \ 'crypt_autoencrypt', 'crypt_autopgp', 'crypt_autosign', 'crypt_autosmime',
- \ 'crypt_confirmhook', 'crypt_opportunistic_encrypt',
+ \ 'collapse_all', 'collapse_flagged', 'collapse_unread', 'compose_show_user_headers',
+ \ 'confirm_append', 'confirm_create', 'copy_decode_weed', 'count_alternatives',
+ \ 'crypt_auto_encrypt', 'crypt_auto_pgp', 'crypt_auto_sign', 'crypt_auto_smime',
+ \ 'crypt_confirm_hook', 'crypt_opportunistic_encrypt',
\ 'crypt_opportunistic_encrypt_strong_keys', 'crypt_protected_headers_read',
- \ 'crypt_protected_headers_save', 'crypt_protected_headers_write', 'crypt_replyencrypt',
- \ 'crypt_replysign', 'crypt_replysignencrypted', 'crypt_timestamp', 'crypt_use_gpgme',
+ \ 'crypt_protected_headers_save', 'crypt_protected_headers_write', 'crypt_reply_encrypt',
+ \ 'crypt_reply_sign', 'crypt_reply_sign_encrypted', 'crypt_timestamp', 'crypt_use_gpgme',
\ 'crypt_use_pka', 'delete_untag', 'digest_collapse', 'duplicate_threads', 'edit_headers',
\ 'encode_from', 'fast_reply', 'fcc_before_send', 'fcc_clear', 'flag_safe', 'followup_to',
\ 'force_name', 'forward_decode', 'forward_decrypt', 'forward_quote', 'forward_references',
@@ -433,45 +439,52 @@ call s:boolQuadGen('Bool', [
\ 'history_remove_dups', 'honor_disposition', 'idn_decode', 'idn_encode',
\ 'ignore_list_reply_to', 'imap_check_subscribed', 'imap_condstore', 'imap_deflate',
\ 'imap_idle', 'imap_list_subscribed', 'imap_passive', 'imap_peek', 'imap_qresync',
- \ 'imap_rfc5161', 'imap_servernoise', 'implicit_autoview', 'include_encrypted',
- \ 'include_onlyfirst', 'keep_flagged', 'mailcap_sanitize', 'maildir_check_cur',
- \ 'maildir_header_cache_verify', 'maildir_trash', 'mail_check_recent', 'mail_check_stats',
- \ 'markers', 'mark_old', 'menu_move_off', 'menu_scroll', 'message_cache_clean', 'meta_key',
- \ 'metoo', 'mh_purge', 'mime_forward_decode', 'mime_subject', 'mime_type_query_first',
- \ 'narrow_tree', 'nm_record', 'nntp_listgroup', 'nntp_load_description', 'pager_stop',
- \ 'pgp_autoinline', 'pgp_auto_decode', 'pgp_check_exit', 'pgp_check_gpg_decrypt_status_fd',
- \ 'pgp_ignore_subkeys', 'pgp_long_ids', 'pgp_replyinline', 'pgp_retainable_sigs',
+ \ 'imap_rfc5161', 'imap_server_noise', 'implicit_autoview', 'include_encrypted',
+ \ 'include_only_first', 'keep_flagged', 'local_date_header', 'mailcap_sanitize',
+ \ 'maildir_check_cur', 'maildir_header_cache_verify', 'maildir_trash', 'mail_check_recent',
+ \ 'mail_check_stats', 'markers', 'mark_old', 'menu_move_off', 'menu_scroll',
+ \ 'message_cache_clean', 'meta_key', 'me_too', 'mh_purge', 'mime_forward_decode',
+ \ 'mime_type_query_first', 'narrow_tree', 'nm_query_window_enable', 'nm_record',
+ \ 'nntp_listgroup', 'nntp_load_description', 'pager_stop', 'pgp_auto_decode',
+ \ 'pgp_auto_inline', 'pgp_check_exit', 'pgp_check_gpg_decrypt_status_fd',
+ \ 'pgp_ignore_subkeys', 'pgp_long_ids', 'pgp_reply_inline', 'pgp_retainable_sigs',
\ 'pgp_self_encrypt', 'pgp_show_unusable', 'pgp_strict_enc', 'pgp_use_gpg_agent',
- \ 'pipe_decode', 'pipe_split', 'pop_auth_try_all', 'pop_last', 'postpone_encrypt',
- \ 'print_decode', 'print_split', 'prompt_after', 'read_only', 'reflow_space_quotes',
- \ 'reflow_text', 'reply_self', 'reply_with_xorig', 'resolve', 'resume_draft_files',
- \ 'resume_edited_draft_files', 'reverse_alias', 'reverse_name', 'reverse_realname',
- \ 'rfc2047_parameters', 'save_address', 'save_empty', 'save_name', 'save_unsubscribed',
- \ 'score', 'show_new_news', 'show_only_unread', 'sidebar_folder_indent',
- \ 'sidebar_new_mail_only', 'sidebar_next_new_wrap', 'sidebar_non_empty_mailbox_only',
- \ 'sidebar_on_right', 'sidebar_short_path', 'sidebar_visible', 'sig_dashes', 'sig_on_top',
- \ 'size_show_bytes', 'size_show_fractions', 'size_show_mb', 'size_units_on_left',
- \ 'smart_wrap', 'smime_ask_cert_label', 'smime_decrypt_use_default_key', 'smime_is_default',
- \ 'smime_self_encrypt', 'sort_re', 'ssl_force_tls', 'ssl_usesystemcerts', 'ssl_use_sslv2',
- \ 'ssl_use_sslv3', 'ssl_use_tlsv1', 'ssl_use_tlsv1_1', 'ssl_use_tlsv1_2', 'ssl_use_tlsv1_3',
+ \ 'pipe_decode', 'pipe_decode_weed', 'pipe_split', 'pop_auth_try_all', 'pop_last',
+ \ 'postpone_encrypt', 'print_decode', 'print_decode_weed', 'print_split', 'prompt_after',
+ \ 'read_only', 'reflow_space_quotes', 'reflow_text', 'reply_self', 'reply_with_xorig',
+ \ 'resolve', 'resume_draft_files', 'resume_edited_draft_files', 'reverse_alias',
+ \ 'reverse_name', 'reverse_real_name', 'rfc2047_parameters', 'save_address', 'save_empty',
+ \ 'save_name', 'save_unsubscribed', 'score', 'show_new_news', 'show_only_unread',
+ \ 'sidebar_folder_indent', 'sidebar_new_mail_only', 'sidebar_next_new_wrap',
+ \ 'sidebar_non_empty_mailbox_only', 'sidebar_on_right', 'sidebar_short_path',
+ \ 'sidebar_visible', 'sig_dashes', 'sig_on_top', 'size_show_bytes', 'size_show_fractions',
+ \ 'size_show_mb', 'size_units_on_left', 'smart_wrap', 'smime_ask_cert_label',
+ \ 'smime_decrypt_use_default_key', 'smime_is_default', 'smime_self_encrypt', 'sort_re',
+ \ 'ssl_force_tls', 'ssl_use_sslv2', 'ssl_use_sslv3', 'ssl_use_system_certs',
+ \ 'ssl_use_tlsv1', 'ssl_use_tlsv1_1', 'ssl_use_tlsv1_2', 'ssl_use_tlsv1_3',
\ 'ssl_verify_dates', 'ssl_verify_host', 'ssl_verify_partial_chains', 'status_on_top',
\ 'strict_threads', 'suspend', 'text_flowed', 'thorough_search', 'thread_received', 'tilde',
- \ 'ts_enabled', 'uncollapse_jump', 'uncollapse_new', 'user_agent', 'use_8bitmime',
- \ 'use_domain', 'use_envelope_from', 'use_from', 'use_ipv6', 'virtual_spoolfile',
- \ 'wait_key', 'weed', 'wrap_search', 'write_bcc', 'x_comment_to'
+ \ 'ts_enabled', 'tunnel_is_secure', 'uncollapse_jump', 'uncollapse_new', 'user_agent',
+ \ 'use_8bit_mime', 'use_domain', 'use_envelope_from', 'use_from', 'use_ipv6',
+ \ 'virtual_spool_file', 'wait_key', 'weed', 'wrap_search', 'write_bcc', 'x_comment_to'
\ ], 0)
-" CHECKED 2020-06-21
+" CHECKED 2022-04-08
" Deprecated Bools
" List of DT_SYNONYM or DT_DEPRECATED Bools in MuttVars in mutt_config.c
call s:boolQuadGen('Bool', [
- \ 'edit_hdrs', 'envelope_from', 'forw_decode', 'forw_decrypt', 'forw_quote',
- \ 'header_cache_compress', 'ignore_linear_white_space', 'pgp_autoencrypt', 'pgp_autosign',
- \ 'pgp_auto_traditional', 'pgp_create_traditional', 'pgp_replyencrypt', 'pgp_replysign',
- \ 'pgp_replysignencrypted', 'xterm_set_titles'
+ \ 'askbcc', 'askcc', 'autoedit', 'confirmappend', 'confirmcreate', 'crypt_autoencrypt',
+ \ 'crypt_autopgp', 'crypt_autosign', 'crypt_autosmime', 'crypt_confirmhook',
+ \ 'crypt_replyencrypt', 'crypt_replysign', 'crypt_replysignencrypted', 'edit_hdrs',
+ \ 'envelope_from', 'forw_decode', 'forw_decrypt', 'forw_quote', 'header_cache_compress',
+ \ 'ignore_linear_white_space', 'imap_servernoise', 'include_onlyfirst', 'metoo',
+ \ 'mime_subject', 'pgp_autoencrypt', 'pgp_autoinline', 'pgp_autosign',
+ \ 'pgp_auto_traditional', 'pgp_create_traditional', 'pgp_replyencrypt', 'pgp_replyinline',
+ \ 'pgp_replysign', 'pgp_replysignencrypted', 'reverse_realname', 'ssl_usesystemcerts',
+ \ 'use_8bitmime', 'virtual_spoolfile', 'xterm_set_titles'
\ ], 1)
-" CHECKED 2020-06-21
+" CHECKED 2022-04-08
" List of DT_QUAD in MuttVars in mutt_config.c
call s:boolQuadGen('Quad', [
\ 'abort_noattach', 'abort_nosubject', 'abort_unmodified', 'bounce', 'catchup_newsgroup',
@@ -481,31 +494,32 @@ call s:boolQuadGen('Quad', [
\ 'post_moderated', 'print', 'quit', 'recall', 'reply_to', 'ssl_starttls',
\ ], 0)
-" CHECKED 2020-06-21
+" CHECKED 2022-04-08
" Deprecated Quads
" List of DT_SYNONYM or DT_DEPRECATED Quads in MuttVars in mutt_config.c
call s:boolQuadGen('Quad', [
\ 'mime_fwd', 'pgp_encrypt_self', 'pgp_verify_sig', 'smime_encrypt_self'
\ ], 1)
-" CHECKED 2020-06-21
+" CHECKED 2022-04-08
" List of DT_NUMBER or DT_LONG in MuttVars in mutt_config.c
syntax keyword muttrcVarNum skipwhite contained
- \ connect_timeout debug_level header_cache_compress_level history
- \ imap_fetch_chunk_size imap_keepalive imap_pipeline_depth imap_poll_timeout mail_check
- \ mail_check_stats_interval menu_context net_inc nm_db_limit nm_open_timeout
- \ nm_query_window_current_position nm_query_window_duration nntp_context nntp_poll
- \ pager_context pager_index_lines pgp_timeout pop_checkinterval read_inc reflow_wrap
- \ save_history score_threshold_delete score_threshold_flag score_threshold_read
- \ search_context sendmail_wait sidebar_component_depth sidebar_width skip_quoted_offset
- \ sleep_time smime_timeout ssl_min_dh_prime_bits timeout time_inc toggle_quoted_show_levels
- \ wrap wrap_headers write_inc
+ \ connect_timeout debug_level header_cache_compress_level history imap_fetch_chunk_size
+ \ imap_keepalive imap_pipeline_depth imap_poll_timeout mail_check mail_check_stats_interval
+ \ menu_context net_inc nm_db_limit nm_open_timeout nm_query_window_current_position
+ \ nm_query_window_duration nntp_context nntp_poll pager_context pager_index_lines
+ \ pager_read_delay pager_skip_quoted_context pgp_timeout pop_check_interval read_inc
+ \ reflow_wrap save_history score_threshold_delete score_threshold_flag score_threshold_read
+ \ search_context sendmail_wait sidebar_component_depth sidebar_width sleep_time
+ \ smime_timeout ssl_min_dh_prime_bits timeout time_inc toggle_quoted_show_levels wrap
+ \ wrap_headers write_inc
\ nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
+" CHECKED 2022-04-08
+" Deprecated Numbers
syntax keyword muttrcVarDeprecatedNum contained skipwhite
- \ header_cache_pagesize wrapmargin
- \ nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
+ \ header_cache_pagesize pop_checkinterval skip_quoted_offset
-" CHECKED 2020-06-21
+" CHECKED 2022-04-08
" List of DT_STRING in MuttVars in mutt_config.c
" Special cases first, and all the rest at the end
" Formats themselves must be updated in their respective groups
@@ -517,19 +531,19 @@ syntax keyword muttrcVarStr contained skipwhite compose_format nextgroup=muttrcV
syntax keyword muttrcVarStr contained skipwhite folder_format vfolder_format nextgroup=muttrcVarEqualsFolderFmt
syntax keyword muttrcVarStr contained skipwhite attribution forward_format index_format message_format pager_format nextgroup=muttrcVarEqualsIdxFmt
syntax keyword muttrcVarStr contained skipwhite mix_entry_format nextgroup=muttrcVarEqualsMixFmt
+syntax keyword muttrcVarStr contained skipwhite pattern_format nextgroup=muttrcVarEqualsPatternFmt
syntax keyword muttrcVarStr contained skipwhite
- \ pgp_clearsign_command pgp_decode_command pgp_decrypt_command
- \ pgp_encrypt_only_command pgp_encrypt_sign_command pgp_export_command pgp_getkeys_command
- \ pgp_import_command pgp_list_pubring_command pgp_list_secring_command
- \ pgp_sign_command pgp_verify_command pgp_verify_key_command
+ \ pgp_clear_sign_command pgp_decode_command pgp_decrypt_command pgp_encrypt_only_command
+ \ pgp_encrypt_sign_command pgp_export_command pgp_get_keys_command pgp_import_command
+ \ pgp_list_pubring_command pgp_list_secring_command pgp_sign_command pgp_verify_command
+ \ pgp_verify_key_command
\ nextgroup=muttrcVarEqualsPGPCmdFmt
syntax keyword muttrcVarStr contained skipwhite pgp_entry_format nextgroup=muttrcVarEqualsPGPFmt
syntax keyword muttrcVarStr contained skipwhite query_format nextgroup=muttrcVarEqualsQueryFmt
syntax keyword muttrcVarStr contained skipwhite
\ smime_decrypt_command smime_encrypt_command smime_get_cert_command
- \ smime_get_cert_email_command smime_get_signer_cert_command
- \ smime_import_cert_command smime_pk7out_command smime_sign_command
- \ smime_verify_command smime_verify_opaque_command
+ \ smime_get_cert_email_command smime_get_signer_cert_command smime_import_cert_command
+ \ smime_pk7out_command smime_sign_command smime_verify_command smime_verify_opaque_command
\ nextgroup=muttrcVarEqualsSmimeFmt
syntax keyword muttrcVarStr contained skipwhite status_format ts_icon_format ts_status_format nextgroup=muttrcVarEqualsStatusFmt
syntax keyword muttrcVarStr contained skipwhite date_format nextgroup=muttrcVarEqualsStrftimeFmt
@@ -538,64 +552,66 @@ syntax keyword muttrcVarStr contained skipwhite sidebar_format nextgroup=muttrcV
syntax keyword muttrcVarStr contained skipwhite
\ abort_key arrow_string assumed_charset attach_charset attach_sep attribution_locale
\ autocrypt_acct_format charset config_charset content_type crypt_protected_headers_subject
- \ default_hook dsn_notify dsn_return empty_subject escape forward_attribution_intro
- \ forward_attribution_trailer header_cache_backend header_cache_compress_method hidden_tags
- \ hostname imap_authenticators imap_delim_chars imap_headers imap_login imap_pass imap_user
- \ indent_string mailcap_path mark_macro_prefix mh_seq_flagged mh_seq_replied mh_seq_unseen
- \ newsgroups_charset news_server nm_default_url nm_exclude_tags nm_flagged_tag nm_query_type
- \ nm_query_window_current_search nm_query_window_timebase nm_record_tags nm_replied_tag
- \ nm_unread_tag nntp_authenticators nntp_pass nntp_user pgp_default_key pgp_sign_as pipe_sep
- \ pop_authenticators pop_host pop_pass pop_user postpone_encrypt_as post_indent_string
- \ preconnect preferred_languages realname send_charset show_multipart_alternative
- \ sidebar_delim_chars sidebar_divider_char sidebar_indent_string simple_search
- \ smime_default_key smime_encrypt_with smime_sign_as smime_sign_digest_alg
- \ smtp_authenticators smtp_pass smtp_url smtp_user spam_separator ssl_ciphers
+ \ default_hook dsn_notify dsn_return empty_subject forward_attribution_intro
+ \ forward_attribution_trailer greeting header_cache_backend header_cache_compress_method
+ \ hidden_tags hostname imap_authenticators imap_delim_chars imap_headers imap_login
+ \ imap_pass imap_user indent_string mailcap_path mark_macro_prefix mh_seq_flagged
+ \ mh_seq_replied mh_seq_unseen newsgroups_charset news_server nm_default_url nm_exclude_tags
+ \ nm_flagged_tag nm_query_type nm_query_window_current_search nm_query_window_or_terms
+ \ nm_query_window_timebase nm_record_tags nm_replied_tag nm_unread_tag nntp_authenticators
+ \ nntp_pass nntp_user pgp_default_key pgp_sign_as pipe_sep pop_authenticators pop_host
+ \ pop_pass pop_user postpone_encrypt_as post_indent_string preconnect preferred_languages
+ \ real_name send_charset show_multipart_alternative sidebar_delim_chars sidebar_divider_char
+ \ sidebar_indent_string simple_search smime_default_key smime_encrypt_with smime_sign_as
+ \ smime_sign_digest_alg smtp_authenticators smtp_pass smtp_url smtp_user spam_separator
+ \ ssl_ciphers
\ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
" Deprecated strings
syntax keyword muttrcVarDeprecatedStr
- \ abort_noattach_regexp attach_keyword forw_format hdr_format indent_str msg_format
- \ nm_default_uri pgp_self_encrypt_as post_indent_str print_cmd quote_regexp reply_regexp
- \ smime_self_encrypt_as xterm_icon xterm_title
+ \ abort_noattach_regexp attach_keyword escape forw_format hdr_format indent_str msg_format
+ \ nm_default_uri pgp_clearsign_command pgp_getkeys_command pgp_self_encrypt_as
+ \ post_indent_str print_cmd quote_regexp realname reply_regexp smime_self_encrypt_as
+ \ spoolfile visual xterm_icon xterm_title
-" CHECKED 2020-06-21
+" CHECKED 2022-04-08
" List of DT_ADDRESS
syntax keyword muttrcVarStr contained skipwhite envelope_from_address from nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
" List of DT_ENUM
-syntax keyword muttrcVarStr contained skipwhite mbox_type nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
+syntax keyword muttrcVarStr contained skipwhite mbox_type use_threads nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
" List of DT_MBTABLE
syntax keyword muttrcVarStr contained skipwhite crypt_chars flag_chars from_chars status_chars to_chars nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
-" CHECKED 2020-06-21
-" List of DT_PATH
+" CHECKED 2022-04-08
+" List of DT_PATH or DT_MAILBOX
syntax keyword muttrcVarStr contained skipwhite
\ alias_file attach_save_dir autocrypt_dir certificate_file debug_file
\ entropy_file folder header_cache history_file mbox message_cachedir newsrc
\ news_cache_dir postponed record signature smime_ca_location
- \ smime_certificates smime_keys spoolfile ssl_ca_certificates_file
- \ ssl_client_cert tmpdir trash
+ \ smime_certificates smime_keys spool_file ssl_ca_certificates_file ssl_client_cert
+ \ tmpdir trash
\ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
" List of DT_COMMAND (excluding pgp_*_command and smime_*_command)
syntax keyword muttrcVarStr contained skipwhite
\ display_filter editor inews ispell mixmaster new_mail_command pager
- \ print_command query_command sendmail shell visual external_search_command
+ \ print_command query_command sendmail shell external_search_command
\ imap_oauth_refresh_command pop_oauth_refresh_command
\ mime_type_query_command smtp_oauth_refresh_command tunnel
\ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
-" CHECKED 2020-06-21
+" CHECKED 2022-04-08
" List of DT_REGEX
syntax keyword muttrcVarStr contained skipwhite
- \ abort_noattach_regex gecos_mask mask pgp_decryption_okay pgp_good_sign
- \ quote_regex reply_regex smileys
+ \ abort_noattach_regex gecos_mask mask pgp_decryption_okay pgp_good_sign quote_regex
+ \ reply_regex smileys
\ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
" List of DT_SORT
syntax keyword muttrcVarStr contained skipwhite
\ pgp_sort_keys sidebar_sort_method sort sort_alias sort_aux sort_browser
\ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
-" CHECKED 2020-06-21
-" List of commands in Commands in mutt_config.c
+" CHECKED 2022-04-08
+" List of commands in mutt_commands in mutt_commands.c
" Remember to remove hooks, they have already been dealt with
syntax keyword muttrcCommand skipwhite alias nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL
syntax keyword muttrcCommand skipwhite bind nextgroup=muttrcBindMenuList,muttrcBindMenuListNL
@@ -607,14 +623,12 @@ syntax keyword muttrcCommand skipwhite spam nextgroup=muttrcSpamPattern
syntax keyword muttrcCommand skipwhite unalias nextgroup=muttrcUnAliasKey,muttrcUnAliasNL
syntax keyword muttrcCommand skipwhite unhook nextgroup=muttrcHooks
syntax keyword muttrcCommand skipwhite
- \ alternative_order attachments auto_view finish hdr_order ifdef ifndef
- \ ignore lua lua-source mailboxes mailto_allow mime_lookup my_hdr push score
- \ setenv sidebar_whitelist source subjectrx subscribe-to tag-formats
- \ tag-transforms unalternative_order unattachments unauto_view uncolor
- \ unhdr_order unignore unmailboxes unmailto_allow unmime_lookup unmono
- \ unmy_hdr unscore unsetenv unsidebar_whitelist unsubjectrx unsubscribe-from
- \ unvirtual-mailboxes virtual-mailboxes named-mailboxes
- \ echo unbind unmacro
+ \ alternative_order attachments auto_view cd echo finish hdr_order ifdef ifndef ignore lua
+ \ lua-source mailboxes mailto_allow mime_lookup my_hdr named-mailboxes push score setenv
+ \ sidebar_whitelist source subjectrx subscribe-to tag-formats tag-transforms
+ \ unalternative_order unattachments unauto_view unbind uncolor unhdr_order unignore unmacro
+ \ unmailboxes unmailto_allow unmime_lookup unmono unmy_hdr unscore unsetenv
+ \ unsidebar_whitelist unsubjectrx unsubscribe-from unvirtual-mailboxes virtual-mailboxes
function! s:genFunctions(functions)
for f in a:functions
@@ -622,66 +636,68 @@ function! s:genFunctions(functions)
endfor
endfunction
-" CHECKED 2020-06-21
+" CHECKED 2022-04-08
" List of functions in functions.c
" Note: 'noop' is included but is elsewhere in the source
call s:genFunctions(['noop',
- \ 'accept', 'append', 'attach-file', 'attach-key', 'attach-message', 'attach-news-message',
- \ 'autocrypt-acct-menu', 'autocrypt-menu', 'backspace', 'backward-char', 'backward-word',
- \ 'bol', 'bottom-page', 'bottom', 'bounce-message', 'break-thread', 'buffy-cycle',
- \ 'buffy-list', 'capitalize-word', 'catchup', 'chain-next', 'chain-prev', 'change-dir',
- \ 'change-folder-readonly', 'change-folder', 'change-newsgroup-readonly',
- \ 'change-newsgroup', 'change-vfolder', 'check-new', 'check-stats',
+ \ 'accept', 'alias-dialog', 'append', 'attach-file', 'attach-key', 'attach-message',
+ \ 'attach-news-message', 'autocrypt-acct-menu', 'autocrypt-menu', 'backspace',
+ \ 'backward-char', 'backward-word', 'bol', 'bottom', 'bottom-page', 'bounce-message',
+ \ 'break-thread', 'buffy-cycle', 'buffy-list', 'capitalize-word', 'catchup', 'chain-next',
+ \ 'chain-prev', 'change-dir', 'change-folder', 'change-folder-readonly', 'change-newsgroup',
+ \ 'change-newsgroup-readonly', 'change-vfolder', 'check-new', 'check-stats',
\ 'check-traditional-pgp', 'clear-flag', 'collapse-all', 'collapse-parts',
- \ 'collapse-thread', 'complete-query', 'complete', 'compose-to-sender', 'copy-file',
+ \ 'collapse-thread', 'complete', 'complete-query', 'compose-to-sender', 'copy-file',
\ 'copy-message', 'create-account', 'create-alias', 'create-mailbox', 'current-bottom',
\ 'current-middle', 'current-top', 'decode-copy', 'decode-save', 'decrypt-copy',
- \ 'decrypt-save', 'delete-account', 'delete-char', 'delete-entry', 'delete-mailbox',
- \ 'delete-message', 'delete-pattern', 'delete-subthread', 'delete-thread', 'delete',
+ \ 'decrypt-save', 'delete', 'delete-account', 'delete-char', 'delete-entry',
+ \ 'delete-mailbox', 'delete-message', 'delete-pattern', 'delete-subthread', 'delete-thread',
\ 'descend-directory', 'detach-file', 'display-address', 'display-filename',
- \ 'display-message', 'display-toggle-weed', 'downcase-word', 'edit-bcc', 'edit-cc',
- \ 'edit-description', 'edit-encoding', 'edit-fcc', 'edit-file', 'edit-followup-to',
- \ 'edit-from', 'edit-headers', 'edit-label', 'edit-language', 'edit-message', 'edit-mime',
- \ 'edit-newsgroups', 'edit-or-view-raw-message', 'edit-raw-message', 'edit-reply-to',
- \ 'edit-subject', 'edit-to', 'edit-type', 'edit-x-comment-to', 'edit', 'end-cond',
- \ 'enter-command', 'enter-mask', 'entire-thread', 'eol', 'exit', 'extract-keys',
- \ 'fetch-mail', 'filter-entry', 'first-entry', 'flag-message', 'followup-message',
- \ 'forget-passphrase', 'forward-char', 'forward-message', 'forward-to-group',
- \ 'forward-word', 'get-attachment', 'get-children', 'get-message', 'get-parent',
- \ 'goto-folder', 'goto-parent', 'group-alternatives', 'group-chat-reply',
- \ 'group-multilingual', 'group-reply', 'half-down', 'half-up', 'help', 'history-down',
- \ 'history-search', 'history-up', 'imap-fetch-mail', 'imap-logout-all', 'insert', 'ispell',
- \ 'jump', 'kill-eol', 'kill-eow', 'kill-line', 'kill-word', 'last-entry',
- \ 'limit-current-thread', 'limit', 'link-threads', 'list-reply', 'mail-key',
- \ 'mailbox-cycle', 'mailbox-list', 'mail', 'mark-as-new', 'mark-message', 'middle-page',
- \ 'mix', 'modify-labels-then-hide', 'modify-labels', 'modify-tags-then-hide',
- \ 'modify-tags', 'move-down', 'move-up', 'new-mime', 'next-entry', 'next-line',
- \ 'next-new-then-unread', 'next-new', 'next-page', 'next-subthread', 'next-thread',
- \ 'next-undeleted', 'next-unread-mailbox', 'next-unread', 'parent-message', 'pgp-menu',
- \ 'pipe-entry', 'pipe-message', 'post-message', 'postpone-message', 'previous-entry',
- \ 'previous-line', 'previous-new-then-unread', 'previous-new', 'previous-page',
- \ 'previous-subthread', 'previous-thread', 'previous-undeleted', 'previous-unread',
- \ 'print-entry', 'print-message', 'purge-message', 'purge-thread', 'quasi-delete',
- \ 'query-append', 'query', 'quit', 'quote-char', 'read-subthread', 'read-thread',
- \ 'recall-message', 'reconstruct-thread', 'redraw-screen', 'refresh', 'reload-active',
- \ 'rename-attachment', 'rename-file', 'rename-mailbox', 'reply', 'resend-message',
- \ 'root-message', 'save-entry', 'save-message', 'search-next', 'search-opposite',
- \ 'search-reverse', 'search-toggle', 'search', 'select-entry', 'select-new',
+ \ 'display-message', 'display-toggle-weed', 'downcase-word', 'edit', 'edit-bcc', 'edit-cc',
+ \ 'edit-content-id', 'edit-description', 'edit-encoding', 'edit-fcc', 'edit-file',
+ \ 'edit-followup-to', 'edit-from', 'edit-headers', 'edit-label', 'edit-language',
+ \ 'edit-message', 'edit-mime', 'edit-newsgroups', 'edit-or-view-raw-message',
+ \ 'edit-raw-message', 'edit-reply-to', 'edit-subject', 'edit-to', 'edit-type',
+ \ 'edit-x-comment-to', 'end-cond', 'enter-command', 'enter-mask', 'entire-thread', 'eol',
+ \ 'error-history', 'exit', 'extract-keys', 'fetch-mail', 'filter-entry', 'first-entry',
+ \ 'flag-message', 'followup-message', 'forget-passphrase', 'forward-char',
+ \ 'forward-message', 'forward-to-group', 'forward-word', 'get-attachment', 'get-children',
+ \ 'get-message', 'get-parent', 'goto-folder', 'goto-parent', 'group-alternatives',
+ \ 'group-chat-reply', 'group-multilingual', 'group-related', 'group-reply', 'half-down',
+ \ 'half-up', 'help', 'history-down', 'history-search', 'history-up', 'imap-fetch-mail',
+ \ 'imap-logout-all', 'insert', 'ispell', 'jump', 'kill-eol', 'kill-eow', 'kill-line',
+ \ 'kill-word', 'last-entry', 'limit', 'limit-current-thread', 'link-threads', 'list-reply',
+ \ 'list-subscribe', 'list-unsubscribe', 'mail', 'mail-key', 'mailbox-cycle', 'mailbox-list',
+ \ 'mark-as-new', 'mark-message', 'middle-page', 'mix', 'modify-labels',
+ \ 'modify-labels-then-hide', 'modify-tags', 'modify-tags-then-hide', 'move-down', 'move-up',
+ \ 'new-mime', 'next-entry', 'next-line', 'next-new', 'next-new-then-unread', 'next-page',
+ \ 'next-subthread', 'next-thread', 'next-undeleted', 'next-unread', 'next-unread-mailbox',
+ \ 'parent-message', 'pgp-menu', 'pipe-entry', 'pipe-message', 'post-message',
+ \ 'postpone-message', 'previous-entry', 'previous-line', 'previous-new',
+ \ 'previous-new-then-unread', 'previous-page', 'previous-subthread', 'previous-thread',
+ \ 'previous-undeleted', 'previous-unread', 'print-entry', 'print-message', 'purge-message',
+ \ 'purge-thread', 'quasi-delete', 'query', 'query-append', 'quit', 'quote-char',
+ \ 'read-subthread', 'read-thread', 'recall-message', 'reconstruct-thread', 'redraw-screen',
+ \ 'refresh', 'reload-active', 'rename-attachment', 'rename-file', 'rename-mailbox', 'reply',
+ \ 'resend-message', 'root-message', 'save-entry', 'save-message', 'search', 'search-next',
+ \ 'search-opposite', 'search-reverse', 'search-toggle', 'select-entry', 'select-new',
\ 'send-message', 'set-flag', 'shell-escape', 'show-limit', 'show-log-messages',
- \ 'show-version', 'sidebar-next-new', 'sidebar-first', 'sidebar-last', 'sidebar-next',
- \ 'sidebar-open', 'sidebar-page-down', 'sidebar-page-up', 'sidebar-prev-new',
- \ 'sidebar-prev', 'sidebar-toggle-virtual', 'sidebar-toggle-visible', 'skip-quoted',
- \ 'smime-menu', 'sort-mailbox', 'sort-reverse', 'sort', 'subscribe-pattern',
- \ 'sync-mailbox', 'tag-entry', 'tag-message', 'tag-pattern', 'tag-prefix-cond',
- \ 'tag-prefix', 'tag-subthread', 'tag-thread', 'toggle-active', 'toggle-disposition',
- \ 'toggle-mailboxes', 'toggle-new', 'toggle-prefer-encrypt', 'toggle-quoted',
- \ 'toggle-read', 'toggle-recode', 'toggle-subscribed', 'toggle-unlink', 'toggle-write',
- \ 'top-page', 'top', 'transpose-chars', 'uncatchup', 'undelete-entry', 'undelete-message',
- \ 'undelete-pattern', 'undelete-subthread', 'undelete-thread', 'unsubscribe-pattern',
- \ 'untag-pattern', 'upcase-word', 'update-encoding', 'verify-key',
- \ 'vfolder-from-query-readonly', 'vfolder-from-query', 'vfolder-window-backward',
- \ 'vfolder-window-forward', 'view-attachments', 'view-attach', 'view-file', 'view-mailcap',
- \ 'view-name', 'view-raw-message', 'view-text', 'what-key', 'write-fcc'
+ \ 'show-version', 'sidebar-first', 'sidebar-last', 'sidebar-next', 'sidebar-next-new',
+ \ 'sidebar-open', 'sidebar-page-down', 'sidebar-page-up', 'sidebar-prev',
+ \ 'sidebar-prev-new', 'sidebar-toggle-virtual', 'sidebar-toggle-visible', 'skip-headers',
+ \ 'skip-quoted', 'smime-menu', 'sort', 'sort-alias', 'sort-alias-reverse', 'sort-mailbox',
+ \ 'sort-reverse', 'subscribe', 'subscribe-pattern', 'sync-mailbox', 'tag-entry',
+ \ 'tag-message', 'tag-pattern', 'tag-prefix', 'tag-prefix-cond', 'tag-subthread',
+ \ 'tag-thread', 'toggle-active', 'toggle-disposition', 'toggle-mailboxes', 'toggle-new',
+ \ 'toggle-prefer-encrypt', 'toggle-quoted', 'toggle-read', 'toggle-recode',
+ \ 'toggle-subscribed', 'toggle-unlink', 'toggle-write', 'top', 'top-page',
+ \ 'transpose-chars', 'uncatchup', 'undelete-entry', 'undelete-message', 'undelete-pattern',
+ \ 'undelete-subthread', 'undelete-thread', 'ungroup-attachment', 'unsubscribe',
+ \ 'unsubscribe-pattern', 'untag-pattern', 'upcase-word', 'update-encoding', 'verify-key',
+ \ 'vfolder-from-query', 'vfolder-from-query-readonly', 'vfolder-window-backward',
+ \ 'vfolder-window-forward', 'vfolder-window-reset', 'view-attach', 'view-attachments',
+ \ 'view-file', 'view-mailcap', 'view-name', 'view-pager', 'view-raw-message', 'view-text',
+ \ 'what-key', 'write-fcc'
\ ])
" Define the default highlighting.
@@ -758,6 +774,7 @@ highlight def link muttrcFolderFormatEscapes muttrcEscape
highlight def link muttrcGroupIndexFormatEscapes muttrcEscape
highlight def link muttrcIndexFormatEscapes muttrcEscape
highlight def link muttrcMixFormatEscapes muttrcEscape
+highlight def link muttrcPatternFormatEscapes muttrcEscape
highlight def link muttrcPGPCmdFormatEscapes muttrcEscape
highlight def link muttrcPGPFormatEscapes muttrcEscape
highlight def link muttrcPGPTimeEscapes muttrcEscape
@@ -774,6 +791,7 @@ highlight def link muttrcComposeFormatConditionals muttrcFormatConditionals2
highlight def link muttrcFolderFormatConditionals muttrcFormatConditionals2
highlight def link muttrcIndexFormatConditionals muttrcFormatConditionals2
highlight def link muttrcMixFormatConditionals muttrcFormatConditionals2
+highlight def link muttrcPatternFormatConditionals muttrcFormatConditionals2
highlight def link muttrcPGPCmdFormatConditionals muttrcFormatConditionals2
highlight def link muttrcPGPFormatConditionals muttrcFormatConditionals2
highlight def link muttrcSmimeFormatConditionals muttrcFormatConditionals2
@@ -789,6 +807,7 @@ highlight def link muttrcFolderFormatStr muttrcString
highlight def link muttrcGroupIndexFormatStr muttrcString
highlight def link muttrcIndexFormatStr muttrcString
highlight def link muttrcMixFormatStr muttrcString
+highlight def link muttrcPatternFormatStr muttrcString
highlight def link muttrcPGPCmdFormatStr muttrcString
highlight def link muttrcPGPFormatStr muttrcString
highlight def link muttrcQueryFormatStr muttrcString
diff --git a/runtime/syntax/sml.vim b/runtime/syntax/sml.vim
index 53ff12a859..8f1af3f9bd 100644
--- a/runtime/syntax/sml.vim
+++ b/runtime/syntax/sml.vim
@@ -1,9 +1,10 @@
" Vim syntax file
" Language: SML
" Filenames: *.sml *.sig
-" Maintainers: Markus Mottl <markus.mottl@gmail.com>
-" Fabrizio Zeno Cornelli <zeno@filibusta.crema.unimi.it>
-" Last Change: 2021 Oct 04
+" Maintainer: Markus Mottl <markus.mottl@gmail.com>
+" Previous Maintainer: Fabrizio Zeno Cornelli
+" <zeno@filibusta.crema.unimi.it> (invalid)
+" Last Change: 2022 Apr 01
" 2015 Aug 31 - Fixed opening of modules (Ramana Kumar)
" 2006 Oct 23 - Fixed character highlighting bug (MM)
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index 0bc233fc2a..df0572adb8 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -202,7 +202,7 @@ syn keyword vimAugroupKey contained aug[roup]
" Operators: {{{2
" =========
-syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimType,vimRegister,vimContinue,vim9Comment
+syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimType,vimRegister,vimContinue,vim9Comment,vimVar
syn match vimOper "||\|&&\|[-+.!]" skipwhite nextgroup=vimString,vimSpecFile
syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
syn match vimOper "\(\<is\|\<isnot\)[?#]\{0,2}\>" skipwhite nextgroup=vimString,vimSpecFile
@@ -437,8 +437,9 @@ syn case match
" User Function Highlighting: {{{2
" (following Gautam Iyer's suggestion)
" ==========================
-syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute
-syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimNotation
+syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimCommand,vimFuncEcho,vimFuncName,vimUserFunc,vimExecute
+syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimCommand,vimNotation
+syn keyword vimFuncEcho contained ec ech echo
" User Command Highlighting: {{{2
"syn match vimUsrCmd '^\s*\zs\u\w*.*$'
@@ -875,6 +876,7 @@ if !exists("skip_vim_syntax_inits")
hi def link vimError Error
hi def link vimFBVar vimVar
hi def link vimFgBgAttrib vimHiAttrib
+ hi def link vimFuncEcho vimCommand
hi def link vimHiCtermul vimHiTerm
hi def link vimFold Folded
hi def link vimFTCmd vimCommand
diff --git a/scripts/bump-deps.sh b/scripts/bump-deps.sh
new file mode 100755
index 0000000000..85c7f72700
--- /dev/null
+++ b/scripts/bump-deps.sh
@@ -0,0 +1,104 @@
+#!/usr/bin/env bash
+set -e
+set -u
+# Use privileged mode, which e.g. skips using CDPATH.
+set -p
+
+# Ensure that the user has a bash that supports -A
+if [[ "${BASH_VERSINFO[0]}" -lt 4 ]]; then
+ echo >&2 "error: script requires bash 4+ (you have ${BASH_VERSION})."
+ exit 1
+fi
+
+readonly NVIM_SOURCE_DIR="${NVIM_SOURCE_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
+readonly VIM_SOURCE_DIR_DEFAULT="${NVIM_SOURCE_DIR}/.vim-src"
+readonly VIM_SOURCE_DIR="${VIM_SOURCE_DIR:-${VIM_SOURCE_DIR_DEFAULT}}"
+BASENAME="$(basename "${0}")"
+readonly BASENAME
+
+usage() {
+ echo "Bump Neovim dependencies"
+ echo
+ echo "Usage: ${BASENAME} [ -h | --pr | --branch=<dep> | --dep=<dependency> ]"
+ echo
+ echo "Options:"
+ echo " -h show this message and exit."
+ echo " --pr submit pr for bumping deps."
+ echo " --branch=<dep> create a branch bump-<dep> from current branch."
+ echo " --dep=<dependency> bump to a specific release or tag."
+ echo
+ echo "Dependency Options:"
+ echo " --version=<tag> bump to a specific release or tag."
+ echo " --commit=<hash> bump to a specific commit."
+ echo " --HEAD bump to a current head."
+ echo
+ echo " <dependency> is one of:"
+ echo " \"LuaJIT\", \"libuv\", \"Luv\", \"tree-sitter\""
+}
+
+# Checks if a program is in the user's PATH, and is executable.
+check_executable() {
+ test -x "$(command -v "${1}")"
+}
+
+require_executable() {
+ if ! check_executable "${1}"; then
+ echo >&2 "${BASENAME}: '${1}' not found in PATH or not executable."
+ exit 1
+ fi
+}
+
+require_executable "nvim"
+
+if [ $# -eq 0 ]; then
+ usage
+ exit 1
+fi
+
+PARSED_ARGS=$(getopt -a -n "$BASENAME" -o h --long pr,branch:,dep:,version:,commit:,HEAD -- "$@")
+
+DEPENDENCY=""
+eval set -- "$PARSED_ARGS"
+while :; do
+ case "$1" in
+ -h)
+ usage
+ exit 0
+ ;;
+ --pr)
+ nvim -es +"lua require('scripts.bump_deps').submit_pr()"
+ exit 0
+ ;;
+ --branch)
+ DEP=$2
+ nvim -es +"lua require('scripts.bump_deps').create_branch('$DEP')"
+ exit 0
+ ;;
+ --dep)
+ DEPENDENCY=$2
+ shift 2
+ ;;
+ --version)
+ VERSION=$2
+ nvim -es +"lua require('scripts.bump_deps').version('$DEPENDENCY', '$VERSION')"
+ exit 0
+ ;;
+ --commit)
+ COMMIT=$2
+ nvim -es +"lua require('scripts.bump_deps').commit('$DEPENDENCY', '$COMMIT')"
+ exit 0
+ ;;
+ --HEAD)
+ nvim -es +"lua require('scripts.bump_deps').head('$DEPENDENCY')"
+ exit 0
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
+usage
+exit 1
+
+# vim: et sw=2
diff --git a/scripts/bump_deps.lua b/scripts/bump_deps.lua
new file mode 100644
index 0000000000..2ecbb2e658
--- /dev/null
+++ b/scripts/bump_deps.lua
@@ -0,0 +1,343 @@
+-- Usage:
+-- # bump to version
+-- nvim -es +"lua require('scripts.bump_deps').version(dependency, version_tag)"
+--
+-- # bump to commit
+-- nvim -es +"lua require('scripts.bump_deps').commit(dependency, commit_hash)"
+--
+-- # bump to HEAD
+-- nvim -es +"lua require('scripts.bump_deps').head(dependency)"
+--
+-- # submit PR
+-- nvim -es +"lua require('scripts.bump_deps').submit_pr()"
+--
+-- # create branch
+-- nvim -es +"lua require('scripts.bump_deps').create_branch()"
+
+local M = {}
+
+local _trace = false
+local required_branch_prefix = "bump-"
+local commit_prefix = "build(deps): "
+
+-- Print message
+local function p(s)
+ vim.cmd("set verbose=1")
+ vim.api.nvim_echo({ { s, "" } }, false, {})
+ vim.cmd("set verbose=0")
+end
+
+local function die()
+ p("")
+ vim.cmd("cquit 1")
+end
+
+-- Executes and returns the output of `cmd`, or nil on failure.
+-- if die_on_fail is true, process dies with die_msg on failure
+--
+-- Prints `cmd` if `trace` is enabled.
+local function _run(cmd, die_on_fail, die_msg)
+ if _trace then
+ p("run: " .. vim.inspect(cmd))
+ end
+ local rv = vim.trim(vim.fn.system(cmd)) or ""
+ if vim.v.shell_error ~= 0 then
+ if die_on_fail then
+ if _trace then
+ p(rv)
+ end
+ p(die_msg)
+ die()
+ end
+ return nil
+ end
+ return rv
+end
+
+-- Run a command, return nil on failure
+local function run(cmd)
+ return _run(cmd, false, "")
+end
+
+-- Run a command, die on failure with err_msg
+local function run_die(cmd, err_msg)
+ return _run(cmd, true, err_msg)
+end
+
+local function require_executable(cmd)
+ local cmd_path = run_die({ "command", "-v", cmd }, cmd .. " not found!")
+ run_die({ "test", "-x", cmd_path }, cmd .. " is not executable")
+end
+
+local function rm_file_if_present(path_to_file)
+ run({ "rm", "-f", path_to_file })
+end
+
+local nvim_src_dir = vim.fn.getcwd()
+local temp_dir = nvim_src_dir .. "/tmp"
+run({ "mkdir", "-p", temp_dir })
+
+local function get_dependency(dependency_name)
+ local dependency_table = {
+ ["LuaJIT"] = {
+ repo = "LuaJIT/LuaJIT",
+ symbol = "LUAJIT",
+ },
+ ["libuv"] = {
+ repo = "libuv/libuv",
+ symbol = "LIBUV",
+ },
+ ["Luv"] = {
+ repo = "luvit/luv",
+ symbol = "LUV",
+ },
+ ["tree-sitter"] = {
+ repo = "tree-sitter/tree-sitter",
+ symbol = "TREESITTER",
+ },
+ }
+ local dependency = dependency_table[dependency_name]
+ if dependency == nil then
+ p("Not a dependency: " .. dependency_name)
+ die()
+ end
+ dependency.name = dependency_name
+ return dependency
+end
+
+local function get_gh_commit_sha(repo, ref)
+ require_executable("gh")
+
+ local sha = run_die(
+ { "gh", "api", "repos/" .. repo .. "/commits/" .. ref, "--jq", ".sha" },
+ "Failed to get commit hash from GitHub. Not a valid ref?"
+ )
+ return sha
+end
+
+local function get_archive_info(repo, ref)
+ require_executable("curl")
+
+ local archive_name = ref .. ".tar.gz"
+ local archive_path = temp_dir .. "/" .. archive_name
+ local archive_url = "https://github.com/" .. repo .. "/archive/" .. archive_name
+
+ rm_file_if_present(archive_path)
+ run_die({ "curl", "-sL", archive_url, "-o", archive_path }, "Failed to download archive from GitHub")
+
+ local archive_sha = run({ "sha256sum", archive_path }):gmatch("%w+")()
+ return { url = archive_url, sha = archive_sha }
+end
+
+local function write_cmakelists_line(symbol, kind, value)
+ require_executable("sed")
+
+ local cmakelists_path = nvim_src_dir .. "/" .. "third-party/CMakeLists.txt"
+ run_die({
+ "sed",
+ "-i",
+ "-e",
+ "s/set(" .. symbol .. "_" .. kind .. ".*$" .. "/set(" .. symbol .. "_" .. kind .. " " .. value .. ")" .. "/",
+ cmakelists_path,
+ }, "Failed to write " .. cmakelists_path)
+end
+
+local function explicit_create_branch(dep)
+ require_executable("git")
+
+ local checked_out_branch = run({ "git", "rev-parse", "--abbrev-ref", "HEAD" })
+ if checked_out_branch ~= "master" then
+ p("Not on master!")
+ die()
+ end
+ run_die({ "git", "checkout", "-b", "bump-" .. dep }, "git failed to create branch")
+end
+
+local function verify_branch(new_branch_suffix)
+ require_executable("git")
+
+ local checked_out_branch = run({ "git", "rev-parse", "--abbrev-ref", "HEAD" })
+ if not checked_out_branch:match("^" .. required_branch_prefix) then
+ p("Current branch '" .. checked_out_branch .. "' doesn't seem to start with " .. required_branch_prefix)
+ p("Checking out to bump-" .. new_branch_suffix)
+ explicit_create_branch(new_branch_suffix)
+ end
+end
+
+local function update_cmakelists(dependency, archive, comment)
+ require_executable("git")
+
+ verify_branch(dependency.name)
+
+ local changed_file = nvim_src_dir .. "/" .. "third-party/CMakeLists.txt"
+
+ p("Updating " .. dependency.name .. " to " .. archive.url .. "\n")
+ write_cmakelists_line(dependency.symbol, "URL", archive.url:gsub("/", "\\/"))
+ write_cmakelists_line(dependency.symbol, "SHA256", archive.sha)
+ run_die(
+ { "git", "commit", changed_file, "-m", commit_prefix .. "bump " .. dependency.name .. " to " .. comment },
+ "git failed to commit"
+ )
+end
+
+local function verify_cmakelists_committed()
+ require_executable("git")
+
+ local cmakelists_path = nvim_src_dir .. "/" .. "third-party/CMakeLists.txt"
+ run_die({ "git", "diff", "--quiet", "HEAD", "--", cmakelists_path }, cmakelists_path .. " has uncommitted changes")
+end
+
+local function warn_luv_symbol()
+ p("warning: " .. get_dependency("Luv").symbol .. "_VERSION will not be updated")
+end
+
+-- return first 9 chars of commit
+local function short_commit(commit)
+ return string.sub(commit, 1, 9)
+end
+
+-- TODO: remove hardcoded fork
+local function gh_pr(pr_title, pr_body)
+ require_executable("gh")
+
+ local pr_url = run_die({
+ "gh",
+ "pr",
+ "create",
+ "--title",
+ pr_title,
+ "--body",
+ pr_body,
+ }, "Failed to create PR")
+ return pr_url
+end
+
+local function find_git_remote(fork)
+ require_executable("git")
+
+ local remotes = run({ "git", "remote", "-v" })
+ local git_remote = ""
+ for remote in remotes:gmatch("[^\r\n]+") do
+ local words = {}
+ for word in remote:gmatch("%w+") do
+ table.insert(words, word)
+ end
+ local match = words[1]:match("/github.com[:/]neovim/neovim/")
+ if fork == "fork" then
+ match = not match
+ end
+ if match and words[3] == "(fetch)" then
+ git_remote = words[0]
+ break
+ end
+ end
+ if git_remote == "" then
+ git_remote = "origin"
+ end
+ return git_remote
+end
+
+local function create_pr(pr_title, pr_body)
+ require_executable("git")
+
+ local push_first = true
+
+ local checked_out_branch = run({ "git", "rev-parse", "--abbrev-ref", "HEAD" })
+ if push_first then
+ local push_remote = run({ "git", "config", "--get", "branch." .. checked_out_branch .. ".pushRemote" })
+ if push_remote == nil then
+ push_remote = run({ "git", "config", "--get", "remote.pushDefault" })
+ if push_remote == nil then
+ push_remote = run({ "git", "config", "--get", "branch." .. checked_out_branch .. ".remote" })
+ if push_remote == nil or push_remote == find_git_remote(nil) then
+ push_remote = find_git_remote("fork")
+ end
+ end
+ end
+
+ p("Pushing to " .. push_remote .. "/" .. checked_out_branch)
+ run_die({ "git", "push", push_remote, checked_out_branch }, "Git failed to push")
+ end
+
+ local pr_url = gh_pr(pr_title, pr_body)
+ p("\nCreated PR: " .. pr_url .. "\n")
+end
+
+function M.commit(dependency_name, commit)
+ local dependency = get_dependency(dependency_name)
+ verify_cmakelists_committed()
+ local commit_sha = get_gh_commit_sha(dependency.repo, commit)
+ if commit_sha ~= commit then
+ p("Not a commit: " .. commit .. ". Did you mean version?")
+ die()
+ end
+ local archive = get_archive_info(dependency.repo, commit)
+ if dependency_name == "Luv" then
+ warn_luv_symbol()
+ end
+ update_cmakelists(dependency, archive, short_commit(commit))
+end
+
+function M.version(dependency_name, version)
+ local dependency = get_dependency(dependency_name)
+ verify_cmakelists_committed()
+ local commit_sha = get_gh_commit_sha(dependency.repo, version)
+ if commit_sha == version then
+ p("Not a version: " .. version .. ". Did you mean commit?")
+ die()
+ end
+ local archive = get_archive_info(dependency.repo, version)
+ if dependency_name == "Luv" then
+ write_cmakelists_line(dependency.symbol, "VERSION", version)
+ end
+ update_cmakelists(dependency, archive, version)
+end
+
+function M.head(dependency_name)
+ local dependency = get_dependency(dependency_name)
+ verify_cmakelists_committed()
+ local commit_sha = get_gh_commit_sha(dependency.repo, "HEAD")
+ local archive = get_archive_info(dependency.repo, commit_sha)
+ if dependency_name == "Luv" then
+ warn_luv_symbol()
+ end
+ update_cmakelists(dependency, archive, "HEAD - " .. short_commit(commit_sha))
+end
+
+function M.create_branch(dep)
+ explicit_create_branch(dep)
+end
+
+function M.submit_pr()
+ require_executable("git")
+
+ verify_branch("deps")
+
+ local nvim_remote = find_git_remote(nil)
+ local relevant_commit = run_die({
+ "git",
+ "log",
+ "--grep=" .. commit_prefix,
+ "--reverse",
+ "--format='%s'",
+ nvim_remote .. "/master..HEAD",
+ "-1",
+ }, "Failed to fetch commits")
+
+ local pr_title
+ local pr_body
+
+ if relevant_commit == "" then
+ pr_title = commit_prefix .. "bump some dependencies"
+ pr_body = "bump some dependencies"
+ else
+ relevant_commit = relevant_commit:gsub("'", "")
+ pr_title = relevant_commit
+ pr_body = relevant_commit:gsub(commit_prefix:gsub("%(", "%%("):gsub("%)", "%%)"), "")
+ end
+ pr_body = pr_body .. "\n\n(add explanations if needed)"
+ p(pr_title .. "\n" .. pr_body .. "\n")
+ create_pr(pr_title, pr_body)
+end
+
+return M
diff --git a/src/nvim/api/autocmd.c b/src/nvim/api/autocmd.c
index 57f392f98e..ccf4ae3d02 100644
--- a/src/nvim/api/autocmd.c
+++ b/src/nvim/api/autocmd.c
@@ -366,7 +366,7 @@ cleanup:
/// {"CursorHold", "BufPreWrite", "BufPostWrite"}
/// </pre>
///
-/// @param event (String|Array) The event or events to register this autocommand
+/// @param event (string|array) The event or events to register this autocommand
/// @param opts Dictionary of autocommand options:
/// - group (string|integer) optional: the autocommand group name or
/// id to match against.
@@ -375,8 +375,18 @@ cleanup:
/// - buffer (integer) optional: buffer number for buffer local autocommands
/// |autocmd-buflocal|. Cannot be used with {pattern}.
/// - desc (string) optional: description of the autocommand.
-/// - callback (function|string) optional: Lua function or Vim function (as string) to
-/// execute on event. Cannot be used with {command}
+/// - callback (function|string) optional: if a string, the name of a Vimscript function
+/// to call when this autocommand is triggered. Otherwise, a Lua function which is
+/// called when this autocommand is triggered. Cannot be used with {command}. Lua
+/// callbacks can return true to delete the autocommand; in addition, they accept a
+/// single table argument with the following keys:
+/// - id: (number) the autocommand id
+/// - event: (string) the name of the event that triggered the autocommand
+/// |autocmd-events|
+/// - group: (number|nil) the autocommand group id, if it exists
+/// - match: (string) the expanded value of |<amatch>|
+/// - buf: (number) the expanded value of |<abuf>|
+/// - file: (string) the expanded value of |<afile>|
/// - command (string) optional: Vim command to execute on event. Cannot be used with
/// {callback}
/// - once (boolean) optional: defaults to false. Run the autocommand
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c
index bcac7fbc4a..48c1bb740d 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -135,7 +135,7 @@ static inline const char *get_deleted_augroup(void) FUNC_ATTR_ALWAYS_INLINE
}
// Show the autocommands for one AutoPat.
-static void aupat_show(AutoPat *ap)
+static void aupat_show(AutoPat *ap, event_T event, int previous_group)
{
// Check for "got_int" (here and at various places below), which is set
// when "q" has been hit for the "--more--" prompt
@@ -148,6 +148,31 @@ static void aupat_show(AutoPat *ap)
return;
}
+ char *name = augroup_name(ap->group);
+
+ msg_putchar('\n');
+ if (got_int) {
+ return;
+ }
+ // When switching groups, we need to show the new group information.
+ if (ap->group != previous_group) {
+ // show the group name, if it's not the default group
+ if (ap->group != AUGROUP_DEFAULT) {
+ if (name == NULL) {
+ msg_puts_attr(get_deleted_augroup(), HL_ATTR(HLF_E));
+ } else {
+ msg_puts_attr(name, HL_ATTR(HLF_T));
+ }
+ msg_puts(" ");
+ }
+ // show the event name
+ msg_puts_attr(event_nr2name(event), HL_ATTR(HLF_T));
+ msg_putchar('\n');
+ if (got_int) {
+ return;
+ }
+ }
+
msg_col = 4;
msg_outtrans(ap->pat);
@@ -180,53 +205,69 @@ static void aupat_show(AutoPat *ap)
}
}
-static void au_show_for_all_events(int group)
+static void au_show_for_all_events(int group, char_u *pat)
{
FOR_ALL_AUEVENTS(event) {
- au_show_for_event(group, event);
+ au_show_for_event(group, event, pat);
}
}
-static void au_show_for_event(int group, event_T event)
+static void au_show_for_event(int group, event_T event, char_u *pat)
{
// Return early if there are no autocmds for this event
if (au_event_is_empty(event)) {
return;
}
+ // always need to show group information before the first pattern for the event
int previous_group = AUGROUP_ERROR;
- FOR_ALL_AUPATS_IN_EVENT(event, ap) {
- if (group != AUGROUP_ALL && group != ap->group) {
- continue;
- }
-
- char *name = augroup_name(ap->group);
- msg_putchar('\n');
- // When switching groups, we need to show the new group information.
- if (ap->group != previous_group) {
- // show the group name, if it's not the default group
- if (ap->group != AUGROUP_DEFAULT) {
- if (name == NULL) {
- msg_puts_attr(get_deleted_augroup(), HL_ATTR(HLF_E));
- } else {
- msg_puts_attr(name, HL_ATTR(HLF_T));
- }
- msg_puts(" ");
+ if (*pat == NUL) {
+ FOR_ALL_AUPATS_IN_EVENT(event, ap) {
+ if (group == AUGROUP_ALL || ap->group == group) {
+ aupat_show(ap, event, previous_group);
+ previous_group = ap->group;
}
-
- // show the event name
- msg_puts_attr(event_nr2name(event), HL_ATTR(HLF_T));
- msg_putchar('\n');
}
+ return;
+ }
- if (got_int) {
- return;
+ char_u buflocal_pat[BUFLOCAL_PAT_LEN]; // for "<buffer=X>"
+ // Loop through all the specified patterns.
+ int patlen = (int)aucmd_pattern_length(pat);
+ while (patlen) {
+ // detect special <buffer[=X]> buffer-local patterns
+ if (aupat_is_buflocal(pat, patlen)) {
+ // normalize pat into standard "<buffer>#N" form
+ aupat_normalize_buflocal_pat(buflocal_pat, pat, patlen, aupat_get_buflocal_nr(pat, patlen));
+ pat = buflocal_pat;
+ patlen = (int)STRLEN(buflocal_pat);
}
- aupat_show(ap);
+ assert(*pat != NUL);
+
+ // Find AutoPat entries with this pattern.
+ // always goes at or after the last one, so start at the end.
+ FOR_ALL_AUPATS_IN_EVENT(event, ap) {
+ if (ap->pat != NULL) {
+ // Accept a pattern when:
+ // - a group was specified and it's that group
+ // - the length of the pattern matches
+ // - the pattern matches.
+ // For <buffer[=X]>, this condition works because we normalize
+ // all buffer-local patterns.
+ if ((group == AUGROUP_ALL || ap->group == group)
+ && ap->patlen == patlen
+ && STRNCMP(pat, ap->pat, patlen) == 0) {
+ // Show autocmd's for this autopat, or buflocals <buffer=X>
+ aupat_show(ap, event, previous_group);
+ previous_group = ap->group;
+ }
+ }
+ }
- previous_group = ap->group;
+ pat = aucmd_next_pattern(pat, (size_t)patlen);
+ patlen = (int)aucmd_pattern_length(pat);
}
}
@@ -805,11 +846,11 @@ void do_autocmd(char_u *arg_in, int forceit)
msg_puts_title(_("\n--- Autocommands ---"));
if (*arg == '*' || *arg == '|' || *arg == NUL) {
- au_show_for_all_events(group);
+ au_show_for_all_events(group, pat);
} else {
event_T event = event_name2nr(arg, &arg);
assert(event < NUM_EVENTS);
- au_show_for_event(group, event);
+ au_show_for_event(group, event, pat);
}
} else {
if (*arg == '*' || *arg == NUL || *arg == '|') {
@@ -900,7 +941,6 @@ int do_autocmd_event(event_T event, char_u *pat, bool once, int nested, char_u *
assert(*pat != NUL);
// Find AutoPat entries with this pattern.
- // always goes at or after the last one, so start at the end.
prev_ap = &first_autopat[(int)event];
while ((ap = *prev_ap) != NULL) {
if (ap->pat != NULL) {
@@ -980,6 +1020,7 @@ int autocmd_register(int64_t id, event_T event, char_u *pat, int patlen, int gro
patlen = (int)STRLEN(buflocal_pat);
}
+ // always goes at or after the last one, so start at the end.
if (last_autopat[(int)event] != NULL) {
prev_ap = &last_autopat[(int)event];
} else {
@@ -1964,6 +2005,50 @@ void auto_next_pat(AutoPatCmd *apc, int stop_at_last)
}
}
+static bool call_autocmd_callback(const AutoCmd *ac, const AutoPatCmd *apc)
+{
+ bool ret = false;
+ Callback callback = ac->exec.callable.cb;
+ if (callback.type == kCallbackLua) {
+ Dictionary data = ARRAY_DICT_INIT;
+ PUT(data, "id", INTEGER_OBJ(ac->id));
+ PUT(data, "event", CSTR_TO_OBJ(event_nr2name(apc->event)));
+ PUT(data, "match", CSTR_TO_OBJ((char *)autocmd_match));
+ PUT(data, "file", CSTR_TO_OBJ((char *)autocmd_fname));
+ PUT(data, "buf", INTEGER_OBJ(autocmd_bufnr));
+
+ int group = apc->curpat->group;
+ switch (group) {
+ case AUGROUP_ERROR:
+ abort(); // unreachable
+ case AUGROUP_DEFAULT:
+ case AUGROUP_ALL:
+ case AUGROUP_DELETED:
+ // omit group in these cases
+ break;
+ default:
+ PUT(data, "group", INTEGER_OBJ(group));
+ break;
+ }
+
+ FIXED_TEMP_ARRAY(args, 1);
+ args.items[0] = DICTIONARY_OBJ(data);
+
+ Object result = nlua_call_ref(callback.data.luaref, NULL, args, true, NULL);
+ if (result.type == kObjectTypeBoolean) {
+ ret = result.data.boolean;
+ }
+ api_free_dictionary(data);
+ api_free_object(result);
+ } else {
+ typval_T argsin = TV_INITIAL_VALUE;
+ typval_T rettv = TV_INITIAL_VALUE;
+ callback_call(&callback, 0, &argsin, &rettv);
+ }
+
+ return ret;
+}
+
/// Get next autocommand command.
/// Called by do_cmdline() to get the next line for ":if".
/// @return allocated string, or NULL for end of autocommands.
@@ -2028,16 +2113,11 @@ char_u *getnextac(int c, void *cookie, int indent, bool do_concat)
current_sctx = ac->script_ctx;
if (ac->exec.type == CALLABLE_CB) {
- typval_T argsin = TV_INITIAL_VALUE;
- typval_T rettv = TV_INITIAL_VALUE;
- if (callback_call(&ac->exec.callable.cb, 0, &argsin, &rettv)) {
- if (ac->exec.callable.cb.type == kCallbackLua) {
- // If a Lua callback returns 'true' then the autocommand is removed
- oneshot = true;
- }
+ if (call_autocmd_callback(ac, acp)) {
+ // If an autocommand callback returns true, delete the autocommand
+ oneshot = true;
}
-
// TODO(tjdevries):
//
// Major Hack Alert:
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index b65fa77660..4948e2bb69 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -174,7 +174,7 @@ int open_buffer(int read_stdin, exarg_T *eap, int flags)
if (ml_open(curbuf) == FAIL) {
// There MUST be a memfile, otherwise we can't do anything
// If we can't create one for the current buffer, take another buffer
- close_buffer(NULL, curbuf, 0, false);
+ close_buffer(NULL, curbuf, 0, false, false);
curbuf = NULL;
FOR_ALL_BUFFERS(buf) {
@@ -402,8 +402,10 @@ bool buf_valid(buf_T *buf)
/// there to be only one window with this buffer. e.g. when
/// ":quit" is supposed to close the window but autocommands
/// close all other windows.
+/// @param ignore_abort
+/// If true, don't abort even when aborting() returns true.
/// @return true when we got to the end and b_nwindows was decremented.
-bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last)
+bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last, bool ignore_abort)
{
bool unload_buf = (action != 0);
bool del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
@@ -494,7 +496,8 @@ bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last)
return false;
}
}
- if (aborting()) { // autocmds may abort script processing
+ // autocmds may abort script processing
+ if (!ignore_abort && aborting()) {
return false;
}
}
@@ -552,14 +555,16 @@ bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last)
buf->b_nwindows = nwindows;
- buf_freeall(buf, (del_buf ? BFA_DEL : 0) + (wipe_buf ? BFA_WIPE : 0));
+ buf_freeall(buf, ((del_buf ? BFA_DEL : 0)
+ + (wipe_buf ? BFA_WIPE : 0)
+ + (ignore_abort ? BFA_IGNORE_ABORT : 0)));
if (!bufref_valid(&bufref)) {
// Autocommands may have deleted the buffer.
return false;
}
- if (aborting()) {
- // Autocmds may abort script processing.
+ // autocmds may abort script processing.
+ if (!ignore_abort && aborting()) {
return false;
}
@@ -660,9 +665,10 @@ void buf_clear(void)
/// buf_freeall() - free all things allocated for a buffer that are related to
/// the file. Careful: get here with "curwin" NULL when exiting.
///
-/// @param flags BFA_DEL buffer is going to be deleted
-/// BFA_WIPE buffer is going to be wiped out
-/// BFA_KEEP_UNDO do not free undo information
+/// @param flags BFA_DEL buffer is going to be deleted
+/// BFA_WIPE buffer is going to be wiped out
+/// BFA_KEEP_UNDO do not free undo information
+/// BFA_IGNORE_ABORT don't abort even when aborting() returns true
void buf_freeall(buf_T *buf, int flags)
{
bool is_curbuf = (buf == curbuf);
@@ -706,7 +712,8 @@ void buf_freeall(buf_T *buf, int flags)
goto_tabpage_win(the_curtab, the_curwin);
unblock_autocmds();
}
- if (aborting()) { // autocmds may abort script processing
+ // autocmds may abort script processing
+ if ((flags & BFA_IGNORE_ABORT) == 0 && aborting()) {
return;
}
@@ -877,7 +884,7 @@ void handle_swap_exists(bufref_T *old_curbuf)
// open a new, empty buffer.
swap_exists_action = SEA_NONE; // don't want it again
swap_exists_did_quit = true;
- close_buffer(curwin, curbuf, DOBUF_UNLOAD, false);
+ close_buffer(curwin, curbuf, DOBUF_UNLOAD, false, false);
if (old_curbuf == NULL
|| !bufref_valid(old_curbuf)
|| old_curbuf->br_buf == curbuf) {
@@ -1074,7 +1081,7 @@ static int empty_curbuf(int close_others, int forceit, int action)
// the old one. But do_ecmd() may have done that already, check
// if the buffer still exists.
if (buf != curbuf && bufref_valid(&bufref) && buf->b_nwindows == 0) {
- close_buffer(NULL, buf, action, false);
+ close_buffer(NULL, buf, action, false, false);
}
if (!close_others) {
@@ -1259,7 +1266,7 @@ int do_buffer(int action, int start, int dir, int count, int forceit)
if (buf != curbuf) {
close_windows(buf, false);
if (buf != curbuf && bufref_valid(&bufref) && buf->b_nwindows <= 0) {
- close_buffer(NULL, buf, action, false);
+ close_buffer(NULL, buf, action, false, false);
}
return OK;
}
@@ -1485,7 +1492,7 @@ void set_curbuf(buf_T *buf, int action)
? action
: (action == DOBUF_GOTO && !buf_hide(prevbuf)
&& !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0,
- false);
+ false, false);
if (curwin != previouswin && win_valid(previouswin)) {
// autocommands changed curwin, Grr!
curwin = previouswin;
@@ -2806,7 +2813,7 @@ int setfname(buf_T *buf, char_u *ffname_arg, char_u *sfname_arg, bool message)
return FAIL;
}
// delete from the list
- close_buffer(NULL, obuf, DOBUF_WIPE, false);
+ close_buffer(NULL, obuf, DOBUF_WIPE, false, false);
}
sfname = vim_strsave(sfname);
#ifdef USE_FNAME_CASE
@@ -5651,7 +5658,7 @@ void wipe_buffer(buf_T *buf, bool aucmd)
// Don't trigger BufDelete autocommands here.
block_autocmds();
}
- close_buffer(NULL, buf, DOBUF_WIPE, false);
+ close_buffer(NULL, buf, DOBUF_WIPE, false, true);
if (!aucmd) {
unblock_autocmds();
}
diff --git a/src/nvim/buffer.h b/src/nvim/buffer.h
index 850ab175a5..7f4bbcc9e5 100644
--- a/src/nvim/buffer.h
+++ b/src/nvim/buffer.h
@@ -58,9 +58,10 @@ enum dobuf_start_values {
// flags for buf_freeall()
enum bfa_values {
- BFA_DEL = 1, // buffer is going to be deleted
- BFA_WIPE = 2, // buffer is going to be wiped out
- BFA_KEEP_UNDO = 4, // do not free undo information
+ BFA_DEL = 1, // buffer is going to be deleted
+ BFA_WIPE = 2, // buffer is going to be wiped out
+ BFA_KEEP_UNDO = 4, // do not free undo information
+ BFA_IGNORE_ABORT = 8, // do not abort for aborting()
};
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/change.c b/src/nvim/change.c
index 0644b1d601..44abd69733 100644
--- a/src/nvim/change.c
+++ b/src/nvim/change.c
@@ -286,9 +286,11 @@ static void changed_common(linenr_T lnum, colnr_T col, linenr_T lnume, long xtra
set_topline(wp, wp->w_topline);
}
- // Relative numbering may require updating more.
+ // If lines have been added or removed, relative numbering always
+ // requires a redraw.
if (wp->w_p_rnu && xtra != 0) {
- redraw_later(wp, SOME_VALID);
+ wp->w_last_cursor_lnum_rnu = 0;
+ redraw_later(wp, VALID);
}
// Cursor line highlighting probably need to be updated with
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index a6bbe40999..0b55fb877c 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -743,11 +743,16 @@ static int diff_write_buffer(buf_T *buf, diffin_T *din)
for (linenr_T lnum = 1; lnum <= buf->b_ml.ml_line_count; lnum++) {
for (char_u *s = ml_get_buf(buf, lnum, false); *s != NUL;) {
if (diff_flags & DIFF_ICASE) {
+ int c;
char_u cbuf[MB_MAXBYTES + 1];
- // xdiff doesn't support ignoring case, fold-case the text.
- int c = utf_ptr2char(s);
- c = utf_fold(c);
+ if (*s == NL) {
+ c = NUL;
+ } else {
+ // xdiff doesn't support ignoring case, fold-case the text.
+ c = utf_ptr2char(s);
+ c = utf_fold(c);
+ }
const int orig_len = utfc_ptr2len(s);
if (utf_char2bytes(c, cbuf) != orig_len) {
// TODO(Bram): handle byte length difference
@@ -759,7 +764,8 @@ static int diff_write_buffer(buf_T *buf, diffin_T *din)
s += orig_len;
len += orig_len;
} else {
- ptr[len++] = *s++;
+ ptr[len++] = *s == NL ? NUL : *s;
+ s++;
}
}
ptr[len++] = NL;
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index da0b577056..3eb4ab9517 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -390,12 +390,9 @@ static void insert_enter(InsertState *s)
trigger_modechanged();
stop_insert_mode = false;
- // Need to recompute the cursor position, it might move when the cursor
- // is on a TAB or special character.
- // ptr2cells() treats a TAB character as double-width.
- if (ptr2cells(get_cursor_pos_ptr()) > 1) {
- curwin->w_valid &= ~VALID_VIRTCOL;
- curs_columns(curwin, true);
+ // need to position cursor again when on a TAB
+ if (gchar_cursor() == TAB) {
+ curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL);
}
// Enable langmap or IME, indicated by 'iminsert'.
@@ -1396,6 +1393,7 @@ static void insert_do_complete(InsertState *s)
compl_cont_status = 0;
}
compl_busy = false;
+ can_si = true; // allow smartindenting
}
static void insert_do_cindent(InsertState *s)
@@ -7330,21 +7328,21 @@ static void mb_replace_pop_ins(int cc)
// Not a multi-byte char, put it back.
replace_push(c);
break;
+ }
+
+ buf[0] = c;
+ assert(n > 1);
+ for (i = 1; i < n; i++) {
+ buf[i] = replace_pop();
+ }
+ if (utf_iscomposing(utf_ptr2char(buf))) {
+ ins_bytes_len(buf, n);
} else {
- buf[0] = c;
- assert(n > 1);
- for (i = 1; i < n; i++) {
- buf[i] = replace_pop();
- }
- if (utf_iscomposing(utf_ptr2char(buf))) {
- ins_bytes_len(buf, n);
- } else {
- // Not a composing char, put it back.
- for (i = n - 1; i >= 0; i--) {
- replace_push(buf[i]);
- }
- break;
+ // Not a composing char, put it back.
+ for (i = n - 1; i >= 0; i--) {
+ replace_push(buf[i]);
}
+ break;
}
}
}
@@ -8054,8 +8052,10 @@ static bool ins_esc(long *count, int cmdchar, bool nomove)
State = NORMAL;
trigger_modechanged();
- // need to position cursor again (e.g. when on a TAB )
- changed_cline_bef_curs();
+ // need to position cursor again when on a TAB
+ if (gchar_cursor() == TAB) {
+ curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL);
+ }
setmouse();
ui_cursor_shape(); // may show different cursor shape
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 5d5b342c35..98aabe89b3 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -2527,9 +2527,9 @@ int do_ecmd(int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T new
// Close the link to the current buffer. This will set
// oldwin->w_buffer to NULL.
u_sync(false);
- const bool did_decrement = close_buffer(oldwin, curbuf,
- (flags & ECMD_HIDE) || curbuf->terminal ? 0 : DOBUF_UNLOAD,
- false);
+ const bool did_decrement
+ = close_buffer(oldwin, curbuf, (flags & ECMD_HIDE) || curbuf->terminal ? 0 : DOBUF_UNLOAD,
+ false, false);
// Autocommands may have closed the window.
if (win_valid(the_curwin)) {
@@ -2875,7 +2875,7 @@ int do_ecmd(int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T new
redraw_curbuf_later(NOT_VALID); // redraw this buffer later
}
- if (p_im) {
+ if (p_im && (State & INSERT) == 0) {
need_start_insertmode = true;
}
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index bb6f3ba395..1f17101aca 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -1248,6 +1248,7 @@ static char_u *do_one_cmd(char_u **cmdlinep, int flags, cstack_T *cstack, LineGe
const int save_msg_scroll = msg_scroll;
cmdmod_T save_cmdmod;
const int save_reg_executing = reg_executing;
+ const bool save_pending_end_reg_executing = pending_end_reg_executing;
char_u *cmd;
memset(&ea, 0, sizeof(ea));
@@ -2018,6 +2019,7 @@ doend:
undo_cmdmod(&ea, save_msg_scroll);
cmdmod = save_cmdmod;
reg_executing = save_reg_executing;
+ pending_end_reg_executing = save_pending_end_reg_executing;
if (ea.did_sandbox) {
sandbox--;
@@ -8529,6 +8531,7 @@ bool save_current_state(save_state_T *sst)
sst->save_finish_op = finish_op;
sst->save_opcount = opcount;
sst->save_reg_executing = reg_executing;
+ sst->save_pending_end_reg_executing = pending_end_reg_executing;
msg_scroll = false; // no msg scrolling in Normal mode
restart_edit = 0; // don't go to Insert mode
@@ -8559,6 +8562,7 @@ void restore_current_state(save_state_T *sst)
finish_op = sst->save_finish_op;
opcount = sst->save_opcount;
reg_executing = sst->save_reg_executing;
+ pending_end_reg_executing = sst->save_pending_end_reg_executing;
// don't reset msg_didout now
msg_didout |= sst->save_msg_didout;
diff --git a/src/nvim/ex_docmd.h b/src/nvim/ex_docmd.h
index be9f97e27d..874e0e599e 100644
--- a/src/nvim/ex_docmd.h
+++ b/src/nvim/ex_docmd.h
@@ -29,6 +29,7 @@ typedef struct {
bool save_finish_op;
long save_opcount;
int save_reg_executing;
+ bool save_pending_end_reg_executing;
tasave_T tabuf;
} save_state_T;
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 9104a2dd5a..dd6e4630d2 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -6544,7 +6544,7 @@ static int open_cmdwin(void)
// win_close() may have already wiped the buffer when 'bh' is
// set to 'wipe', autocommands may have closed other windows
if (bufref_valid(&bufref) && bufref.br_buf != curbuf) {
- close_buffer(NULL, bufref.br_buf, DOBUF_WIPE, false);
+ close_buffer(NULL, bufref.br_buf, DOBUF_WIPE, false, false);
}
// Restore window sizes.
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index d68dda15f3..d4407b4982 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -1015,27 +1015,27 @@ retry:
}
read_buf_col += n;
break;
- } else {
- // Append whole line and new-line. Change NL
- // to NUL to reverse the effect done below.
- for (ni = 0; ni < n; ni++) {
- if (p[ni] == NL) {
- ptr[tlen++] = NUL;
- } else {
- ptr[tlen++] = p[ni];
- }
+ }
+
+ // Append whole line and new-line. Change NL
+ // to NUL to reverse the effect done below.
+ for (ni = 0; ni < n; ni++) {
+ if (p[ni] == NL) {
+ ptr[tlen++] = NUL;
+ } else {
+ ptr[tlen++] = p[ni];
}
- ptr[tlen++] = NL;
- read_buf_col = 0;
- if (++read_buf_lnum > from) {
- // When the last line didn't have an
- // end-of-line don't add it now either.
- if (!curbuf->b_p_eol) {
- --tlen;
- }
- size = tlen;
- break;
+ }
+ ptr[tlen++] = NL;
+ read_buf_col = 0;
+ if (++read_buf_lnum > from) {
+ // When the last line didn't have an
+ // end-of-line don't add it now either.
+ if (!curbuf->b_p_eol) {
+ tlen--;
}
+ size = tlen;
+ break;
}
}
}
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index eddd5ccd14..d615255828 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -1590,11 +1590,19 @@ int vgetc(void)
c = utf_ptr2char(buf);
}
- if ((mod_mask & MOD_MASK_CTRL) && (c >= '?' && c <= '_')) {
- c = Ctrl_chr(c);
- mod_mask &= ~MOD_MASK_CTRL;
- if (c == 0) { // <C-@> is <Nul>
- c = K_ZERO;
+ // A modifier was not used for a mapping, apply it to ASCII
+ // keys. Shift would already have been applied.
+ if (mod_mask & MOD_MASK_CTRL) {
+ if ((c >= '`' && c <= 0x7f) || (c >= '@' && c <= '_')) {
+ c &= 0x1f;
+ mod_mask &= ~MOD_MASK_CTRL;
+ if (c == 0) {
+ c = K_ZERO;
+ }
+ } else if (c == '6') {
+ // CTRL-6 is equivalent to CTRL-^
+ c = 0x1e;
+ mod_mask &= ~MOD_MASK_CTRL;
}
}
@@ -2060,7 +2068,7 @@ static int handle_mapping(int *keylenp, bool *timedout, int *mapdepth)
}
/// unget one character (can only be done once!)
-/// If the character was stuffed, vgetc() will get it next time it was called.
+/// If the character was stuffed, vgetc() will get it next time it is called.
/// Otherwise vgetc() will only get it when the stuff buffer is empty.
void vungetc(int c)
{
@@ -2072,6 +2080,20 @@ void vungetc(int c)
old_KeyStuffed = KeyStuffed;
}
+/// When peeking and not getting a character, reg_executing cannot be cleared
+/// yet, so set a flag to clear it later.
+void check_end_reg_executing(bool advance)
+{
+ if (reg_executing != 0 && (typebuf.tb_maplen == 0 || pending_end_reg_executing)) {
+ if (advance) {
+ reg_executing = 0;
+ pending_end_reg_executing = false;
+ } else {
+ pending_end_reg_executing = true;
+ }
+ }
+}
+
/// Gets a byte:
/// 1. from the stuffbuffer
/// This is used for abbreviated commands like "D" -> "d$".
@@ -2126,9 +2148,7 @@ static int vgetorpeek(bool advance)
init_typebuf();
start_stuff();
- if (advance && typebuf.tb_maplen == 0) {
- reg_executing = 0;
- }
+ check_end_reg_executing(advance);
do {
// get a character: 1. from the stuffbuffer
if (typeahead_char != 0) {
@@ -2155,6 +2175,7 @@ static int vgetorpeek(bool advance)
// If a mapped key sequence is found we go back to the start to
// try re-mapping.
for (;;) {
+ check_end_reg_executing(advance);
// os_breakcheck() is slow, don't use it too often when
// inside a mapping. But call it each time for typed
// characters.
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index ace7647b35..4aa49337cf 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -643,6 +643,8 @@ EXTERN bool ex_no_reprint INIT(=false); // No need to print after z or p.
EXTERN int reg_recording INIT(= 0); // register for recording or zero
EXTERN int reg_executing INIT(= 0); // register being executed or zero
+// Flag set when peeking a character and found the end of executed register
+EXTERN bool pending_end_reg_executing INIT(= false);
EXTERN int reg_recorded INIT(= 0); // last recorded register or zero
EXTERN int no_mapping INIT(= false); // currently no mapping allowed
diff --git a/src/nvim/memline.c b/src/nvim/memline.c
index 418887a6b1..5f6e1ea273 100644
--- a/src/nvim/memline.c
+++ b/src/nvim/memline.c
@@ -2327,95 +2327,88 @@ static int ml_append_int(buf_T *buf, linenr_T lnum, char_u *line, colnr_T len, b
* We are finished, break the loop here.
*/
break;
- } else { // pointer block full
- /*
- * split the pointer block
- * allocate a new pointer block
- * move some of the pointer into the new block
- * prepare for updating the parent block
- */
- for (;;) { // do this twice when splitting block 1
- hp_new = ml_new_ptr(mfp);
- if (hp_new == NULL) { // TODO: try to fix tree
- return FAIL;
- }
- pp_new = hp_new->bh_data;
-
- if (hp->bh_bnum != 1) {
- break;
- }
-
- /*
- * if block 1 becomes full the tree is given an extra level
- * The pointers from block 1 are moved into the new block.
- * block 1 is updated to point to the new block
- * then continue to split the new block
- */
- memmove(pp_new, pp, (size_t)page_size);
- pp->pb_count = 1;
- pp->pb_pointer[0].pe_bnum = hp_new->bh_bnum;
- pp->pb_pointer[0].pe_line_count = buf->b_ml.ml_line_count;
- pp->pb_pointer[0].pe_old_lnum = 1;
- pp->pb_pointer[0].pe_page_count = 1;
- mf_put(mfp, hp, true, false); // release block 1
- hp = hp_new; // new block is to be split
- pp = pp_new;
- CHECK(stack_idx != 0, _("stack_idx should be 0"));
- ip->ip_index = 0;
- ++stack_idx; // do block 1 again later
- }
- /*
- * move the pointers after the current one to the new block
- * If there are none, the new entry will be in the new block.
- */
- total_moved = pp->pb_count - pb_idx - 1;
- if (total_moved) {
- memmove(&pp_new->pb_pointer[0],
- &pp->pb_pointer[pb_idx + 1],
- (size_t)(total_moved) * sizeof(PTR_EN));
- pp_new->pb_count = total_moved;
- pp->pb_count -= total_moved - 1;
- pp->pb_pointer[pb_idx + 1].pe_bnum = bnum_right;
- pp->pb_pointer[pb_idx + 1].pe_line_count = line_count_right;
- pp->pb_pointer[pb_idx + 1].pe_page_count = page_count_right;
- if (lnum_right) {
- pp->pb_pointer[pb_idx + 1].pe_old_lnum = lnum_right;
- }
- } else {
- pp_new->pb_count = 1;
- pp_new->pb_pointer[0].pe_bnum = bnum_right;
- pp_new->pb_pointer[0].pe_line_count = line_count_right;
- pp_new->pb_pointer[0].pe_page_count = page_count_right;
- pp_new->pb_pointer[0].pe_old_lnum = lnum_right;
- }
- pp->pb_pointer[pb_idx].pe_bnum = bnum_left;
- pp->pb_pointer[pb_idx].pe_line_count = line_count_left;
- pp->pb_pointer[pb_idx].pe_page_count = page_count_left;
- if (lnum_left) {
- pp->pb_pointer[pb_idx].pe_old_lnum = lnum_left;
+ }
+ // pointer block full
+ //
+ // split the pointer block
+ // allocate a new pointer block
+ // move some of the pointer into the new block
+ // prepare for updating the parent block
+ for (;;) { // do this twice when splitting block 1
+ hp_new = ml_new_ptr(mfp);
+ if (hp_new == NULL) { // TODO(vim): try to fix tree
+ return FAIL;
}
- lnum_left = 0;
- lnum_right = 0;
+ pp_new = hp_new->bh_data;
- /*
- * recompute line counts
- */
- line_count_right = 0;
- for (i = 0; i < (int)pp_new->pb_count; ++i) {
- line_count_right += pp_new->pb_pointer[i].pe_line_count;
+ if (hp->bh_bnum != 1) {
+ break;
}
- line_count_left = 0;
- for (i = 0; i < (int)pp->pb_count; ++i) {
- line_count_left += pp->pb_pointer[i].pe_line_count;
+
+ // if block 1 becomes full the tree is given an extra level
+ // The pointers from block 1 are moved into the new block.
+ // block 1 is updated to point to the new block
+ // then continue to split the new block
+ memmove(pp_new, pp, (size_t)page_size);
+ pp->pb_count = 1;
+ pp->pb_pointer[0].pe_bnum = hp_new->bh_bnum;
+ pp->pb_pointer[0].pe_line_count = buf->b_ml.ml_line_count;
+ pp->pb_pointer[0].pe_old_lnum = 1;
+ pp->pb_pointer[0].pe_page_count = 1;
+ mf_put(mfp, hp, true, false); // release block 1
+ hp = hp_new; // new block is to be split
+ pp = pp_new;
+ CHECK(stack_idx != 0, _("stack_idx should be 0"));
+ ip->ip_index = 0;
+ stack_idx++; // do block 1 again later
+ }
+ // move the pointers after the current one to the new block
+ // If there are none, the new entry will be in the new block.
+ total_moved = pp->pb_count - pb_idx - 1;
+ if (total_moved) {
+ memmove(&pp_new->pb_pointer[0],
+ &pp->pb_pointer[pb_idx + 1],
+ (size_t)(total_moved) * sizeof(PTR_EN));
+ pp_new->pb_count = total_moved;
+ pp->pb_count -= total_moved - 1;
+ pp->pb_pointer[pb_idx + 1].pe_bnum = bnum_right;
+ pp->pb_pointer[pb_idx + 1].pe_line_count = line_count_right;
+ pp->pb_pointer[pb_idx + 1].pe_page_count = page_count_right;
+ if (lnum_right) {
+ pp->pb_pointer[pb_idx + 1].pe_old_lnum = lnum_right;
}
+ } else {
+ pp_new->pb_count = 1;
+ pp_new->pb_pointer[0].pe_bnum = bnum_right;
+ pp_new->pb_pointer[0].pe_line_count = line_count_right;
+ pp_new->pb_pointer[0].pe_page_count = page_count_right;
+ pp_new->pb_pointer[0].pe_old_lnum = lnum_right;
+ }
+ pp->pb_pointer[pb_idx].pe_bnum = bnum_left;
+ pp->pb_pointer[pb_idx].pe_line_count = line_count_left;
+ pp->pb_pointer[pb_idx].pe_page_count = page_count_left;
+ if (lnum_left) {
+ pp->pb_pointer[pb_idx].pe_old_lnum = lnum_left;
+ }
+ lnum_left = 0;
+ lnum_right = 0;
- bnum_left = hp->bh_bnum;
- bnum_right = hp_new->bh_bnum;
- page_count_left = 1;
- page_count_right = 1;
- mf_put(mfp, hp, true, false);
- mf_put(mfp, hp_new, true, false);
+ // recompute line counts
+ line_count_right = 0;
+ for (i = 0; i < (int)pp_new->pb_count; i++) {
+ line_count_right += pp_new->pb_pointer[i].pe_line_count;
}
+ line_count_left = 0;
+ for (i = 0; i < (int)pp->pb_count; i++) {
+ line_count_left += pp->pb_pointer[i].pe_line_count;
+ }
+
+ bnum_left = hp->bh_bnum;
+ bnum_right = hp_new->bh_bnum;
+ page_count_left = 1;
+ page_count_right = 1;
+ mf_put(mfp, hp, true, false);
+ mf_put(mfp, hp_new, true, false);
}
/*
diff --git a/src/nvim/memory.c b/src/nvim/memory.c
index 6cdc4f1fde..c895cc1ec6 100644
--- a/src/nvim/memory.c
+++ b/src/nvim/memory.c
@@ -691,7 +691,7 @@ void free_all_mem(void)
bufref_T bufref;
set_bufref(&bufref, buf);
nextbuf = buf->b_next;
- close_buffer(NULL, buf, DOBUF_WIPE, false);
+ close_buffer(NULL, buf, DOBUF_WIPE, false, false);
// Didn't work, try next one.
buf = bufref_valid(&bufref) ? nextbuf : firstbuf;
}
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 6522454aa5..f6037fc20a 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -5142,43 +5142,43 @@ char *set_option_value(const char *const name, const long number, const char *co
s = "";
}
return set_string_option(opt_idx, s, opt_flags);
- } else {
- varp = get_varp_scope(&(options[opt_idx]), opt_flags);
- if (varp != NULL) { // hidden option is not changed
- if (number == 0 && string != NULL) {
- int idx;
-
- // Either we are given a string or we are setting option
- // to zero.
- for (idx = 0; string[idx] == '0'; idx++) {}
- if (string[idx] != NUL || idx == 0) {
- // There's another character after zeros or the string
- // is empty. In both cases, we are trying to set a
- // num option using a string.
- semsg(_("E521: Number required: &%s = '%s'"),
- name, string);
- return NULL; // do nothing as we hit an error
- }
- }
- long numval = number;
- if (opt_flags & OPT_CLEAR) {
- if ((int *)varp == &curbuf->b_p_ar) {
- numval = -1;
- } else if ((long *)varp == &curbuf->b_p_ul) {
- numval = NO_LOCAL_UNDOLEVEL;
- } else if ((long *)varp == &curwin->w_p_so || (long *)varp == &curwin->w_p_siso) {
- numval = -1;
- } else {
- char *s = NULL;
- (void)get_option_value(name, &numval, (char_u **)&s, OPT_GLOBAL);
- }
+ }
+
+ varp = get_varp_scope(&(options[opt_idx]), opt_flags);
+ if (varp != NULL) { // hidden option is not changed
+ if (number == 0 && string != NULL) {
+ int idx;
+
+ // Either we are given a string or we are setting option
+ // to zero.
+ for (idx = 0; string[idx] == '0'; idx++) {}
+ if (string[idx] != NUL || idx == 0) {
+ // There's another character after zeros or the string
+ // is empty. In both cases, we are trying to set a
+ // num option using a string.
+ semsg(_("E521: Number required: &%s = '%s'"),
+ name, string);
+ return NULL; // do nothing as we hit an error
}
- if (flags & P_NUM) {
- return set_num_option(opt_idx, varp, numval, NULL, 0, opt_flags);
+ }
+ long numval = number;
+ if (opt_flags & OPT_CLEAR) {
+ if ((int *)varp == &curbuf->b_p_ar) {
+ numval = -1;
+ } else if ((long *)varp == &curbuf->b_p_ul) {
+ numval = NO_LOCAL_UNDOLEVEL;
+ } else if ((long *)varp == &curwin->w_p_so || (long *)varp == &curwin->w_p_siso) {
+ numval = -1;
} else {
- return set_bool_option(opt_idx, varp, (int)numval, opt_flags);
+ char *s = NULL;
+ (void)get_option_value(name, &numval, (char_u **)&s, OPT_GLOBAL);
}
}
+ if (flags & P_NUM) {
+ return set_num_option(opt_idx, varp, numval, NULL, 0, opt_flags);
+ } else {
+ return set_bool_option(opt_idx, varp, (int)numval, opt_flags);
+ }
}
}
return NULL;
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 1d589e8ca0..4ad5e40fee 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -1721,7 +1721,7 @@ static void wipe_qf_buffer(qf_info_T *qi)
if (qfbuf != NULL && qfbuf->b_nwindows == 0) {
// If the quickfix buffer is not loaded in any window, then
// wipe the buffer.
- close_buffer(NULL, qfbuf, DOBUF_WIPE, false);
+ close_buffer(NULL, qfbuf, DOBUF_WIPE, false, false);
qi->qf_bufnr = INVALID_QFBUFNR;
}
}
@@ -5843,7 +5843,7 @@ static void wipe_dummy_buffer(buf_T *buf, char_u *dirname_start)
static void unload_dummy_buffer(buf_T *buf, char_u *dirname_start)
{
if (curbuf != buf) { // safety check
- close_buffer(NULL, buf, DOBUF_UNLOAD, false);
+ close_buffer(NULL, buf, DOBUF_UNLOAD, false, true);
// When autocommands/'autochdir' option changed directory: go back.
restore_start_dir(dirname_start);
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index 2d617bba4b..9fa594bc96 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -3066,7 +3066,7 @@ void spell_suggest(int count)
ml_replace(curwin->w_cursor.lnum, p, false);
curwin->w_cursor.col = c;
- changed_bytes(curwin->w_cursor.lnum, c);
+ inserted_bytes(curwin->w_cursor.lnum, c, stp->st_orglen, stp->st_wordlen);
} else {
curwin->w_cursor = prev_cursor;
}
diff --git a/src/nvim/state.c b/src/nvim/state.c
index 3a7636085b..34e3ddf654 100644
--- a/src/nvim/state.c
+++ b/src/nvim/state.c
@@ -40,7 +40,7 @@ void state_enter(VimState *s)
int key;
getkey:
- // Expand mappings first by calling vpeekc() directly.
+ // Apply mappings first by calling vpeekc() directly.
// - If vpeekc() returns non-NUL, there is a character already available for processing, so
// don't block for events. vgetc() may still block, in case of an incomplete UTF-8 sequence.
// - If vpeekc() returns NUL, vgetc() will block, and there are three cases:
@@ -76,6 +76,9 @@ getkey:
}
if (key == K_EVENT) {
+ // An event handler may use the value of reg_executing.
+ // Clear it if it should be cleared when getting the next character.
+ check_end_reg_executing(true);
may_sync_undo();
}
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index a82e8fa103..d884ad704b 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -2289,55 +2289,52 @@ static void check_state_ends(void)
next_match_idx = 0;
next_match_col = MAXCOL;
break;
- } else {
- // handle next_list, unless at end of line and no "skipnl" or
- // "skipempty"
- current_next_list = cur_si->si_next_list;
- current_next_flags = cur_si->si_flags;
- if (!(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY))
- && syn_getcurline()[current_col] == NUL) {
- current_next_list = NULL;
- }
+ }
+
+ // handle next_list, unless at end of line and no "skipnl" or
+ // "skipempty"
+ current_next_list = cur_si->si_next_list;
+ current_next_flags = cur_si->si_flags;
+ if (!(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY))
+ && syn_getcurline()[current_col] == NUL) {
+ current_next_list = NULL;
+ }
+
+ // When the ended item has "extend", another item with
+ // "keepend" now needs to check for its end.
+ had_extend = (cur_si->si_flags & HL_EXTEND);
- // When the ended item has "extend", another item with
- // "keepend" now needs to check for its end.
- had_extend = (cur_si->si_flags & HL_EXTEND);
+ pop_current_state();
- pop_current_state();
+ if (GA_EMPTY(&current_state)) {
+ break;
+ }
+ if (had_extend && keepend_level >= 0) {
+ syn_update_ends(false);
if (GA_EMPTY(&current_state)) {
break;
}
+ }
- if (had_extend && keepend_level >= 0) {
- syn_update_ends(false);
- if (GA_EMPTY(&current_state)) {
- break;
- }
- }
-
- cur_si = &CUR_STATE(current_state.ga_len - 1);
+ cur_si = &CUR_STATE(current_state.ga_len - 1);
- /*
- * Only for a region the search for the end continues after
- * the end of the contained item. If the contained match
- * included the end-of-line, break here, the region continues.
- * Don't do this when:
- * - "keepend" is used for the contained item
- * - not at the end of the line (could be end="x$"me=e-1).
- * - "excludenl" is used (HL_HAS_EOL won't be set)
- */
- if (cur_si->si_idx >= 0
- && SYN_ITEMS(syn_block)[cur_si->si_idx].sp_type
- == SPTYPE_START
- && !(cur_si->si_flags & (HL_MATCH | HL_KEEPEND))) {
- update_si_end(cur_si, (int)current_col, true);
- check_keepend();
- if ((current_next_flags & HL_HAS_EOL)
- && keepend_level < 0
- && syn_getcurline()[current_col] == NUL) {
- break;
- }
+ // Only for a region the search for the end continues after
+ // the end of the contained item. If the contained match
+ // included the end-of-line, break here, the region continues.
+ // Don't do this when:
+ // - "keepend" is used for the contained item
+ // - not at the end of the line (could be end="x$"me=e-1).
+ // - "excludenl" is used (HL_HAS_EOL won't be set)
+ if (cur_si->si_idx >= 0
+ && SYN_ITEMS(syn_block)[cur_si->si_idx].sp_type == SPTYPE_START
+ && !(cur_si->si_flags & (HL_MATCH | HL_KEEPEND))) {
+ update_si_end(cur_si, (int)current_col, true);
+ check_keepend();
+ if ((current_next_flags & HL_HAS_EOL)
+ && keepend_level < 0
+ && syn_getcurline()[current_col] == NUL) {
+ break;
}
}
} else {
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 76c69ad10b..c1a120efa4 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -299,6 +299,40 @@ func Test_WinClosed()
unlet g:triggered
endfunc
+func Test_WinClosed_throws()
+ vnew
+ let bnr = bufnr()
+ call assert_equal(1, bufloaded(bnr))
+ augroup test-WinClosed
+ autocmd WinClosed * throw 'foo'
+ augroup END
+ try
+ close
+ catch /.*/
+ endtry
+ call assert_equal(0, bufloaded(bnr))
+
+ autocmd! test-WinClosed
+ augroup! test-WinClosed
+endfunc
+
+func Test_WinClosed_throws_with_tabs()
+ tabnew
+ let bnr = bufnr()
+ call assert_equal(1, bufloaded(bnr))
+ augroup test-WinClosed
+ autocmd WinClosed * throw 'foo'
+ augroup END
+ try
+ close
+ catch /.*/
+ endtry
+ call assert_equal(0, bufloaded(bnr))
+
+ autocmd! test-WinClosed
+ augroup! test-WinClosed
+endfunc
+
func s:AddAnAutocmd()
augroup vimBarTest
au BufReadCmd * echo 'hello'
diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim
index 10eb979b45..be9a77ee75 100644
--- a/src/nvim/testdir/test_diffmode.vim
+++ b/src/nvim/testdir/test_diffmode.vim
@@ -1295,4 +1295,41 @@ func Test_diff_filler_cursorcolumn()
endfunc
+func Test_diff_binary()
+ CheckScreendump
+
+ let content =<< trim END
+ call setline(1, ['a', 'b', "c\n", 'd', 'e', 'f', 'g'])
+ vnew
+ call setline(1, ['A', 'b', 'c', 'd', 'E', 'f', 'g'])
+ windo diffthis
+ wincmd p
+ norm! gg0
+ redraw!
+ END
+ call writefile(content, 'Xtest_diff_bin')
+ let buf = RunVimInTerminal('-S Xtest_diff_bin', {})
+
+ " Test using internal diff
+ call VerifyScreenDump(buf, 'Test_diff_bin_01', {})
+
+ " Test using internal diff and case folding
+ call term_sendkeys(buf, ":set diffopt+=icase\<cr>")
+ call term_sendkeys(buf, "\<C-l>")
+ call VerifyScreenDump(buf, 'Test_diff_bin_02', {})
+ " Test using external diff
+ call term_sendkeys(buf, ":set diffopt=filler\<cr>")
+ call term_sendkeys(buf, "\<C-l>")
+ call VerifyScreenDump(buf, 'Test_diff_bin_03', {})
+ " Test using external diff and case folding
+ call term_sendkeys(buf, ":set diffopt=filler,icase\<cr>")
+ call term_sendkeys(buf, "\<C-l>")
+ call VerifyScreenDump(buf, 'Test_diff_bin_04', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('Xtest_diff_bin')
+ set diffopt&vim
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim
index 360b3aaaa0..eea5d190b2 100644
--- a/src/nvim/testdir/test_edit.vim
+++ b/src/nvim/testdir/test_edit.vim
@@ -1627,6 +1627,29 @@ func Test_edit_is_a_directory()
call delete(dirname, 'rf')
endfunc
+" Using :edit without leaving 'insertmode' should not cause Insert mode to be
+" re-entered immediately after <C-L>
+func Test_edit_insertmode_ex_edit()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ set insertmode noruler
+ inoremap <C-B> <Cmd>edit Xfoo<CR>
+ END
+ call writefile(lines, 'Xtest_edit_insertmode_ex_edit')
+
+ let buf = RunVimInTerminal('-S Xtest_edit_insertmode_ex_edit', #{rows: 6})
+ call TermWait(buf, 50)
+ call assert_match('^-- INSERT --\s*$', term_getline(buf, 6))
+ call term_sendkeys(buf, "\<C-B>\<C-L>")
+ call TermWait(buf, 50)
+ call assert_notmatch('^-- INSERT --\s*$', term_getline(buf, 6))
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('Xtest_edit_insertmode_ex_edit')
+endfunc
+
func Test_edit_browse()
" in the GUI this opens a file picker, we only test the terminal behavior
CheckNotGui
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim
index 720c003ace..9feab735e4 100644
--- a/src/nvim/testdir/test_filetype.vim
+++ b/src/nvim/testdir/test_filetype.vim
@@ -290,6 +290,7 @@ let s:filename_checks = {
\ 'kivy': ['file.kv'],
\ 'kix': ['file.kix'],
\ 'kotlin': ['file.kt', 'file.ktm', 'file.kts'],
+ \ 'krl': ['file.sub', 'file.Sub', 'file.SUB'],
\ 'kscript': ['file.ks'],
\ 'kwt': ['file.k'],
\ 'lace': ['file.ace', 'file.ACE'],
@@ -394,7 +395,7 @@ let s:filename_checks = {
\ 'perl': ['file.plx', 'file.al', 'file.psgi', 'gitolite.rc', '.gitolite.rc', 'example.gitolite.rc'],
\ 'pf': ['pf.conf'],
\ 'pfmain': ['main.cf'],
- \ 'php': ['file.php', 'file.php9', 'file.phtml', 'file.ctp'],
+ \ 'php': ['file.php', 'file.php9', 'file.phtml', 'file.ctp', 'file.phpt'],
\ 'lpc': ['file.lpc', 'file.ulpc'],
\ 'pike': ['file.pike', 'file.pmod'],
\ 'cmod': ['file.cmod'],
@@ -454,7 +455,7 @@ let s:filename_checks = {
\ 'rpl': ['file.rpl'],
\ 'rst': ['file.rst'],
\ 'rtf': ['file.rtf'],
- \ 'ruby': ['.irbrc', 'irbrc', 'file.rb', 'file.rbw', 'file.gemspec', 'file.ru', 'Gemfile', 'file.builder', 'file.rxml', 'file.rjs', 'file.rant', 'file.rake', 'rakefile', 'Rakefile', 'rantfile', 'Rantfile', 'rakefile-file', 'Rakefile-file', 'Puppetfile'],
+ \ 'ruby': ['.irbrc', 'irbrc', 'file.rb', 'file.rbw', 'file.gemspec', 'file.ru', 'Gemfile', 'file.builder', 'file.rxml', 'file.rjs', 'file.rant', 'file.rake', 'rakefile', 'Rakefile', 'rantfile', 'Rantfile', 'rakefile-file', 'Rakefile-file', 'Puppetfile', 'Vagrantfile'],
\ 'rust': ['file.rs'],
\ 'samba': ['smb.conf'],
\ 'sas': ['file.sas'],
@@ -842,6 +843,30 @@ func Test_d_file()
filetype off
endfunc
+func Test_dat_file()
+ filetype on
+
+ call writefile(['&ACCESS'], 'datfile.dat')
+ split datfile.dat
+ call assert_equal('krl', &filetype)
+ bwipe!
+ call delete('datfile.dat')
+
+ call writefile([' DEFDAT datfile'], 'datfile.Dat')
+ split datfile.Dat
+ call assert_equal('krl', &filetype)
+ bwipe!
+ call delete('datfile.Dat')
+
+ call writefile(['', 'defdat datfile'], 'datfile.DAT')
+ split datfile.DAT
+ call assert_equal('krl', &filetype)
+ bwipe!
+ call delete('datfile.DAT')
+
+ filetype off
+endfunc
+
func Test_dep3patch_file()
filetype on
@@ -1284,6 +1309,30 @@ func Test_pp_file()
filetype off
endfunc
+func Test_src_file()
+ filetype on
+
+ call writefile(['&ACCESS'], 'srcfile.src')
+ split srcfile.src
+ call assert_equal('krl', &filetype)
+ bwipe!
+ call delete('srcfile.src')
+
+ call writefile([' DEF srcfile()'], 'srcfile.Src')
+ split srcfile.Src
+ call assert_equal('krl', &filetype)
+ bwipe!
+ call delete('srcfile.Src')
+
+ call writefile(['', 'global def srcfile()'], 'srcfile.SRC')
+ split srcfile.SRC
+ call assert_equal('krl', &filetype)
+ bwipe!
+ call delete('srcfile.SRC')
+
+ filetype off
+endfunc
+
func Test_tex_file()
filetype on
diff --git a/src/nvim/testdir/test_highlight.vim b/src/nvim/testdir/test_highlight.vim
index 5588e515e1..efdf44a0d6 100644
--- a/src/nvim/testdir/test_highlight.vim
+++ b/src/nvim/testdir/test_highlight.vim
@@ -615,6 +615,14 @@ func Test_cursorcolumn_insert_on_tab()
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_cursorcolumn_insert_on_tab_2', {})
+ call term_sendkeys(buf, "\<C-O>")
+ call TermWait(buf)
+ call VerifyScreenDump(buf, 'Test_cursorcolumn_insert_on_tab_3', {})
+
+ call term_sendkeys(buf, 'i')
+ call TermWait(buf)
+ call VerifyScreenDump(buf, 'Test_cursorcolumn_insert_on_tab_2', {})
+
call StopVimInTerminal(buf)
call delete('Xcuc_insert_on_tab')
endfunc
diff --git a/src/nvim/testdir/test_ins_complete.vim b/src/nvim/testdir/test_ins_complete.vim
index 186fa8871f..24eaf9e8b1 100644
--- a/src/nvim/testdir/test_ins_complete.vim
+++ b/src/nvim/testdir/test_ins_complete.vim
@@ -707,4 +707,23 @@ func Test_z1_complete_no_history()
close!
endfunc
+func FooBarComplete(findstart, base)
+ if a:findstart
+ return col('.') - 1
+ else
+ return ["Foo", "Bar", "}"]
+ endif
+endfunc
+
+func Test_complete_smartindent()
+ new
+ setlocal smartindent completefunc=FooBarComplete
+
+ exe "norm! o{\<cr>\<c-x>\<c-u>\<c-p>}\<cr>\<esc>"
+ let result = getline(1,'$')
+ call assert_equal(['', '{','}',''], result)
+ bw!
+ delfunction! FooBarComplete
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_registers.vim b/src/nvim/testdir/test_registers.vim
index f78b748d71..c623edd5a1 100644
--- a/src/nvim/testdir/test_registers.vim
+++ b/src/nvim/testdir/test_registers.vim
@@ -690,5 +690,23 @@ func Test_record_in_select_mode()
bwipe!
endfunc
+func Test_end_reg_executing()
+ nnoremap s <Nop>
+ let @a = 's'
+ call feedkeys("@aqaq\<Esc>", 'tx')
+ call assert_equal('', @a)
+ call assert_equal('', getline(1))
+
+ call setline(1, 'aaa')
+ nnoremap s qa
+ let @a = 'fa'
+ call feedkeys("@asq\<Esc>", 'tx')
+ call assert_equal('', @a)
+ call assert_equal('aaa', getline(1))
+
+ nunmap s
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_trycatch.vim b/src/nvim/testdir/test_trycatch.vim
index 7e513180a3..adc1745b39 100644
--- a/src/nvim/testdir/test_trycatch.vim
+++ b/src/nvim/testdir/test_trycatch.vim
@@ -1972,6 +1972,29 @@ func Test_builtin_func_error()
call assert_equal('jlmnpqrtueghivyzACD', g:Xpath)
endfunc
-" Modelines {{{1
+func Test_reload_in_try_catch()
+ call writefile(['x'], 'Xreload')
+ set autoread
+ edit Xreload
+ tabnew
+ call writefile(['xx'], 'Xreload')
+ augroup ReLoad
+ au FileReadPost Xreload let x = doesnotexist
+ au BufReadPost Xreload let x = doesnotexist
+ augroup END
+ try
+ edit Xreload
+ catch
+ endtry
+ tabnew
+
+ tabclose
+ tabclose
+ autocmd! ReLoad
+ set noautoread
+ bwipe! Xreload
+ call delete('Xreload')
+endfunc
+
+" Modeline {{{1
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
-"-------------------------------------------------------------------------------
diff --git a/src/nvim/window.c b/src/nvim/window.c
index cc21bf25b0..9aa2f947cb 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -2541,6 +2541,41 @@ static bool close_last_window_tabpage(win_T *win, bool free_buf, tabpage_T *prev
return true;
}
+/// Close the buffer of "win" and unload it if "free_buf" is true.
+/// "abort_if_last" is passed to close_buffer(): abort closing if all other
+/// windows are closed.
+static void win_close_buffer(win_T *win, bool free_buf, bool abort_if_last)
+{
+ // Free independent synblock before the buffer is freed.
+ if (win->w_buffer != NULL) {
+ reset_synblock(win);
+ }
+
+ // When a quickfix/location list window is closed and the buffer is
+ // displayed in only one window, then unlist the buffer.
+ if (win->w_buffer != NULL && bt_quickfix(win->w_buffer)
+ && win->w_buffer->b_nwindows == 1) {
+ win->w_buffer->b_p_bl = false;
+ }
+
+ // Close the link to the buffer.
+ if (win->w_buffer != NULL) {
+ bufref_T bufref;
+ set_bufref(&bufref, curbuf);
+ win->w_closing = true;
+ close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, abort_if_last, true);
+ if (win_valid_any_tab(win)) {
+ win->w_closing = false;
+ }
+
+ // Make sure curbuf is valid. It can become invalid if 'bufhidden' is
+ // "wipe".
+ if (!bufref_valid(&bufref)) {
+ curbuf = firstbuf;
+ }
+ }
+}
+
// Close window "win". Only works for the current tab page.
// If "free_buf" is true related buffer may be unloaded.
//
@@ -2679,36 +2714,7 @@ int win_close(win_T *win, bool free_buf, bool force)
return OK;
}
- // Free independent synblock before the buffer is freed.
- if (win->w_buffer != NULL) {
- reset_synblock(win);
- }
-
- // When a quickfix/location list window is closed and the buffer is
- // displayed in only one window, then unlist the buffer.
- if (win->w_buffer != NULL && bt_quickfix(win->w_buffer)
- && win->w_buffer->b_nwindows == 1) {
- win->w_buffer->b_p_bl = false;
- }
-
- /*
- * Close the link to the buffer.
- */
- if (win->w_buffer != NULL) {
- bufref_T bufref;
- set_bufref(&bufref, curbuf);
- win->w_closing = true;
- close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, true);
- if (win_valid_any_tab(win)) {
- win->w_closing = false;
- }
-
- // Make sure curbuf is valid. It can become invalid if 'bufhidden' is
- // "wipe".
- if (!bufref_valid(&bufref)) {
- curbuf = firstbuf;
- }
- }
+ win_close_buffer(win, free_buf, true);
if (only_one_window() && win_valid(win) && win->w_buffer == NULL
&& (last_window(win) || curtab != prev_curtab
@@ -2879,7 +2885,7 @@ void win_close_othertab(win_T *win, int free_buf, tabpage_T *tp)
if (win->w_buffer != NULL) {
// Close the link to the buffer.
- close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, false);
+ close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, false, true);
}
// Careful: Autocommands may have closed the tab page or made it the
diff --git a/test/functional/api/autocmd_spec.lua b/test/functional/api/autocmd_spec.lua
index b4a9a4f01f..377b4fecf0 100644
--- a/test/functional/api/autocmd_spec.lua
+++ b/test/functional/api/autocmd_spec.lua
@@ -182,6 +182,54 @@ describe('autocmd api', function()
meths.exec_autocmds("User", {pattern = "Test"})
eq({}, meths.get_autocmds({event = "User", pattern = "Test"}))
end)
+
+ it('receives an args table', function()
+ local res = exec_lua [[
+ local group_id = vim.api.nvim_create_augroup("TestGroup", {})
+ local autocmd_id = vim.api.nvim_create_autocmd("User", {
+ group = "TestGroup",
+ pattern = "Te*",
+ callback = function(args)
+ vim.g.autocmd_args = args
+ end,
+ })
+
+ return {group_id, autocmd_id}
+ ]]
+
+ meths.exec_autocmds("User", {pattern = "Test pattern"})
+ eq({
+ id = res[2],
+ group = res[1],
+ event = "User",
+ match = "Test pattern",
+ file = "Test pattern",
+ buf = 1,
+ }, meths.get_var("autocmd_args"))
+
+ -- Test without a group
+ res = exec_lua [[
+ local autocmd_id = vim.api.nvim_create_autocmd("User", {
+ pattern = "*",
+ callback = function(args)
+ vim.g.autocmd_args = args
+ end,
+ })
+
+ return {autocmd_id}
+ ]]
+
+ meths.exec_autocmds("User", {pattern = "some_pat"})
+ eq({
+ id = res[1],
+ group = nil,
+ event = "User",
+ match = "some_pat",
+ file = "some_pat",
+ buf = 1,
+ }, meths.get_var("autocmd_args"))
+
+ end)
end)
describe('nvim_get_autocmds', function()
diff --git a/test/functional/autocmd/show_spec.lua b/test/functional/autocmd/show_spec.lua
index 59757a7d61..505bed834b 100644
--- a/test/functional/autocmd/show_spec.lua
+++ b/test/functional/autocmd/show_spec.lua
@@ -1,13 +1,19 @@
local helpers = require('test.functional.helpers')(after_each)
+local Screen = require('test.functional.ui.screen')
local clear = helpers.clear
local command = helpers.command
local dedent = helpers.dedent
local eq = helpers.eq
local funcs = helpers.funcs
+local eval = helpers.eval
+local exec = helpers.exec
+local feed = helpers.feed
describe(":autocmd", function()
- before_each(clear)
+ before_each(function()
+ clear({'-u', 'NONE'})
+ end)
it("should not segfault when you just do autocmd", function()
command ":autocmd"
@@ -30,6 +36,148 @@ describe(":autocmd", function()
* :echo "Line 1"
:echo "Line 2"]]),
funcs.execute('autocmd BufEnter'))
+ end)
+
+ it('should not show group information if interrupted', function()
+ local screen = Screen.new(50, 6)
+ screen:set_default_attr_ids({
+ [1] = {bold = true, foreground = Screen.colors.Blue1}, -- NonText
+ [2] = {bold = true, foreground = Screen.colors.SeaGreen}, -- MoreMsg
+ [3] = {bold = true, foreground = Screen.colors.Magenta}, -- Title
+ })
+ screen:attach()
+ exec([[
+ set more
+ autocmd! BufEnter
+ augroup test_1
+ autocmd BufEnter A echo 'A'
+ autocmd BufEnter B echo 'B'
+ autocmd BufEnter C echo 'C'
+ autocmd BufEnter D echo 'D'
+ autocmd BufEnter E echo 'E'
+ autocmd BufEnter F echo 'F'
+ augroup END
+ autocmd! BufLeave
+ augroup test_1
+ autocmd BufLeave A echo 'A'
+ autocmd BufLeave B echo 'B'
+ autocmd BufLeave C echo 'C'
+ autocmd BufLeave D echo 'D'
+ autocmd BufLeave E echo 'E'
+ autocmd BufLeave F echo 'F'
+ augroup END
+ ]])
+ feed(':autocmd<CR>')
+ screen:expect([[
+ :autocmd |
+ {3:--- Autocommands ---} |
+ {3:test_1} {3:BufEnter} |
+ A echo 'A' |
+ B echo 'B' |
+ {2:-- More --}^ |
+ ]])
+ feed('q')
+ screen:expect([[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]])
+ end)
+
+ it('should not show group information for deleted pattern', function()
+ exec([[
+ autocmd! BufEnter
+ augroup test_1
+ autocmd BufEnter A echo 'A'
+ autocmd BufEnter B echo 'B'
+ autocmd BufEnter C echo 'C'
+ augroup END
+ augroup test_2
+ autocmd BufEnter foo echo 'foo'
+ augroup END
+ augroup test_3
+ autocmd BufEnter D echo 'D'
+ autocmd BufEnter E echo 'E'
+ autocmd BufEnter F echo 'F'
+ augroup END
+
+ func Func()
+ autocmd! test_2 BufEnter
+ let g:output = execute('autocmd BufEnter')
+ endfunc
+
+ autocmd User foo call Func()
+ doautocmd User foo
+ ]])
+ eq(dedent([[
+
+ --- Autocommands ---
+ test_1 BufEnter
+ A echo 'A'
+ B echo 'B'
+ C echo 'C'
+ test_3 BufEnter
+ D echo 'D'
+ E echo 'E'
+ F echo 'F']]), eval('g:output'))
+ end)
+
+ it('can filter by pattern #17973', function()
+ exec([[
+ autocmd! BufEnter
+ autocmd! User
+ augroup test_1
+ autocmd BufEnter A echo "A1"
+ autocmd BufEnter B echo "B1"
+ autocmd User A echo "A1"
+ autocmd User B echo "B1"
+ augroup END
+ augroup test_2
+ autocmd BufEnter A echo "A2"
+ autocmd BufEnter B echo "B2"
+ autocmd User A echo "A2"
+ autocmd User B echo "B2"
+ augroup END
+ augroup test_3
+ autocmd BufEnter A echo "A3"
+ autocmd BufEnter B echo "B3"
+ autocmd User A echo "A3"
+ autocmd User B echo "B3"
+ augroup END
+ ]])
+ eq(dedent([[
+
+ --- Autocommands ---
+ test_1 User
+ A echo "A1"
+ test_2 User
+ A echo "A2"
+ test_3 User
+ A echo "A3"]]), funcs.execute('autocmd User A'))
+ eq(dedent([[
+
+ --- Autocommands ---
+ test_1 BufEnter
+ B echo "B1"
+ test_2 BufEnter
+ B echo "B2"
+ test_3 BufEnter
+ B echo "B3"
+ test_1 User
+ B echo "B1"
+ test_2 User
+ B echo "B2"
+ test_3 User
+ B echo "B3"]]), funcs.execute('autocmd * B'))
+ eq(dedent([[
+ --- Autocommands ---
+ test_3 BufEnter
+ B echo "B3"
+ test_3 User
+ B echo "B3"]]), funcs.execute('autocmd test_3 * B'))
end)
end)
diff --git a/test/functional/editor/macro_spec.lua b/test/functional/editor/macro_spec.lua
index c0c9256af2..d4cf6b28fd 100644
--- a/test/functional/editor/macro_spec.lua
+++ b/test/functional/editor/macro_spec.lua
@@ -6,11 +6,14 @@ local feed = helpers.feed
local clear = helpers.clear
local expect = helpers.expect
local command = helpers.command
+local funcs = helpers.funcs
+local meths = helpers.meths
local insert = helpers.insert
local curbufmeths = helpers.curbufmeths
+before_each(clear)
+
describe('macros', function()
- before_each(clear)
it('can be recorded and replayed', function()
feed('qiahello<esc>q')
expect('hello')
@@ -47,9 +50,47 @@ hello]]
end)
end)
-describe('reg_recorded()', function()
- before_each(clear)
+describe('immediately after a macro has finished executing,', function()
+ before_each(function()
+ command([[let @a = 'gg0']])
+ end)
+
+ describe('reg_executing() from RPC returns an empty string', function()
+ it('if the macro does not end with a <Nop> mapping', function()
+ feed('@a')
+ eq('', funcs.reg_executing())
+ end)
+
+ it('if the macro ends with a <Nop> mapping', function()
+ command('nnoremap 0 <Nop>')
+ feed('@a')
+ eq('', funcs.reg_executing())
+ end)
+ end)
+ describe('characters from a mapping are not treated as a part of the macro #18015', function()
+ before_each(function()
+ command('nnoremap s qa')
+ end)
+
+ it('if the macro does not end with a <Nop> mapping', function()
+ feed('@asq') -- "q" from "s" mapping should start recording a macro instead of being no-op
+ eq({mode = 'n', blocking = false}, meths.get_mode())
+ expect('')
+ eq('', eval('@a'))
+ end)
+
+ it('if the macro ends with a <Nop> mapping', function()
+ command('nnoremap 0 <Nop>')
+ feed('@asq') -- "q" from "s" mapping should start recording a macro instead of being no-op
+ eq({mode = 'n', blocking = false}, meths.get_mode())
+ expect('')
+ eq('', eval('@a'))
+ end)
+ end)
+end)
+
+describe('reg_recorded()', function()
it('returns the correct value', function()
feed [[qqyyq]]
eq('q', eval('reg_recorded()'))
diff --git a/test/functional/editor/mode_insert_spec.lua b/test/functional/editor/mode_insert_spec.lua
index 528e228121..c38acbe96a 100644
--- a/test/functional/editor/mode_insert_spec.lua
+++ b/test/functional/editor/mode_insert_spec.lua
@@ -6,6 +6,8 @@ local expect = helpers.expect
local command = helpers.command
local eq = helpers.eq
local eval = helpers.eval
+local meths = helpers.meths
+local poke_eventloop = helpers.poke_eventloop
describe('insert-mode', function()
before_each(function()
@@ -128,4 +130,26 @@ describe('insert-mode', function()
expect('<M-1><D-2><M-7><D-8>')
end)
end)
+
+ describe([[With 'insertmode', Insert mode is not re-entered immediately after <C-L>]], function()
+ before_each(function()
+ command('set insertmode')
+ poke_eventloop()
+ eq({mode = 'i', blocking = false}, meths.get_mode())
+ end)
+
+ it('after calling :edit from <Cmd> mapping', function()
+ command('inoremap <C-B> <Cmd>edit Xfoo<CR>')
+ feed('<C-B><C-L>')
+ poke_eventloop()
+ eq({mode = 'n', blocking = false}, meths.get_mode())
+ end)
+
+ it('after calling :edit from RPC #16823', function()
+ command('edit Xfoo')
+ feed('<C-L>')
+ poke_eventloop()
+ eq({mode = 'n', blocking = false}, meths.get_mode())
+ end)
+ end)
end)
diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua
index c83a50b78b..cbd78ccd53 100644
--- a/test/functional/lua/buffer_updates_spec.lua
+++ b/test/functional/lua/buffer_updates_spec.lua
@@ -1104,6 +1104,15 @@ describe('lua: nvim_buf_attach on_bytes', function()
check_events { }
end)
+ it("works with accepting spell suggestions", function()
+ local check_events = setup_eventcheck(verify, {"hallo"})
+
+ feed("gg0z=4<cr><cr>") -- accepts 'Hello'
+ check_events {
+ { "test1", "bytes", 1, 3, 0, 0, 0, 0, 2, 2, 0, 2, 2 };
+ }
+ end)
+
local function test_lockmarks(mode)
local description = (mode ~= "") and mode or "(baseline)"
it("test_lockmarks " .. description .. " %delete _", function()
diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua
index 3a25d7e813..6f67dea2be 100644
--- a/test/functional/ui/diff_spec.lua
+++ b/test/functional/ui/diff_spec.lua
@@ -1226,3 +1226,130 @@ it('Align the filler lines when changing text in diff mode', function()
|
]]}
end)
+
+it('diff mode works properly if file contains NUL bytes vim-patch:8.2.3925', function()
+ clear()
+ local screen = Screen.new(40, 20)
+ screen:set_default_attr_ids({
+ [1] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.Gray};
+ [2] = {reverse = true};
+ [3] = {background = Screen.colors.LightBlue};
+ [4] = {background = Screen.colors.LightMagenta};
+ [5] = {background = Screen.colors.Red, bold = true};
+ [6] = {foreground = Screen.colors.Blue, bold = true};
+ [7] = {background = Screen.colors.Red, foreground = Screen.colors.Blue, bold = true};
+ [8] = {reverse = true, bold = true};
+ })
+ screen:attach()
+ exec([[
+ call setline(1, ['a', 'b', "c\n", 'd', 'e', 'f', 'g'])
+ vnew
+ call setline(1, ['A', 'b', 'c', 'd', 'E', 'f', 'g'])
+ windo diffthis
+ wincmd p
+ norm! gg0
+ redraw!
+ ]])
+
+ -- Test using internal diff
+ screen:expect([[
+ {1: }{5:^A}{4: }{2:│}{1: }{5:a}{4: }|
+ {1: }b {2:│}{1: }b |
+ {1: }{4:c }{2:│}{1: }{4:c}{7:^@}{4: }|
+ {1: }d {2:│}{1: }d |
+ {1: }{5:E}{4: }{2:│}{1: }{5:e}{4: }|
+ {1: }f {2:│}{1: }f |
+ {1: }g {2:│}{1: }g |
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {8:[No Name] [+] }{2:[No Name] [+] }|
+ |
+ ]])
+
+ -- Test using internal diff and case folding
+ command('set diffopt+=icase')
+ feed('<C-L>')
+ screen:expect([[
+ {1: }^A {2:│}{1: }a |
+ {1: }b {2:│}{1: }b |
+ {1: }{4:c }{2:│}{1: }{4:c}{7:^@}{4: }|
+ {1: }d {2:│}{1: }d |
+ {1: }E {2:│}{1: }e |
+ {1: }f {2:│}{1: }f |
+ {1: }g {2:│}{1: }g |
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {8:[No Name] [+] }{2:[No Name] [+] }|
+ |
+ ]])
+
+ -- Test using external diff
+ command('set diffopt=filler')
+ feed('<C-L>')
+ screen:expect([[
+ {1: }{5:^A}{4: }{2:│}{1: }{5:a}{4: }|
+ {1: }b {2:│}{1: }b |
+ {1: }{4:c }{2:│}{1: }{4:c}{7:^@}{4: }|
+ {1: }d {2:│}{1: }d |
+ {1: }{5:E}{4: }{2:│}{1: }{5:e}{4: }|
+ {1: }f {2:│}{1: }f |
+ {1: }g {2:│}{1: }g |
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {8:[No Name] [+] }{2:[No Name] [+] }|
+ |
+ ]])
+
+ -- Test using external diff and case folding
+ command('set diffopt+=filler,icase')
+ feed('<C-L>')
+ screen:expect([[
+ {1: }^A {2:│}{1: }a |
+ {1: }b {2:│}{1: }b |
+ {1: }{4:c }{2:│}{1: }{4:c}{7:^@}{4: }|
+ {1: }d {2:│}{1: }d |
+ {1: }E {2:│}{1: }e |
+ {1: }f {2:│}{1: }f |
+ {1: }g {2:│}{1: }g |
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {6:~ }{2:│}{6:~ }|
+ {8:[No Name] [+] }{2:[No Name] [+] }|
+ |
+ ]])
+end)
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua
index 4b63b09a5b..8afc69a649 100644
--- a/test/functional/ui/highlight_spec.lua
+++ b/test/functional/ui/highlight_spec.lua
@@ -1345,6 +1345,28 @@ describe('CursorColumn highlight', function()
{2:~ }|
{3:-- INSERT --} |
]])
+ feed('<C-O>')
+ screen:expect([[
+ 1234567{1:8}9 |
+ a ^ b |
+ {2:~ }|
+ {2:~ }|
+ {2:~ }|
+ {2:~ }|
+ {2:~ }|
+ {3:-- (insert) --} |
+ ]])
+ feed('i')
+ screen:expect([[
+ 1{1:2}3456789 |
+ a^ b |
+ {2:~ }|
+ {2:~ }|
+ {2:~ }|
+ {2:~ }|
+ {2:~ }|
+ {3:-- INSERT --} |
+ ]])
end)
it('is updated if cursor is moved from timer', function()
diff --git a/test/functional/ui/input_spec.lua b/test/functional/ui/input_spec.lua
index 9df7531016..b581e147e3 100644
--- a/test/functional/ui/input_spec.lua
+++ b/test/functional/ui/input_spec.lua
@@ -7,6 +7,7 @@ local curbuf_contents = helpers.curbuf_contents
local meths = helpers.meths
local exec_lua = helpers.exec_lua
local write_file = helpers.write_file
+local funcs = helpers.funcs
local Screen = require('test.functional.ui.screen')
before_each(clear)
@@ -204,6 +205,13 @@ describe('input pairs', function()
end)
end)
+it('Ctrl-6 is Ctrl-^ vim-patch:8.1.2333', function()
+ command('split aaa')
+ command('edit bbb')
+ feed('<C-6>')
+ eq('aaa', funcs.bufname())
+end)
+
describe('input non-printable chars', function()
after_each(function()
os.remove('Xtest-overwrite')
diff --git a/test/unit/buffer_spec.lua b/test/unit/buffer_spec.lua
index 34c88248e6..833b21b00b 100644
--- a/test/unit/buffer_spec.lua
+++ b/test/unit/buffer_spec.lua
@@ -17,8 +17,8 @@ describe('buffer functions', function()
return buffer.buflist_new(c_file, c_file, 1, flags)
end
- local close_buffer = function(win, buf, action, abort_if_last)
- return buffer.close_buffer(win, buf, action, abort_if_last)
+ local close_buffer = function(win, buf, action, abort_if_last, ignore_abort)
+ return buffer.close_buffer(win, buf, action, abort_if_last, ignore_abort)
end
local path1 = 'test_file_path'
@@ -53,7 +53,7 @@ describe('buffer functions', function()
itp('should view a closed and hidden buffer as valid', function()
local buf = buflist_new(path1, buffer.BLN_LISTED)
- close_buffer(NULL, buf, 0, 0)
+ close_buffer(NULL, buf, 0, 0, 0)
eq(true, buffer.buf_valid(buf))
end)
@@ -61,7 +61,7 @@ describe('buffer functions', function()
itp('should view a closed and unloaded buffer as valid', function()
local buf = buflist_new(path1, buffer.BLN_LISTED)
- close_buffer(NULL, buf, buffer.DOBUF_UNLOAD, 0)
+ close_buffer(NULL, buf, buffer.DOBUF_UNLOAD, 0, 0)
eq(true, buffer.buf_valid(buf))
end)
@@ -69,7 +69,7 @@ describe('buffer functions', function()
itp('should view a closed and wiped buffer as invalid', function()
local buf = buflist_new(path1, buffer.BLN_LISTED)
- close_buffer(NULL, buf, buffer.DOBUF_WIPE, 0)
+ close_buffer(NULL, buf, buffer.DOBUF_WIPE, 0, 0)
eq(false, buffer.buf_valid(buf))
end)
@@ -90,7 +90,7 @@ describe('buffer functions', function()
eq(buf.handle, buflist_findpat(path1, ONLY_LISTED))
- close_buffer(NULL, buf, buffer.DOBUF_WIPE, 0)
+ close_buffer(NULL, buf, buffer.DOBUF_WIPE, 0, 0)
end)
itp('should prefer to match the start of a file path', function()
@@ -102,9 +102,9 @@ describe('buffer functions', function()
eq(buf2.handle, buflist_findpat("file", ONLY_LISTED))
eq(buf3.handle, buflist_findpat("path", ONLY_LISTED))
- close_buffer(NULL, buf1, buffer.DOBUF_WIPE, 0)
- close_buffer(NULL, buf2, buffer.DOBUF_WIPE, 0)
- close_buffer(NULL, buf3, buffer.DOBUF_WIPE, 0)
+ close_buffer(NULL, buf1, buffer.DOBUF_WIPE, 0, 0)
+ close_buffer(NULL, buf2, buffer.DOBUF_WIPE, 0, 0)
+ close_buffer(NULL, buf3, buffer.DOBUF_WIPE, 0, 0)
end)
itp('should prefer to match the end of a file over the middle', function()
@@ -118,7 +118,7 @@ describe('buffer functions', function()
--}
--{ When: We close buf2
- close_buffer(NULL, buf2, buffer.DOBUF_WIPE, 0)
+ close_buffer(NULL, buf2, buffer.DOBUF_WIPE, 0, 0)
-- And: Open buf1, which has 'file' in the middle of its name
local buf1 = buflist_new(path1, buffer.BLN_LISTED)
@@ -127,8 +127,8 @@ describe('buffer functions', function()
eq(buf3.handle, buflist_findpat("file", ONLY_LISTED))
--}
- close_buffer(NULL, buf1, buffer.DOBUF_WIPE, 0)
- close_buffer(NULL, buf3, buffer.DOBUF_WIPE, 0)
+ close_buffer(NULL, buf1, buffer.DOBUF_WIPE, 0, 0)
+ close_buffer(NULL, buf3, buffer.DOBUF_WIPE, 0, 0)
end)
itp('should match a unique fragment of a file path', function()
@@ -138,9 +138,9 @@ describe('buffer functions', function()
eq(buf3.handle, buflist_findpat("_test_", ONLY_LISTED))
- close_buffer(NULL, buf1, buffer.DOBUF_WIPE, 0)
- close_buffer(NULL, buf2, buffer.DOBUF_WIPE, 0)
- close_buffer(NULL, buf3, buffer.DOBUF_WIPE, 0)
+ close_buffer(NULL, buf1, buffer.DOBUF_WIPE, 0, 0)
+ close_buffer(NULL, buf2, buffer.DOBUF_WIPE, 0, 0)
+ close_buffer(NULL, buf3, buffer.DOBUF_WIPE, 0, 0)
end)
itp('should include / ignore unlisted buffers based on the flag.', function()
@@ -152,7 +152,7 @@ describe('buffer functions', function()
--}
--{ When: We unlist the buffer
- close_buffer(NULL, buf3, buffer.DOBUF_DEL, 0)
+ close_buffer(NULL, buf3, buffer.DOBUF_DEL, 0, 0)
-- Then: It should not find the buffer when searching only listed buffers
eq(-1, buflist_findpat("_test_", ONLY_LISTED))
@@ -162,7 +162,7 @@ describe('buffer functions', function()
--}
--{ When: We wipe the buffer
- close_buffer(NULL, buf3, buffer.DOBUF_WIPE, 0)
+ close_buffer(NULL, buf3, buffer.DOBUF_WIPE, 0, 0)
-- Then: It should not find the buffer at all
eq(-1, buflist_findpat("_test_", ONLY_LISTED))
@@ -180,7 +180,7 @@ describe('buffer functions', function()
--}
--{ When: The first buffer is unlisted
- close_buffer(NULL, buf1, buffer.DOBUF_DEL, 0)
+ close_buffer(NULL, buf1, buffer.DOBUF_DEL, 0, 0)
-- Then: The second buffer is preferred because
-- unlisted buffers are not allowed
@@ -194,7 +194,7 @@ describe('buffer functions', function()
--}
--{ When: We unlist the second buffer
- close_buffer(NULL, buf2, buffer.DOBUF_DEL, 0)
+ close_buffer(NULL, buf2, buffer.DOBUF_DEL, 0, 0)
-- Then: The first buffer is preferred again
-- because buf1 matches better which takes precedence
@@ -205,8 +205,8 @@ describe('buffer functions', function()
eq(-1, buflist_findpat("test", ONLY_LISTED))
--}
- close_buffer(NULL, buf1, buffer.DOBUF_WIPE, 0)
- close_buffer(NULL, buf2, buffer.DOBUF_WIPE, 0)
+ close_buffer(NULL, buf1, buffer.DOBUF_WIPE, 0, 0)
+ close_buffer(NULL, buf2, buffer.DOBUF_WIPE, 0, 0)
end)
end)
diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt
index 6d02a73d14..c06e31a328 100644
--- a/third-party/CMakeLists.txt
+++ b/third-party/CMakeLists.txt
@@ -151,8 +151,8 @@ set(MSGPACK_URL https://github.com/msgpack/msgpack-c/releases/download/cpp-3.0.0
set(MSGPACK_SHA256 bfbb71b7c02f806393bc3cbc491b40523b89e64f83860c58e3e54af47de176e4)
# https://github.com/LuaJIT/LuaJIT/tree/v2.1
-set(LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/e2c312e0deb874aa5fa8ce502c08d87deb38e82f.tar.gz)
-set(LUAJIT_SHA256 bff4764c19466def90667d2f7fcbd0781b8e62476b12105868f8e44babd03f8e)
+set(LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/5e3c45c43bb0e0f1f2917d432e9d2dba12c42a6e.tar.gz)
+set(LUAJIT_SHA256 72294770c73ff2ed03deb9c81a38253c45fd634917583c6ae39f5143c9adc1e1)
set(LUA_URL https://www.lua.org/ftp/lua-5.1.5.tar.gz)
set(LUA_SHA256 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333)