aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-format17
-rw-r--r--.github/labeler.yml1
-rw-r--r--.github/workflows/backport.yml6
-rw-r--r--MAINTAIN.md8
-rw-r--r--packaging/WixPatch.xml4
-rw-r--r--runtime/autoload/dist/ft.vim9
-rw-r--r--runtime/doc/api.txt34
-rw-r--r--runtime/doc/autocmd.txt27
-rw-r--r--runtime/doc/builtin.txt2
-rw-r--r--runtime/doc/change.txt2
-rw-r--r--runtime/doc/editing.txt5
-rw-r--r--runtime/doc/eval.txt2
-rw-r--r--runtime/doc/filetype.txt5
-rw-r--r--runtime/doc/intro.txt12
-rw-r--r--runtime/doc/lua.txt61
-rw-r--r--runtime/doc/motion.txt2
-rw-r--r--runtime/doc/nvim_terminal_emulator.txt12
-rw-r--r--runtime/doc/options.txt8
-rw-r--r--runtime/doc/syntax.txt5
-rw-r--r--runtime/doc/ui.txt3
-rw-r--r--runtime/doc/undo.txt8
-rw-r--r--runtime/doc/vim_diff.txt2
-rw-r--r--runtime/filetype.lua12
-rw-r--r--runtime/filetype.vim28
-rw-r--r--runtime/indent/README.txt2
-rw-r--r--runtime/indent/krl.vim130
-rw-r--r--runtime/indent/testdir/krl.in148
-rw-r--r--runtime/indent/testdir/krl.ok148
-rw-r--r--runtime/lua/vim/_editor.lua10
-rw-r--r--runtime/lua/vim/diagnostic.lua24
-rw-r--r--runtime/lua/vim/filetype.lua21
-rw-r--r--runtime/lua/vim/inspect.lua383
-rw-r--r--runtime/lua/vim/keymap.lua3
-rw-r--r--runtime/lua/vim/lsp/handlers.lua5
-rw-r--r--runtime/lua/vim/lsp/util.lua24
-rw-r--r--runtime/lua/vim/treesitter.lua2
-rw-r--r--runtime/pack/dist/opt/termdebug/plugin/termdebug.vim71
-rw-r--r--runtime/syntax/krl.vim458
-rw-r--r--runtime/syntax/openscad.vim129
-rw-r--r--runtime/syntax/synload.vim2
-rw-r--r--runtime/syntax/syntax.vim2
-rwxr-xr-xscripts/pvscheck.sh2
-rw-r--r--src/Doxyfile2614
-rwxr-xr-xsrc/clint.py41
-rw-r--r--src/nvim/api/autocmd.c16
-rw-r--r--src/nvim/api/buffer.c4
-rw-r--r--src/nvim/api/ui.c28
-rw-r--r--src/nvim/api/vim.c3
-rw-r--r--src/nvim/arabic.c2
-rw-r--r--src/nvim/autocmd.c9
-rw-r--r--src/nvim/buffer.c43
-rw-r--r--src/nvim/buffer_defs.h3
-rw-r--r--src/nvim/buffer_updates.c1
-rw-r--r--src/nvim/charset.c11
-rw-r--r--src/nvim/context.c2
-rw-r--r--src/nvim/cursor_shape.c3
-rw-r--r--src/nvim/diff.c2
-rw-r--r--src/nvim/digraph.c2
-rw-r--r--src/nvim/edit.c13
-rw-r--r--src/nvim/eval.c6
-rw-r--r--src/nvim/ex_cmds.c9
-rw-r--r--src/nvim/ex_cmds.lua2
-rw-r--r--src/nvim/ex_cmds2.c4
-rw-r--r--src/nvim/ex_docmd.c47
-rw-r--r--src/nvim/ex_eval.c1
-rw-r--r--src/nvim/ex_getln.c3
-rw-r--r--src/nvim/fileio.c2
-rw-r--r--src/nvim/fold.c6
-rw-r--r--src/nvim/getchar.c9
-rw-r--r--src/nvim/globals.h3
-rw-r--r--src/nvim/highlight_defs.h2
-rw-r--r--src/nvim/highlight_group.c2
-rw-r--r--src/nvim/match.c38
-rw-r--r--src/nvim/mbyte.c15
-rw-r--r--src/nvim/move.c20
-rw-r--r--src/nvim/normal.c1308
-rw-r--r--src/nvim/ops.c59
-rw-r--r--src/nvim/option.c21
-rw-r--r--src/nvim/quickfix.c5
-rw-r--r--src/nvim/regexp.c2
-rw-r--r--src/nvim/regexp_defs.h9
-rw-r--r--src/nvim/syntax.c4
-rw-r--r--src/nvim/testdir/test_autocmd.vim61
-rw-r--r--src/nvim/testdir/test_bufwintabinfo.vim34
-rw-r--r--src/nvim/testdir/test_cursorline.vim36
-rw-r--r--src/nvim/testdir/test_ex_mode.vim7
-rw-r--r--src/nvim/testdir/test_expand_func.vim31
-rw-r--r--src/nvim/testdir/test_filetype.vim26
-rw-r--r--src/nvim/testdir/test_fold.vim20
-rw-r--r--src/nvim/testdir/test_indent.vim124
-rw-r--r--src/nvim/testdir/test_lispwords.vim3
-rw-r--r--src/nvim/testdir/test_mapping.vim29
-rw-r--r--src/nvim/testdir/test_search.vim45
-rw-r--r--src/nvim/testdir/test_smartindent.vim23
-rw-r--r--src/nvim/testdir/test_syntax.vim13
-rw-r--r--src/nvim/testdir/test_vartabs.vim42
-rw-r--r--src/nvim/testdir/test_window_cmd.vim5
-rw-r--r--src/nvim/tui/input.c13
-rw-r--r--src/nvim/tui/tui.c19
-rw-r--r--src/nvim/window.c65
-rw-r--r--test/functional/api/vim_spec.lua6
-rw-r--r--test/functional/autocmd/autocmd_spec.lua29
-rw-r--r--test/functional/editor/undo_spec.lua67
-rw-r--r--test/functional/ex_cmds/quickfix_commands_spec.lua13
-rw-r--r--test/functional/legacy/ex_mode_spec.lua6
-rw-r--r--test/functional/legacy/mapping_spec.lua15
-rw-r--r--test/functional/lua/diagnostic_spec.lua19
-rw-r--r--test/functional/lua/vim_spec.lua33
-rw-r--r--test/functional/options/cursorbind_spec.lua91
-rw-r--r--test/functional/treesitter/language_spec.lua11
-rw-r--r--test/functional/ui/cursor_spec.lua4
-rw-r--r--test/functional/ui/options_spec.lua40
-rw-r--r--test/functional/ui/searchhl_spec.lua140
113 files changed, 4913 insertions, 2370 deletions
diff --git a/.clang-format b/.clang-format
index d5e328f461..5e31777265 100644
--- a/.clang-format
+++ b/.clang-format
@@ -38,3 +38,20 @@ BraceWrapping:
PointerAlignment: Right
SortIncludes: false
Cpp11BracedListStyle: false
+SpaceBeforeParens: ControlStatementsExceptControlMacros
+ForEachMacros:
+ - FOR_ALL_AUEVENTS
+ - FOR_ALL_AUPATS_IN_EVENT
+ - FOR_ALL_BUFFERS
+ - FOR_ALL_BUFFERS_BACKWARDS
+ - FOR_ALL_FRAMES
+ - FOR_ALL_QFL_ITEMS
+ - FOR_ALL_SIGNS_IN_BUF
+ - FOR_ALL_TABS
+ - FOR_ALL_TAB_WINDOWS
+ - FOR_ALL_WINDOWS_IN_TAB
+ - RBUFFER_EACH
+ - RBUFFER_EACH_REVERSE
+ - RBUFFER_UNTIL_EMPTY
+ - RBUFFER_UNTIL_FULL
+ - kl_iter
diff --git a/.github/labeler.yml b/.github/labeler.yml
index 2e3aa8f875..fb06b0b379 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -39,6 +39,7 @@
"documentation":
- all: ["runtime/doc/*"]
+ - all: ["**/*.md"]
"clipboard":
- runtime/autoload/provider/clipboard.vim
diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml
index d281bb1404..75ee81d368 100644
--- a/.github/workflows/backport.yml
+++ b/.github/workflows/backport.yml
@@ -2,8 +2,6 @@ name: Backport
on:
pull_request_target:
types: [closed, labeled]
- issue_comment:
- types: [created]
jobs:
backport:
permissions:
@@ -14,10 +12,6 @@ jobs:
github.repository_owner == 'neovim' && (
github.event_name == 'pull_request_target' &&
github.event.pull_request.merged
- ) || (
- github.event_name == 'issue_comment' &&
- github.event.issue.pull_request &&
- contains(github.event.comment.body, '/backport')
)
runs-on: ubuntu-latest
steps:
diff --git a/MAINTAIN.md b/MAINTAIN.md
index 927ddea5a1..c644b88ad7 100644
--- a/MAINTAIN.md
+++ b/MAINTAIN.md
@@ -57,11 +57,8 @@ has a major bug:
The neovim repository includes a backport [github action](https://github.com/zeebe-io/backport-action).
In order to trigger the action, a PR must be labeled with a label matching the
-form `backport release-0.X`. If the label is applied before the PR is merged,
-the backport will be filed automatically against the target branch. Otherwise,
-comment `\backport` on the merged PR *after* the label has been applied to trigger
-a backport. Note, the PR must have a description in the issue body, or the backport
-will fail.
+form `backport release-0.X`. Note, the PR must have a description in the issue body,
+or the backport will fail.
Third-party dependencies
--------------
@@ -87,6 +84,7 @@ These dependencies are "vendored" (inlined), we need to update the sources manua
- [xdiff](https://github.com/git/git/tree/master/xdiff)
- [lua-cjson](https://github.com/openresty/lua-cjson)
- [Klib](https://github.com/attractivechaos/klib)
+ - [inspect.lua](https://github.com/kikito/inspect.lua)
We also maintain some forks, particularly for Windows, if we are waiting on upstream changes:
https://github.com/neovim/neovim/wiki/Deps
diff --git a/packaging/WixPatch.xml b/packaging/WixPatch.xml
index 728d43951e..3cbbb04850 100644
--- a/packaging/WixPatch.xml
+++ b/packaging/WixPatch.xml
@@ -1,8 +1,6 @@
<CPackWiXPatch>
<!-- Fragment ID is from: <your build dir>/_CPack_Packages/win64/WIX/files.wxs -->
<CPackWiXFragment Id="CM_CP_bin.nvim.exe">
- <!-- Note: if we were to specify Value='[INSTALL_ROOT]\bin' - with a backslash, the installer will still
- use a forward slash in the path. -->
<Environment
Id='UpdatePath'
Name='PATH'
@@ -10,7 +8,7 @@
Permanent='no'
System='yes'
Part='last'
- Value='[INSTALL_ROOT]/bin'
+ Value='[INSTALL_ROOT]bin'
/>
</CPackWiXFragment>
</CPackWiXPatch>
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index 38fe8d4872..14dd88b7a8 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 Apr 06
+" Last Change: 2022 Apr 13
" These functions are moved here from runtime/filetype.vim to make startup
" faster.
@@ -992,20 +992,23 @@ func dist#ft#FTtf()
setf tf
endfunc
+let s:ft_krl_header = '\&\w+'
" Determine if a *.src file is Kuka Robot Language
func dist#ft#FTsrc()
+ let ft_krl_def_or_deffct = '%(global\s+)?def%(fct)?>'
if exists("g:filetype_src")
exe "setf " .. g:filetype_src
- elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|\%(global\s\+\)\?def\>\)'
+ elseif getline(nextnonblank(1)) =~? '\v^\s*%(' .. s:ft_krl_header .. '|' .. ft_krl_def_or_deffct .. ')'
setf krl
endif
endfunc
" Determine if a *.dat file is Kuka Robot Language
func dist#ft#FTdat()
+ let ft_krl_defdat = 'defdat>'
if exists("g:filetype_dat")
exe "setf " .. g:filetype_dat
- elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|defdat\>\)'
+ elseif getline(nextnonblank(1)) =~? '\v^\s*%(' .. s:ft_krl_header .. '|' .. ft_krl_defdat .. ')'
setf krl
endif
endfunc
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 9e0002db48..f4942d7f26 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -538,9 +538,9 @@ nvim__get_runtime({pat}, {all}, {*opts}) *nvim__get_runtime()*
{fast}
Parameters: ~
- {pat} pattern of files to search for
- {all} whether to return all matches or only the first
- {options} is_lua: only search lua subdirs
+ {pat} pattern of files to search for
+ {all} whether to return all matches or only the first
+ {opts} is_lua: only search lua subdirs
Return: ~
list of absolute paths to the found files
@@ -2325,12 +2325,12 @@ nvim_buf_set_text({buffer}, {start_row}, {start_col}, {end_row}, {end_col},
only.
Parameters: ~
- {buffer} Buffer handle, or 0 for current buffer
- {start_row} First line index
- {start_column} First column
- {end_row} Last line index
- {end_column} Last column
- {replacement} Array of lines to use as replacement
+ {buffer} Buffer handle, or 0 for current buffer
+ {start_row} First line index
+ {start_col} First column
+ {end_row} Last line index
+ {end_col} Last column
+ {replacement} Array of lines to use as replacement
nvim_buf_set_var({buffer}, {name}, {value}) *nvim_buf_set_var()*
Sets a buffer-scoped (b:) variable
@@ -3221,6 +3221,22 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()*
})
<
+ Lua functions receive a table with information about the
+ autocmd event as an argument. To use a function which itself
+ accepts another (optional) parameter, wrap the function in a
+ lambda:
+>
+ -- Lua function with an optional parameter.
+ -- The autocmd callback would pass a table as argument but this
+ -- function expects number|nil
+ local myluafun = function(bufnr) bufnr = bufnr or vim.api.nvim_get_current_buf() end
+
+ vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
+ pattern = {"*.c", "*.h"},
+ callback = function() myluafun() end,
+ })
+<
+
Example using command: >
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
pattern = {"*.c", "*.h"},
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 07158982f2..bf231044a0 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -69,6 +69,7 @@ Or use `:execute`: >
:augroup mine | exe "au! BufRead *" | augroup END
:augroup mine | exe "au BufRead * set tw=70" | augroup END
+< *autocmd-expand*
Note that special characters (e.g., "%", "<cword>") in the ":autocmd"
arguments are not expanded when the autocommand is defined. These will be
expanded when the Event is recognized, and the {cmd} is executed. The only
@@ -275,14 +276,14 @@ BufRead or BufReadPost When starting to edit a new buffer, after
processing modelines. See |BufWinEnter| to do
something after processing modelines.
Also triggered:
- - when writing an unnamed buffer such that the
- buffer gets a name
+ - when writing an unnamed buffer in a way that
+ the buffer gets a name
- after successfully recovering a file
- for the "filetypedetect" group when
executing ":filetype detect"
Not triggered:
- - for ":r file"
- - if the file doesn't exist
+ - for the `:read file` command
+ - when the file doesn't exist
*BufReadCmd*
BufReadCmd Before starting to edit a new buffer. Should
read the file into the buffer. |Cmd-event|
@@ -542,6 +543,15 @@ DirChangedPre When the |current-directory| is going to be
switching window (or tab)
<afile> is set to the new directory name.
Non-recursive (event cannot trigger itself).
+ *ExitPre*
+ExitPre When using `:quit`, `:wq` in a way it makes
+ Vim exit, or using `:qall`, just after
+ |QuitPre|. Can be used to close any
+ non-essential window. Exiting may still be
+ cancelled if there is a modified buffer that
+ isn't automatically saved, use |VimLeavePre|
+ for really exiting.
+ See also |QuitPre|, |WinClosed|.
*FileAppendCmd*
FileAppendCmd Before appending to a file. Should do the
appending to the file. Use the '[ and ']
@@ -568,15 +578,6 @@ FileChangedRO Before making the first change to a read-only
*E881*
If the number of lines changes saving for undo
may fail and the change will be aborted.
- *ExitPre*
-ExitPre When using `:quit`, `:wq` in a way it makes
- Vim exit, or using `:qall`, just after
- |QuitPre|. Can be used to close any
- non-essential window. Exiting may still be
- cancelled if there is a modified buffer that
- isn't automatically saved, use |VimLeavePre|
- for really exiting.
- See also |QuitPre|, |WinClosed|.
*FileChangedShell*
FileChangedShell When Vim notices that the modification time of
a file has changed since editing started.
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 7871885a5d..81d7f4b83a 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1809,7 +1809,7 @@ execute({command} [, {silent}]) *execute()*
`:redir`, error messages are dropped.
To get a list of lines use |split()| on the result: >
- split(execute('args'), "\n")
+ execute('args')->split("\n")
< This function is not available in the |sandbox|.
Note: If nested, an outer execute() will not observe output of
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 0d19f025ec..8e666484d7 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -583,7 +583,7 @@ attack or other people reading your file). When Vim exits the directory and
all files in it are deleted. When Vim has the setuid bit set this may cause
problems, the temp file is owned by the setuid user but the filter command
probably runs as the original user.
-Directory for temporary files is created in the first suitable directory of:
+Directory for temporary files is created in the first possible directory of:
Unix: $TMPDIR, /tmp, current-dir, $HOME.
Windows: $TMPDIR, $TMP, $TEMP, $USERPROFILE, current-dir.
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 1cc8c21462..b25d5e89bd 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -412,7 +412,8 @@ does apply like to other wildcards.
Environment variables in the expression are expanded when evaluating the
expression, thus this works: >
:e `=$HOME .. '/.vimrc'`
-This does not work, $HOME is inside a string and used literally: >
+This uses $HOME inside a string and it will be used literally, most likely not
+what you intended: >
:e `='$HOME' .. '/.vimrc'`
If the expression returns a string then names are to be separated with line
@@ -1494,7 +1495,7 @@ session or with another command (e.g., a filter command). Then you will know
which version of the file you want to keep.
The accuracy of the time check depends on the filesystem. On Unix it is
-usually sub-second. With old file sytems and on MS-Windows it is normally one
+usually sub-second. With old file systems and on MS-Windows it is normally one
second. Use `has('nanotime')` to check if sub-second time stamp checks are
available.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index e3d4ef2085..2f3602caa1 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -4302,7 +4302,7 @@ parentheses can be cut out from |v:exception| with the ":substitute" command.
:
:try
:
- : " something with arithmetics and I/O
+ : " something with arithmetic and I/O
:
:catch /^EXCEPT:MATHERR:RANGE/
: let function = substitute(v:exception, '.*(\(\a\+\)).*', '\1', "")
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index e1b0e88c95..c50ccc7a91 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -257,7 +257,10 @@ C. If your file type can be detected by the file name or extension.
disabled by setting the did_load_filetypes global variable. If this
variable exists, $VIMRUNTIME/filetype.vim will not run.
Example: >
- " Disable filetype.vim
+ " Disable filetype.vim (but still load filetype.lua if enabled)
+ let g:did_load_filetypes = 0
+
+ " Disable filetype.vim and filetype.lua
let g:did_load_filetypes = 1
< 3. To use the new filetype detection you must restart Vim.
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index 09739085a3..4e3dcf850c 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -286,10 +286,12 @@ and <> are part of what you type, the context should make this clear.
*CTRL-{char}*
CTRL-{char} {char} typed as a control character; that is, typing {char}
- while holding the CTRL key down. The case of {char} does not
- matter; thus CTRL-A and CTRL-a are equivalent. But on some
- terminals, using the SHIFT key will produce another code,
- don't use it then.
+ while holding the CTRL key down. The case of {char} is
+ ignored; thus CTRL-A and CTRL-a are equivalent. But in
+ some terminals and environments, using the SHIFT key will
+ produce a distinct code (e.g. CTRL-SHIFT-a); in these
+ environments using the SHIFT key will not trigger commands
+ such as CTRL-A.
*'option'*
'option' An option, or parameter, that can be set to a value, is
@@ -383,6 +385,8 @@ Note:
combinations actually work depends on the the UI or host terminal.
- When a key is pressed using a meta or alt modifier and no mapping exists
for that keypress, Nvim behaves as though <Esc> was pressed before the key.
+- It is possible to notate combined modifiers (e.g. <C-A-T> for CTRL-ALT-T),
+ but your terminal must encode the input for that to work. |tui-input|
*<>*
Examples are often given in the <> notation. Sometimes this is just to make
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 16f27486c8..ed4cc77369 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -138,16 +138,16 @@ Lua functions can be called in multiple ways. Consider the function: >
end
-The first way to call a function is: >
-
+The first way to call this function is: >
+
example_func(1, 2)
-- ==== Result ====
-- A is: 1
-- B is: 2
<
- This way of calling a function is familiar to most scripting languages.
- In Lua, it's important to understand that any function arguments that are
- not supplied are automatically set to `nil`. For example: >
+This way of calling a function is familiar from most scripting languages.
+In Lua, it's important to understand that any function arguments that are
+not supplied are automatically set to `nil`. For example: >
example_func(1)
-- ==== Result ====
@@ -155,12 +155,13 @@ The first way to call a function is: >
-- B is: nil
<
- Additionally, if any extra parameters are passed, they are discarded
- completely.
+Additionally, if any extra parameters are passed, they are discarded
+completely.
-In Lua, it is also possible (when only one argument is passed) to call the
-function without any parentheses. This is most often used to approximate
-"keyword"-style arguments with a single dictionary. For example: >
+In Lua, it is also possible to omit the parentheses (only) if the function
+takes a single string or table literal (`"foo"` or "`{1,2,3}`", respectively).
+The latter is most often used to approximate "keyword-style" arguments with a
+single dictionary, for example: >
local func_with_opts = function(opts)
local will_do_foo = opts.foo
@@ -172,15 +173,38 @@ function without any parentheses. This is most often used to approximate
func_with_opts { foo = true, filename = "hello.world" }
<
- In this style, each "parameter" is passed via keyword. It is still valid
- to call the function in this style: >
+In this style, each "parameter" is passed via keyword. It is still valid
+to call the function in the standard style: >
func_with_opts({ foo = true, filename = "hello.world" })
<
- But often in the documentation, you will see the former rather than the
- latter style, due to its brevity (this is vim after all!).
+But often in the documentation, you will see the former rather than the
+latter style due to its brevity.
+
+==============================================================================
+Lua Patterns *lua-patterns*
+
+For performance reasons, Lua does not support regular expressions natively.
+Instead, the Lua `string` standard library allows manipulations using a
+restricted set of "patterns", see https://www.lua.org/manual/5.1/manual.html#5.4.1
+
+Examples (`string.match` extracts the first match): >
+
+ print(string.match("foo123bar123", "%d+"))
+ -- -> 123
+
+ print(string.match("foo123bar123", "[^%d]+"))
+ -- -> foo
+
+ print(string.match("foo123bar123", "[abc]+"))
+ -- -> ba
+
+ print(string.match("foo.bar", "%.bar"))
+ -- -> .bar
+For more complex matching, Vim regular expressions can be used from Lua
+through |vim.regex()|.
------------------------------------------------------------------------------
LUA PLUGIN EXAMPLE *lua-require-example*
@@ -1924,9 +1948,9 @@ add({filetypes}) *vim.filetype.add()*
filename (either the "tail" or the full file path). The full
file path is checked first, followed by the file name. If a
match is not found using the filename, then the filename is
- matched against the list of patterns (sorted by priority)
- until a match is found. Lastly, if pattern matching does not
- find a filetype, then the file extension is used.
+ matched against the list of |lua-patterns| (sorted by
+ priority) until a match is found. Lastly, if pattern matching
+ does not find a filetype, then the file extension is used.
The filetype can be either a string (in which case it is used
as the filetype directly) or a function. If a function, it
@@ -2055,6 +2079,9 @@ set({mode}, {lhs}, {rhs}, {opts}) *vim.keymap.set()*
"silent". In addition to the options listed in
|nvim_set_keymap()|, this table also accepts the
following keys:
+ • buffer: (number or boolean) Add a mapping to the
+ given buffer. When "true" or 0, use the current
+ buffer.
• replace_keycodes: (boolean, default true) When
both this and expr is "true",
|nvim_replace_termcodes()| is applied to the
diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt
index 2cc6842402..228d1fcb87 100644
--- a/runtime/doc/motion.txt
+++ b/runtime/doc/motion.txt
@@ -1045,7 +1045,7 @@ in the current file (an indent is removed and a long line is truncated to fit
in the window).
The marker ">" indicates the current position in the jumplist. It may not be
-shown when filtering the |:jump| command using |:filter|
+shown when filtering the |:jumps| command using |:filter|
You are currently in line 1167. If you then use the CTRL-O command, the
cursor is put in line 1154. This results in:
diff --git a/runtime/doc/nvim_terminal_emulator.txt b/runtime/doc/nvim_terminal_emulator.txt
index f322764ecf..0e2b048541 100644
--- a/runtime/doc/nvim_terminal_emulator.txt
+++ b/runtime/doc/nvim_terminal_emulator.txt
@@ -45,11 +45,10 @@ by |:mksession| to restore a terminal buffer (by restarting the {cmd}).
==============================================================================
Input *terminal-input*
-To send input, enter |Terminal-mode| using any command that would enter "insert
-mode" in a normal buffer, such as |i| or |:startinsert|. In this mode all keys
-except <C-\> are sent to the underlying program. If <C-\> is pressed, the
-next key is sent unless it is <C-N>. Use <C-\><C-N> to return to normal-mode.
-|CTRL-\_CTRL-N|
+To send input, enter |Terminal-mode| with |i|, |I|, |a|, |A| or
+|:startinsert|. In this mode all keys except <C-\> are sent to the underlying
+program. If <C-\> is pressed, the next key is sent unless it is <C-N>. Use
+<C-\><C-N> to return to normal-mode. |CTRL-\_CTRL-N|
Terminal-mode forces these local options:
@@ -266,6 +265,8 @@ Put focus on the gdb window to type commands there. Some common ones are:
- next execute the current line and stop at the next line
- step execute the current line and stop at the next statement,
entering functions
+- until execute until past the current cursor line or past a specified
+ position or the current stack frame returns
- finish execute until leaving the current function
- where show the stack
- frame N go to the Nth stack frame
@@ -282,6 +283,7 @@ gdb:
*:Step* execute the gdb "step" command
*:Over* execute the gdb "next" command (`:Next` is a Vim command)
+ *:Until* execute the gdb "until" command
*:Finish* execute the gdb "finish" command
*:Continue* execute the gdb "continue" command
*:Stop* interrupt the program
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 7ea6a92a34..1966a344b2 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -3176,8 +3176,12 @@ A jump table for the options with a short description can be found at |Q_op|.
'hlsearch' 'hls' boolean (default on)
global
When there is a previous search pattern, highlight all its matches.
- The |hl-Search| highlight group determines the highlighting. Note that
- only the matching text is highlighted, any offsets are not applied.
+ The |hl-Search| highlight group determines the highlighting for all
+ matches not under the cursor while the |hl-CurSearch| highlight group
+ (if defined) determines the highlighting for the match under the
+ cursor. If |hl-CurSearch| is not defined, then |hl-Search| is used for
+ both. Note that only the matching text is highlighted, any offsets
+ are not applied.
See also: 'incsearch' and |:match|.
When you get bored looking at the highlighted matches, you can turn it
off with |:nohlsearch|. This does not change the option value, as
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 6875f43b86..fd713b1f32 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -188,7 +188,7 @@ A syntax group name doesn't specify any color or attributes itself.
The name for a highlight or syntax group must consist of ASCII letters, digits
and the underscore. As a regexp: "[a-zA-Z0-9_]*". However, Vim does not give
-an error when using other characters. The maxium length of a group name is
+an error when using other characters. The maximum length of a group name is
about 200 bytes. *E1249*
To be able to allow each user to pick their favorite set of colors, there must
@@ -5090,6 +5090,9 @@ ColorColumn used for the columns set with 'colorcolumn'
*hl-Conceal*
Conceal placeholder characters substituted for concealed
text (see 'conceallevel')
+ *hl-CurSearch*
+CurSearch used for highlighting a search pattern under the cursor
+ (see 'hlsearch')
*hl-Cursor*
Cursor character under the cursor
lCursor the character under the cursor when |language-mapping|
diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt
index c5e3b60079..f9110cd59b 100644
--- a/runtime/doc/ui.txt
+++ b/runtime/doc/ui.txt
@@ -49,6 +49,9 @@ with these (optional) keys:
'wildmenu'. |ui-popupmenu|
`ext_tabline` Externalize the tabline. |ui-tabline|
`ext_termcolors` Use external default colors.
+ `term_name` Sets the name of the terminal 'term'.
+ `term_colors` Sets the number of supported colors 't_Co'.
+ `term_background` Sets the default value of 'background'.
Specifying an unknown option is an error; UIs can check the |api-metadata|
`ui_options` key for supported options.
diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt
index a853aea995..39b26476af 100644
--- a/runtime/doc/undo.txt
+++ b/runtime/doc/undo.txt
@@ -22,6 +22,14 @@ u Undo [count] changes.
:u[ndo] {N} Jump to after change number {N}. See |undo-branches|
for the meaning of {N}.
+:u[ndo]! Undo one change and remove it from undo history.
+ *E5767*
+:u[ndo]! {N} Like ":u[ndo] {N}", but forget all changes in the
+ current undo branch up until {N}. You may only use
+ ":undo! {N}" to move backwards in the same undo
+ branch, not to redo or switch to a different undo
+ branch.
+
*CTRL-R*
CTRL-R Redo [count] changes which were undone.
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 59f085977b..f5cd24b734 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -351,6 +351,8 @@ Functions:
Highlight groups:
|hl-ColorColumn|, |hl-CursorColumn| are lower priority than most other
groups
+ |hl-CurSearch| highlights match under cursor instead of last match found
+ using |n| or |N|
|hl-CursorLine| is low-priority unless foreground color is set
*hl-VertSplit* superseded by |hl-WinSeparator|
diff --git a/runtime/filetype.lua b/runtime/filetype.lua
index 8224b79534..47d55d8465 100644
--- a/runtime/filetype.lua
+++ b/runtime/filetype.lua
@@ -17,10 +17,14 @@ vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, {
})
-- These *must* be sourced after the autocommand above is created
-vim.cmd [[
-runtime! ftdetect/*.vim
-runtime! ftdetect/*.lua
-]]
+if not vim.g.did_load_ftdetect then
+ vim.cmd [[
+ augroup filetypedetect
+ runtime! ftdetect/*.vim
+ runtime! ftdetect/*.lua
+ augroup END
+ ]]
+end
-- Set a marker so that the ftdetect scripts are not sourced a second time by filetype.vim
vim.g.did_load_ftdetect = 1
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index f7c0317eff..e72d6fc0c0 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 Apr 07
+" Last Change: 2022 Apr 13
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -151,14 +151,21 @@ au BufNewFile,BufRead *.asp
\ setf aspvbs |
\ endif
-" Grub (must be before catch *.lst)
+" Grub (must be before pattern *.lst)
au BufNewFile,BufRead */boot/grub/menu.lst,*/boot/grub/grub.conf,*/etc/grub.conf setf grub
+" Maxima, see:
+" https://maxima.sourceforge.io/docs/manual/maxima_71.html#file_005ftype_005fmaxima
+" Must be before the pattern *.mac.
+" *.dem omitted - also used by gnuplot demos
+" *.mc omitted - used by dist#ft#McSetf()
+au BufNewFile,BufRead *.demo,*.dm{1,2,3,t},*.wxm,maxima-init.mac setf maxima
+
" Assembly (all kinds)
" *.lst is not pure assembly, it has two extra columns (address, byte codes)
au BufNewFile,BufRead *.asm,*.[sS],*.[aA],*.mac,*.lst call dist#ft#FTasm()
-" Macro (VAX)
+" Assembly - Macro (VAX)
au BufNewFile,BufRead *.mar setf vmasm
" Atlas
@@ -1009,6 +1016,9 @@ au BufNewFile,BufRead *.ll setf lifelines
" Lilo: Linux loader
au BufNewFile,BufRead lilo.conf setf lilo
+" Lilypond
+au BufNewFile,BufRead *.ly,*.ily setf lilypond
+
" Lisp (*.el = ELisp, *.cl = Common Lisp)
" *.jl was removed, it's also used for Julia, better skip than guess wrong.
if has("fname_case")
@@ -1271,6 +1281,9 @@ au BufNewFile,BufRead *.or setf openroad
" OPL
au BufNewFile,BufRead *.[Oo][Pp][Ll] setf opl
+" OpenSCAD
+au BufNewFile,BufRead *.scad setf openscad
+
" Oracle config file
au BufNewFile,BufRead *.ora setf ora
@@ -1280,13 +1293,13 @@ au BufNewFile,BufRead *.org,*.org_archive setf org
" Packet filter conf
au BufNewFile,BufRead pf.conf setf pf
-" Pacman Config (close enough to dosini)
-au BufNewFile,BufRead */etc/pacman.conf setf dosini
+" Pacman config
+au BufNewFile,BufRead */etc/pacman.conf setf conf
" Pacman hooks
au BufNewFile,BufRead *.hook
\ if getline(1) == '[Trigger]' |
- \ setf dosini |
+ \ setf conf |
\ endif
" Pam conf
@@ -1668,7 +1681,8 @@ au BufNewFile,BufRead *.siv,*.sieve setf sieve
" Sendmail
au BufNewFile,BufRead sendmail.cf setf sm
-" Sendmail .mc files are actually m4. Could also be MS Message text file.
+" Sendmail .mc files are actually m4. Could also be MS Message text file or
+" Maxima.
au BufNewFile,BufRead *.mc call dist#ft#McSetf()
" Services
diff --git a/runtime/indent/README.txt b/runtime/indent/README.txt
index 8b114365c6..649870636e 100644
--- a/runtime/indent/README.txt
+++ b/runtime/indent/README.txt
@@ -31,7 +31,7 @@ Always use ":setlocal" to set 'indentexpr'. This avoids it being carried over
to other buffers.
To trigger the indenting after typing a word like "endif", add the word to the
-'cinkeys' option with "+=".
+'indentkeys' option with "+=".
You normally set 'indentexpr' to evaluate a function and then define that
function. That function only needs to be defined once for as long as Vim is
diff --git a/runtime/indent/krl.vim b/runtime/indent/krl.vim
new file mode 100644
index 0000000000..cc3cbd1abb
--- /dev/null
+++ b/runtime/indent/krl.vim
@@ -0,0 +1,130 @@
+" Vim indent file
+" Language: Kuka Robot Language
+" Maintainer: Patrick Meiser-Knosowski <knosowski@graeffrobotics.de>
+" Version: 3.0.0
+" Last Change: 15. Apr 2022
+" Credits: Based on indent/vim.vim
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal nolisp
+setlocal nocindent
+setlocal nosmartindent
+setlocal autoindent
+setlocal indentexpr=GetKrlIndent()
+setlocal indentkeys=!^F,o,O,=~end,0=~else,0=~case,0=~default,0=~until,0=~continue,=~part
+let b:undo_indent = "setlocal lisp< cindent< smartindent< autoindent< indentexpr< indentkeys<"
+
+if get(g:,'krlSpaceIndent',1)
+ " Use spaces, not tabs, for indention, 2 is enough.
+ " More or even tabs would waste valuable space on the teach pendant.
+ setlocal softtabstop=2
+ setlocal shiftwidth=2
+ setlocal expandtab
+ setlocal shiftround
+ let b:undo_indent = b:undo_indent." softtabstop< shiftwidth< expandtab< shiftround<"
+endif
+
+" Only define the function once.
+if exists("*GetKrlIndent")
+ finish
+endif
+let s:keepcpo = &cpo
+set cpo&vim
+
+function GetKrlIndent() abort
+
+ let currentLine = getline(v:lnum)
+ if currentLine =~? '\v^;(\s*(end)?fold>)@!' && !get(g:, 'krlCommentIndent', 0)
+ " If current line has a ; in column 1 and is no fold, keep zero indent.
+ " This may be usefull if code is commented out at the first column.
+ return 0
+ endif
+
+ " Find a non-blank line above the current line.
+ let preNoneBlankLineNum = s:KrlPreNoneBlank(v:lnum - 1)
+ if preNoneBlankLineNum == 0
+ " At the start of the file use zero indent.
+ return 0
+ endif
+
+ let preNoneBlankLine = getline(preNoneBlankLineNum)
+ let ind = indent(preNoneBlankLineNum)
+
+ " Define add 'shiftwidth' pattern
+ let addShiftwidthPattern = '\v^\s*('
+ if get(g:, 'krlIndentBetweenDef', 1)
+ let addShiftwidthPattern ..= '(global\s+)?def(fct|dat)?\s+\$?\w'
+ let addShiftwidthPattern ..= '|'
+ endif
+ let addShiftwidthPattern ..= 'if>|while>|for>|loop>'
+ let addShiftwidthPattern ..= '|else>'
+ let addShiftwidthPattern ..= '|case>|default>'
+ let addShiftwidthPattern ..= '|repeat>'
+ let addShiftwidthPattern ..= '|skip>|(ptp_)?spline>'
+ let addShiftwidthPattern ..= '|time_block\s+(start|part)>'
+ let addShiftwidthPattern ..= '|const_vel\s+start>'
+ let addShiftwidthPattern ..= ')'
+
+ " Define Subtract 'shiftwidth' pattern
+ let subtractShiftwidthPattern = '\v^\s*('
+ if get(g:, 'krlIndentBetweenDef', 1)
+ let subtractShiftwidthPattern ..= 'end(fct|dat)?>'
+ let subtractShiftwidthPattern ..= '|'
+ endif
+ let subtractShiftwidthPattern ..= 'end(if|while|for|loop)>'
+ let subtractShiftwidthPattern ..= '|else>'
+ let subtractShiftwidthPattern ..= '|case>|default>|endswitch>'
+ let subtractShiftwidthPattern ..= '|until>'
+ let subtractShiftwidthPattern ..= '|end(skip|spline)>'
+ let subtractShiftwidthPattern ..= '|time_block\s+(part|end)>'
+ let subtractShiftwidthPattern ..= '|const_vel\s+end>'
+ let subtractShiftwidthPattern ..= ')'
+
+ " Add shiftwidth
+ if preNoneBlankLine =~? addShiftwidthPattern
+ let ind += &sw
+ endif
+
+ " Subtract shiftwidth
+ if currentLine =~? subtractShiftwidthPattern
+ let ind = ind - &sw
+ endif
+
+ " First case after a switch gets the indent of the switch.
+ if currentLine =~? '\v^\s*case>'
+ \&& preNoneBlankLine =~? '\v^\s*switch>'
+ let ind = ind + &sw
+ endif
+
+ " align continue with the following instruction
+ if currentLine =~? '\v^\s*continue>'
+ \&& getline(v:lnum + 1) =~? subtractShiftwidthPattern
+ let ind = ind - &sw
+ endif
+
+ return ind
+endfunction
+
+" This function works almost like prevnonblank() but handles &-headers,
+" comments and continue instructions like blank lines
+function s:KrlPreNoneBlank(lnum) abort
+
+ let nPreNoneBlank = prevnonblank(a:lnum)
+
+ while nPreNoneBlank > 0 && getline(nPreNoneBlank) =~? '\v^\s*(\&\w\+|;|continue>)'
+ " Previouse none blank line irrelevant. Look further aback.
+ let nPreNoneBlank = prevnonblank(nPreNoneBlank - 1)
+ endwhile
+
+ return nPreNoneBlank
+endfunction
+
+let &cpo = s:keepcpo
+unlet s:keepcpo
+
+" vim:sw=2 sts=2 et
diff --git a/runtime/indent/testdir/krl.in b/runtime/indent/testdir/krl.in
new file mode 100644
index 0000000000..ec90feb08b
--- /dev/null
+++ b/runtime/indent/testdir/krl.in
@@ -0,0 +1,148 @@
+; vim: set ft=krl :
+
+; START_INDENT
+
+def One()
+int i
+If i==1 then
+While i>=1
+For i=1 to 5 step 2
+Loop
+i = i+1
+EndLoop
+EndFor
+EndWhile
+Else
+Repeat
+Switch i
+Case 1
+Skip 123
+i = i+1
+EndSkip 123
+Spline with $acc=100, $vel.cp=3
+slin {x 100}
+scirc {x 110, y 110}, {x 120, y 90}
+slin {x 200} c_dis
+Time_Block Start
+slin {x 300} c_dis
+Time_Block Part = 22.2
+slin {y 400} c_dis
+Time_Block Part = 33.3
+Time_Block End = 10
+slin {y 200} c_dis
+Const_Vel Start +100 OnStart
+slin {y 300} c_dis
+slin {x 100}
+Const_Vel End -5.5
+slin {y 200} c_dis
+EndSpline
+Case 2,3
+PTP_Spline with $acc=100, $vel.ptp=100
+sptp {a1 0} c_ptp
+sptp {a1 90}
+EndSpline c_spl
+Default
+i = i+1
+EndSwitch
+Continue
+Until False
+EndIf
+end
+
+DEF Two()
+int i
+END
+
+global def Three()
+int i
+end
+
+GLOBAL DEF Four()
+int i
+END
+
+Global Def Five()
+int i
+End
+
+deffct bool fOne()
+int i
+endfct
+
+DEFFCT bool fTwo()
+int i
+ENDFCT
+
+global deffct bool fThree()
+int i
+endfct
+
+GLOBAL DEFFCT bool fFour()
+int i
+ENDFCT
+
+Global DefFct bool fFive()
+int i
+EndFct
+
+DefDat datfile()
+global int i=1
+; don't indent column 1 comments unless g:krlCommentIndent is set
+; global int o=2
+EndDat
+
+; END_INDENT
+
+; START_INDENT
+; INDENT_EXE let g:krlSpaceIndent = 0
+; INDENT_EXE set shiftwidth=4
+
+def bla()
+int i
+end
+
+; END_INDENT
+
+; START_INDENT
+; INDENT_EXE let g:krlCommentIndent = 1
+def bla()
+; indent this first column comment because of g:krlCommentIndent=1
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_EXE let g:krlIndentBetweenDef = 0
+def bla()
+int i ; don't indent this line because of g:krlIndentBetweenDef=0
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_AT this-line
+def Some()
+int f
+if true then
+f = 1 ; this-line
+endif
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_NEXT next-line
+def Some()
+ int i
+ ; next-line
+i = 1 ; should get indent of line 'int i' above
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_PREV prev-line
+def Some()
+int f
+if true then
+f = 1
+; prev-line
+endif
+end
+; END_INDENT
diff --git a/runtime/indent/testdir/krl.ok b/runtime/indent/testdir/krl.ok
new file mode 100644
index 0000000000..34dc0f57b1
--- /dev/null
+++ b/runtime/indent/testdir/krl.ok
@@ -0,0 +1,148 @@
+; vim: set ft=krl :
+
+; START_INDENT
+
+def One()
+ int i
+ If i==1 then
+ While i>=1
+ For i=1 to 5 step 2
+ Loop
+ i = i+1
+ EndLoop
+ EndFor
+ EndWhile
+ Else
+ Repeat
+ Switch i
+ Case 1
+ Skip 123
+ i = i+1
+ EndSkip 123
+ Spline with $acc=100, $vel.cp=3
+ slin {x 100}
+ scirc {x 110, y 110}, {x 120, y 90}
+ slin {x 200} c_dis
+ Time_Block Start
+ slin {x 300} c_dis
+ Time_Block Part = 22.2
+ slin {y 400} c_dis
+ Time_Block Part = 33.3
+ Time_Block End = 10
+ slin {y 200} c_dis
+ Const_Vel Start +100 OnStart
+ slin {y 300} c_dis
+ slin {x 100}
+ Const_Vel End -5.5
+ slin {y 200} c_dis
+ EndSpline
+ Case 2,3
+ PTP_Spline with $acc=100, $vel.ptp=100
+ sptp {a1 0} c_ptp
+ sptp {a1 90}
+ EndSpline c_spl
+ Default
+ i = i+1
+ EndSwitch
+ Continue
+ Until False
+ EndIf
+end
+
+DEF Two()
+ int i
+END
+
+global def Three()
+ int i
+end
+
+GLOBAL DEF Four()
+ int i
+END
+
+Global Def Five()
+ int i
+End
+
+deffct bool fOne()
+ int i
+endfct
+
+DEFFCT bool fTwo()
+ int i
+ENDFCT
+
+global deffct bool fThree()
+ int i
+endfct
+
+GLOBAL DEFFCT bool fFour()
+ int i
+ENDFCT
+
+Global DefFct bool fFive()
+ int i
+EndFct
+
+DefDat datfile()
+ global int i=1
+; don't indent column 1 comments unless g:krlCommentIndent is set
+; global int o=2
+EndDat
+
+; END_INDENT
+
+; START_INDENT
+; INDENT_EXE let g:krlSpaceIndent = 0
+; INDENT_EXE set shiftwidth=4
+
+def bla()
+ int i
+end
+
+; END_INDENT
+
+; START_INDENT
+; INDENT_EXE let g:krlCommentIndent = 1
+def bla()
+ ; indent this first column comment because of g:krlCommentIndent=1
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_EXE let g:krlIndentBetweenDef = 0
+def bla()
+int i ; don't indent this line because of g:krlIndentBetweenDef=0
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_AT this-line
+def Some()
+int f
+if true then
+ f = 1 ; this-line
+endif
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_NEXT next-line
+def Some()
+ int i
+ ; next-line
+ i = 1 ; should get indent of line 'int i' above
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_PREV prev-line
+def Some()
+int f
+if true then
+ f = 1
+; prev-line
+endif
+end
+; END_INDENT
diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua
index d4db4850bd..8e372b806c 100644
--- a/runtime/lua/vim/_editor.lua
+++ b/runtime/lua/vim/_editor.lua
@@ -174,11 +174,11 @@ do
if vim.fn.getcmdtype() ~= '' then -- cmdline-mode: paste only 1 line.
if not got_line1 then
got_line1 = (#lines > 1)
- vim.api.nvim_set_option('paste', true) -- For nvim_input().
- -- Escape "<" and control characters
- local line1 = lines[1]:gsub('<', '<lt>'):gsub('(%c)', '\022%1')
- vim.api.nvim_input(line1)
- vim.api.nvim_set_option('paste', false)
+ -- Escape control characters
+ local line1 = lines[1]:gsub('(%c)', '\022%1')
+ -- nvim_input() is affected by mappings,
+ -- so use nvim_feedkeys() with "n" flag to ignore mappings.
+ vim.api.nvim_feedkeys(line1, 'n', true)
end
return true
end
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua
index 1ec66d7c55..80ce1f331d 100644
--- a/runtime/lua/vim/diagnostic.lua
+++ b/runtime/lua/vim/diagnostic.lua
@@ -668,14 +668,10 @@ function M.set(namespace, bufnr, diagnostics, opts)
M.show(namespace, bufnr, nil, opts)
end
- vim.api.nvim_buf_call(bufnr, function()
- vim.api.nvim_command(
- string.format(
- "doautocmd <nomodeline> DiagnosticChanged %s",
- vim.fn.fnameescape(vim.api.nvim_buf_get_name(bufnr))
- )
- )
- end)
+ vim.api.nvim_exec_autocmds("DiagnosticChanged", {
+ modeline = false,
+ buffer = bufnr,
+ })
end
--- Get namespace metadata.
@@ -1382,14 +1378,10 @@ function M.reset(namespace, bufnr)
M.hide(iter_namespace, iter_bufnr)
end
- vim.api.nvim_buf_call(iter_bufnr, function()
- vim.api.nvim_command(
- string.format(
- "doautocmd <nomodeline> DiagnosticChanged %s",
- vim.fn.fnameescape(vim.api.nvim_buf_get_name(iter_bufnr))
- )
- )
- end)
+ vim.api.nvim_exec_autocmds("DiagnosticChanged", {
+ modeline = false,
+ buffer = iter_bufnr,
+ })
end
end
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index 603f9f854a..420d343a8a 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -103,6 +103,11 @@ local extension = {
cbl = "cobol",
atg = "coco",
recipe = "conaryrecipe",
+ hook = function(path, bufnr)
+ if getline(bufnr, 1) == '[Trigger]' then
+ return "conf"
+ end
+ end,
mklx = "context",
mkiv = "context",
mkii = "context",
@@ -338,6 +343,8 @@ local extension = {
l = "lex",
lhs = "lhaskell",
ll = "lifelines",
+ ly = "lilypond",
+ ily = "lilypond",
liquid = "liquid",
cl = "lisp",
L = "lisp",
@@ -382,6 +389,12 @@ local extension = {
mason = "mason",
master = "master",
mas = "master",
+ demo = "maxima",
+ dm1 = "maxima",
+ dm2 = "maxima",
+ dm3 = "maxima",
+ dmt = "maxima",
+ wxm = "maxima",
mel = "mel",
mf = "mf",
mgl = "mgl",
@@ -436,6 +449,7 @@ local extension = {
xin = "omnimark",
opam = "opam",
["or"] = "openroad",
+ scad = "openscad",
ora = "ora",
org = "org",
org_archive = "org",
@@ -902,7 +916,7 @@ local filename = {
Dockerfile = "dockerfile",
npmrc = "dosini",
["/etc/yum.conf"] = "dosini",
- ["/etc/pacman.conf"] = "dosini",
+ ["/etc/pacman.conf"] = "conf",
[".npmrc"] = "dosini",
[".editorconfig"] = "dosini",
dune = "dune",
@@ -1005,6 +1019,7 @@ local filename = {
[".mailcap"] = "mailcap",
["/etc/man.conf"] = "manconf",
["man.config"] = "manconf",
+ ["maxima-init.mac"] = "maxima",
["meson.build"] = "meson",
["meson_options.txt"] = "meson",
["/etc/conf.modules"] = "modconf",
@@ -1181,7 +1196,7 @@ local pattern = {
[".*/etc/DIR_COLORS"] = "dircolors",
[".*/etc/dnsmasq%.conf"] = "dnsmasq",
["php%.ini%-.*"] = "dosini",
- [".*/etc/pacman%.conf"] = "dosini",
+ [".*/etc/pacman%.conf"] = "conf",
[".*/etc/yum%.conf"] = "dosini",
[".*lvs"] = "dracula",
[".*lpe"] = "dracula",
@@ -1472,7 +1487,7 @@ end
--- Filetype mappings can be added either by extension or by filename (either
--- the "tail" or the full file path). The full file path is checked first,
--- followed by the file name. If a match is not found using the filename, then
---- the filename is matched against the list of patterns (sorted by priority)
+--- the filename is matched against the list of |lua-patterns| (sorted by priority)
--- until a match is found. Lastly, if pattern matching does not find a
--- filetype, then the file extension is used.
---
diff --git a/runtime/lua/vim/inspect.lua b/runtime/lua/vim/inspect.lua
index 0448ea487f..b19c215dbb 100644
--- a/runtime/lua/vim/inspect.lua
+++ b/runtime/lua/vim/inspect.lua
@@ -1,7 +1,7 @@
-local inspect ={
- _VERSION = 'inspect.lua 3.1.0',
- _URL = 'http://github.com/kikito/inspect.lua',
- _DESCRIPTION = 'human-readable representations of tables',
+local inspect = {
+ _VERSION = "inspect.lua 3.1.0",
+ _URL = "http://github.com/kikito/inspect.lua",
+ _DESCRIPTION = "human-readable representations of tables",
_LICENSE = [[
MIT LICENSE
@@ -25,13 +25,26 @@ local inspect ={
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- ]]
+ ]],
}
-local tostring = tostring
+inspect.KEY = setmetatable({}, {
+ __tostring = function()
+ return "inspect.KEY"
+ end,
+})
+inspect.METATABLE = setmetatable({}, {
+ __tostring = function()
+ return "inspect.METATABLE"
+ end,
+})
-inspect.KEY = setmetatable({}, {__tostring = function() return 'inspect.KEY' end})
-inspect.METATABLE = setmetatable({}, {__tostring = function() return 'inspect.METATABLE' end})
+local tostring = tostring
+local rep = string.rep
+local match = string.match
+local char = string.char
+local gsub = string.gsub
+local fmt = string.format
local function rawpairs(t)
return next, t, nil
@@ -40,299 +53,289 @@ end
-- Apostrophizes the string if it has quotes, but not aphostrophes
-- Otherwise, it returns a regular quoted string
local function smartQuote(str)
- if str:match('"') and not str:match("'") then
+ if match(str, '"') and not match(str, "'") then
return "'" .. str .. "'"
end
- return '"' .. str:gsub('"', '\\"') .. '"'
+ return '"' .. gsub(str, '"', '\\"') .. '"'
end
-- \a => '\\a', \0 => '\\0', 31 => '\31'
local shortControlCharEscapes = {
- ["\a"] = "\\a", ["\b"] = "\\b", ["\f"] = "\\f", ["\n"] = "\\n",
- ["\r"] = "\\r", ["\t"] = "\\t", ["\v"] = "\\v"
+ ["\a"] = "\\a",
+ ["\b"] = "\\b",
+ ["\f"] = "\\f",
+ ["\n"] = "\\n",
+ ["\r"] = "\\r",
+ ["\t"] = "\\t",
+ ["\v"] = "\\v",
+ ["\127"] = "\\127",
}
-local longControlCharEscapes = {} -- \a => nil, \0 => \000, 31 => \031
-for i=0, 31 do
- local ch = string.char(i)
+local longControlCharEscapes = { ["\127"] = "\127" }
+for i = 0, 31 do
+ local ch = char(i)
if not shortControlCharEscapes[ch] then
- shortControlCharEscapes[ch] = "\\"..i
- longControlCharEscapes[ch] = string.format("\\%03d", i)
+ shortControlCharEscapes[ch] = "\\" .. i
+ longControlCharEscapes[ch] = fmt("\\%03d", i)
end
end
local function escape(str)
- return (str:gsub("\\", "\\\\")
- :gsub("(%c)%f[0-9]", longControlCharEscapes)
- :gsub("%c", shortControlCharEscapes))
+ return (gsub(gsub(gsub(str, "\\", "\\\\"), "(%c)%f[0-9]", longControlCharEscapes), "%c", shortControlCharEscapes))
end
local function isIdentifier(str)
- return type(str) == 'string' and str:match( "^[_%a][_%a%d]*$" )
+ return type(str) == "string" and not not str:match("^[_%a][_%a%d]*$")
end
+local flr = math.floor
local function isSequenceKey(k, sequenceLength)
- return type(k) == 'number'
- and 1 <= k
- and k <= sequenceLength
- and math.floor(k) == k
+ return type(k) == "number" and flr(k) == k and 1 <= k and k <= sequenceLength
end
local defaultTypeOrders = {
- ['number'] = 1, ['boolean'] = 2, ['string'] = 3, ['table'] = 4,
- ['function'] = 5, ['userdata'] = 6, ['thread'] = 7
+ ["number"] = 1,
+ ["boolean"] = 2,
+ ["string"] = 3,
+ ["table"] = 4,
+ ["function"] = 5,
+ ["userdata"] = 6,
+ ["thread"] = 7,
}
local function sortKeys(a, b)
local ta, tb = type(a), type(b)
-- strings and numbers are sorted numerically/alphabetically
- if ta == tb and (ta == 'string' or ta == 'number') then return a < b end
+ if ta == tb and (ta == "string" or ta == "number") then
+ return a < b
+ end
- local dta, dtb = defaultTypeOrders[ta], defaultTypeOrders[tb]
+ local dta = defaultTypeOrders[ta] or 100
+ local dtb = defaultTypeOrders[tb] or 100
-- Two default types are compared according to the defaultTypeOrders table
- if dta and dtb then return defaultTypeOrders[ta] < defaultTypeOrders[tb]
- elseif dta then return true -- default types before custom ones
- elseif dtb then return false -- custom types after default ones
- end
-- custom types are sorted out alphabetically
- return ta < tb
+ return dta == dtb and ta < tb or dta < dtb
end
--- For implementation reasons, the behavior of rawlen & # is "undefined" when
--- tables aren't pure sequences. So we implement our own # operator.
-local function getSequenceLength(t)
- local len = 1
- local v = rawget(t,len)
- while v ~= nil do
- len = len + 1
- v = rawget(t,len)
+local function getKeys(t)
+ local seqLen = 1
+ while rawget(t, seqLen) ~= nil do
+ seqLen = seqLen + 1
end
- return len - 1
-end
+ seqLen = seqLen - 1
-local function getNonSequentialKeys(t)
- local keys, keysLength = {}, 0
- local sequenceLength = getSequenceLength(t)
- for k,_ in rawpairs(t) do
- if not isSequenceKey(k, sequenceLength) then
- keysLength = keysLength + 1
- keys[keysLength] = k
+ local keys, keysLen = {}, 0
+ for k in rawpairs(t) do
+ if not isSequenceKey(k, seqLen) then
+ keysLen = keysLen + 1
+ keys[keysLen] = k
end
end
table.sort(keys, sortKeys)
- return keys, keysLength, sequenceLength
+ return keys, keysLen, seqLen
end
-local function countTableAppearances(t, tableAppearances)
- tableAppearances = tableAppearances or {}
-
- if type(t) == 'table' then
- if not tableAppearances[t] then
- tableAppearances[t] = 1
- for k,v in rawpairs(t) do
- countTableAppearances(k, tableAppearances)
- countTableAppearances(v, tableAppearances)
- end
- countTableAppearances(getmetatable(t), tableAppearances)
+local function countCycles(x, cycles)
+ if type(x) == "table" then
+ if cycles[x] then
+ cycles[x] = cycles[x] + 1
else
- tableAppearances[t] = tableAppearances[t] + 1
+ cycles[x] = 1
+ for k, v in rawpairs(x) do
+ countCycles(k, cycles)
+ countCycles(v, cycles)
+ end
+ countCycles(getmetatable(x), cycles)
end
end
-
- return tableAppearances
-end
-
-local copySequence = function(s)
- local copy, len = {}, #s
- for i=1, len do copy[i] = s[i] end
- return copy, len
end
-local function makePath(path, ...)
- local keys = {...}
- local newPath, len = copySequence(path)
- for i=1, #keys do
- newPath[len + i] = keys[i]
+local function makePath(path, a, b)
+ local newPath = {}
+ local len = #path
+ for i = 1, len do
+ newPath[i] = path[i]
end
+
+ newPath[len + 1] = a
+ newPath[len + 2] = b
+
return newPath
end
local function processRecursive(process, item, path, visited)
- if item == nil then return nil end
- if visited[item] then return visited[item] end
+ if item == nil then
+ return nil
+ end
+ if visited[item] then
+ return visited[item]
+ end
local processed = process(item, path)
- if type(processed) == 'table' then
+ if type(processed) == "table" then
local processedCopy = {}
visited[item] = processedCopy
local processedKey
- for k,v in rawpairs(processed) do
+ for k, v in rawpairs(processed) do
processedKey = processRecursive(process, k, makePath(path, k, inspect.KEY), visited)
if processedKey ~= nil then
processedCopy[processedKey] = processRecursive(process, v, makePath(path, processedKey), visited)
end
end
- local mt = processRecursive(process, getmetatable(processed), makePath(path, inspect.METATABLE), visited)
- if type(mt) ~= 'table' then mt = nil end -- ignore not nil/table __metatable field
+ local mt = processRecursive(process, getmetatable(processed), makePath(path, inspect.METATABLE), visited)
+ if type(mt) ~= "table" then
+ mt = nil
+ end
setmetatable(processedCopy, mt)
processed = processedCopy
end
return processed
end
-
-
--------------------------------------------------------------------
-
-local Inspector = {}
-local Inspector_mt = {__index = Inspector}
-
-function Inspector:puts(...)
- local args = {...}
- local buffer = self.buffer
- local len = #buffer
- for i=1, #args do
- len = len + 1
- buffer[len] = args[i]
- end
+local function puts(buf, str)
+ buf.n = buf.n + 1
+ buf[buf.n] = str
end
-function Inspector:down(f)
- self.level = self.level + 1
- f()
- self.level = self.level - 1
-end
+local Inspector = {}
-function Inspector:tabify()
- self:puts(self.newline, string.rep(self.indent, self.level))
-end
+local Inspector_mt = { __index = Inspector }
-function Inspector:alreadyVisited(v)
- return self.ids[v] ~= nil
+local function tabify(inspector)
+ puts(inspector.buf, inspector.newline .. rep(inspector.indent, inspector.level))
end
function Inspector:getId(v)
local id = self.ids[v]
+ local ids = self.ids
if not id then
local tv = type(v)
- id = (self.maxIds[tv] or 0) + 1
- self.maxIds[tv] = id
- self.ids[v] = id
+ id = (ids[tv] or 0) + 1
+ ids[v], ids[tv] = id, id
end
return tostring(id)
end
-function Inspector:putKey(k)
- if isIdentifier(k) then return self:puts(k) end
- self:puts("[")
- self:putValue(k)
- self:puts("]")
-end
+function Inspector:putValue(v)
+ local buf = self.buf
+ local tv = type(v)
+ if tv == "string" then
+ puts(buf, smartQuote(escape(v)))
+ elseif
+ tv == "number"
+ or tv == "boolean"
+ or tv == "nil"
+ or tv == "cdata"
+ or tv == "ctype"
+ or (vim and v == vim.NIL)
+ then
+ puts(buf, tostring(v))
+ elseif tv == "table" and not self.ids[v] then
+ local t = v
+
+ if t == inspect.KEY or t == inspect.METATABLE then
+ puts(buf, tostring(t))
+ elseif self.level >= self.depth then
+ puts(buf, "{...}")
+ else
+ if self.cycles[t] > 1 then
+ puts(buf, fmt("<%d>", self:getId(t)))
+ end
-function Inspector:putTable(t)
- if t == inspect.KEY or t == inspect.METATABLE then
- self:puts(tostring(t))
- elseif self:alreadyVisited(t) then
- self:puts('<table ', self:getId(t), '>')
- elseif self.level >= self.depth then
- self:puts('{...}')
- else
- if self.tableAppearances[t] > 1 then self:puts('<', self:getId(t), '>') end
-
- local nonSequentialKeys, nonSequentialKeysLength, sequenceLength = getNonSequentialKeys(t)
- local mt = getmetatable(t)
- if (vim and sequenceLength == 0 and nonSequentialKeysLength == 0
- and mt == vim._empty_dict_mt) then
- self:puts(tostring(t))
- return
- end
+ local keys, keysLen, seqLen = getKeys(t)
+ local mt = getmetatable(t)
- self:puts('{')
- self:down(function()
- local count = 0
- for i=1, sequenceLength do
- if count > 0 then self:puts(',') end
- self:puts(' ')
- self:putValue(t[i])
- count = count + 1
+ if vim and seqLen == 0 and keysLen == 0 and mt == vim._empty_dict_mt then
+ puts(buf, tostring(t))
+ return
end
- for i=1, nonSequentialKeysLength do
- local k = nonSequentialKeys[i]
- if count > 0 then self:puts(',') end
- self:tabify()
- self:putKey(k)
- self:puts(' = ')
- self:putValue(t[k])
- count = count + 1
+ puts(buf, "{")
+ self.level = self.level + 1
+
+ for i = 1, seqLen + keysLen do
+ if i > 1 then
+ puts(buf, ",")
+ end
+ if i <= seqLen then
+ puts(buf, " ")
+ self:putValue(t[i])
+ else
+ local k = keys[i - seqLen]
+ tabify(self)
+ if isIdentifier(k) then
+ puts(buf, k)
+ else
+ puts(buf, "[")
+ self:putValue(k)
+ puts(buf, "]")
+ end
+ puts(buf, " = ")
+ self:putValue(t[k])
+ end
end
- if type(mt) == 'table' then
- if count > 0 then self:puts(',') end
- self:tabify()
- self:puts('<metatable> = ')
+ if type(mt) == "table" then
+ if seqLen + keysLen > 0 then
+ puts(buf, ",")
+ end
+ tabify(self)
+ puts(buf, "<metatable> = ")
self:putValue(mt)
end
- end)
- if nonSequentialKeysLength > 0 or type(mt) == 'table' then -- result is multi-lined. Justify closing }
- self:tabify()
- elseif sequenceLength > 0 then -- array tables have one extra space before closing }
- self:puts(' ')
- end
+ self.level = self.level - 1
- self:puts('}')
- end
-end
-
-function Inspector:putValue(v)
- local tv = type(v)
+ if keysLen > 0 or type(mt) == "table" then
+ tabify(self)
+ elseif seqLen > 0 then
+ puts(buf, " ")
+ end
- if tv == 'string' then
- self:puts(smartQuote(escape(v)))
- elseif tv == 'number' or tv == 'boolean' or tv == 'nil' or
- tv == 'cdata' or tv == 'ctype' or (vim and v == vim.NIL) then
- self:puts(tostring(v))
- elseif tv == 'table' then
- self:putTable(v)
+ puts(buf, "}")
+ end
else
- self:puts('<', tv, ' ', self:getId(v), '>')
+ puts(buf, fmt("<%s %d>", tv, self:getId(v)))
end
end
--------------------------------------------------------------------
-
function inspect.inspect(root, options)
- options = options or {}
+ options = options or {}
- local depth = options.depth or math.huge
- local newline = options.newline or '\n'
- local indent = options.indent or ' '
+ local depth = options.depth or math.huge
+ local newline = options.newline or "\n"
+ local indent = options.indent or " "
local process = options.process
if process then
root = processRecursive(process, root, {}, {})
end
+ local cycles = {}
+ countCycles(root, cycles)
+
local inspector = setmetatable({
- depth = depth,
- level = 0,
- buffer = {},
- ids = {},
- maxIds = {},
- newline = newline,
- indent = indent,
- tableAppearances = countTableAppearances(root)
+ buf = { n = 0 },
+ ids = {},
+ cycles = cycles,
+ depth = depth,
+ level = 0,
+ newline = newline,
+ indent = indent,
}, Inspector_mt)
inspector:putValue(root)
- return table.concat(inspector.buffer)
+ return table.concat(inspector.buf)
end
-setmetatable(inspect, { __call = function(_, ...) return inspect.inspect(...) end })
+setmetatable(inspect, {
+ __call = function(_, root, options)
+ return inspect.inspect(root, options)
+ end,
+})
return inspect
diff --git a/runtime/lua/vim/keymap.lua b/runtime/lua/vim/keymap.lua
index 0986d21196..d07232f52f 100644
--- a/runtime/lua/vim/keymap.lua
+++ b/runtime/lua/vim/keymap.lua
@@ -40,6 +40,8 @@ local keymap = {}
--
---@param opts table A table of |:map-arguments| such as "silent". In addition to the options
--- listed in |nvim_set_keymap()|, this table also accepts the following keys:
+--- - buffer: (number or boolean) Add a mapping to the given buffer. When "true"
+--- or 0, use the current buffer.
--- - replace_keycodes: (boolean, default true) When both this and expr is "true",
--- |nvim_replace_termcodes()| is applied to the result of Lua expr maps.
--- - remap: (boolean) Make the mapping recursive. This is the
@@ -128,7 +130,6 @@ function keymap.del(modes, lhs, opts)
local buffer = false
if opts.buffer ~= nil then
buffer = opts.buffer == true and 0 or opts.buffer
- opts.buffer = nil
end
if buffer == false then
diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua
index 9871f00677..71b4d33ec0 100644
--- a/runtime/lua/vim/lsp/handlers.lua
+++ b/runtime/lua/vim/lsp/handlers.lua
@@ -33,7 +33,7 @@ local function progress_handler(_, result, ctx, _)
local val = result.value -- unspecified yet
local token = result.token -- string or number
-
+ if type(val) ~= 'table' then val = { content=val } end
if val.kind then
if val.kind == 'begin' then
client.messages.progress[token] = {
@@ -53,7 +53,8 @@ local function progress_handler(_, result, ctx, _)
end
end
else
- table.insert(client.messages, {content = val, show_once = true, shown = 0})
+ client.messages.progress[token] = val
+ client.messages.progress[token].done = true
end
vim.api.nvim_command("doautocmd <nomodeline> User LspProgressUpdate")
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 30587afb38..1f1a34b04a 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -302,7 +302,6 @@ end
function M.get_progress_messages()
local new_messages = {}
- local msg_remove = {}
local progress_remove = {}
for _, client in ipairs(vim.lsp.get_active_clients()) do
@@ -325,29 +324,6 @@ function M.get_progress_messages()
end
end
- for i, msg in ipairs(data.messages) do
- if msg.show_once then
- msg.shown = msg.shown + 1
- if msg.shown > 1 then
- table.insert(msg_remove, {client = client, idx = i})
- end
- end
-
- table.insert(new_messages, {name = data.name, content = msg.content})
- end
-
- if next(data.status) ~= nil then
- table.insert(new_messages, {
- name = data.name,
- content = data.status.content,
- uri = data.status.uri,
- status = true
- })
- end
- for _, item in ipairs(msg_remove) do
- table.remove(client.messages, item.idx)
- end
-
end
for _, item in ipairs(progress_remove) do
diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua
index f9d539f028..55398d8180 100644
--- a/runtime/lua/vim/treesitter.lua
+++ b/runtime/lua/vim/treesitter.lua
@@ -90,7 +90,7 @@ function M.get_parser(bufnr, lang, opts)
lang = a.nvim_buf_get_option(bufnr, "filetype")
end
- if parsers[bufnr] == nil then
+ if parsers[bufnr] == nil or parsers[bufnr]:lang() ~= lang then
parsers[bufnr] = M._create_parser(bufnr, lang, opts)
end
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index 71456e788d..8a7dcb0e75 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -2,7 +2,7 @@
"
" Author: Bram Moolenaar
" Copyright: Vim license applies, see ":help license"
-" Last Change: 2022 Jan 17
+" Last Change: 2022 Apr 16
"
" WORK IN PROGRESS - The basics works stable, more to come
" Note: In general you need at least GDB 7.12 because this provides the
@@ -466,7 +466,7 @@ endfunc
func s:StartDebugCommon(dict)
" Sign used to highlight the line where the program has stopped.
" There can be only one.
- sign define debugPC linehl=debugPC
+ call sign_define('debugPC', #{linehl: 'debugPC'})
" Install debugger commands in the text window.
call win_gotoid(s:sourcewin)
@@ -700,7 +700,9 @@ func s:EndDebugCommon()
endif
endif
endfor
- exe was_buf .. "buf"
+ if bufexists(was_buf)
+ exe was_buf .. "buf"
+ endif
call s:DeleteCommands()
@@ -759,8 +761,8 @@ func s:HandleDisasmMsg(msg)
let lnum = search('^' . s:asm_addr)
if lnum != 0
- exe 'sign unplace ' . s:asm_id
- exe 'sign place ' . s:asm_id . ' line=' . lnum . ' name=debugPC'
+ call sign_unplace('TermDebug', #{id: s:asm_id})
+ call sign_place(s:asm_id, 'TermDebug', 'debugPC', '%', #{lnum: lnum})
endif
call win_gotoid(curwinid)
@@ -846,6 +848,7 @@ func s:InstallCommands()
command Clear call s:ClearBreakpoint()
command Step call s:SendResumingCommand('-exec-step')
command Over call s:SendResumingCommand('-exec-next')
+ command -nargs=? Until call s:Until(<q-args>)
command Finish call s:SendResumingCommand('-exec-finish')
command -nargs=* Run call s:Run(<q-args>)
command -nargs=* Arguments call s:SendResumingCommand('-exec-arguments ' . <q-args>)
@@ -904,6 +907,7 @@ func s:DeleteCommands()
delcommand Clear
delcommand Step
delcommand Over
+ delcommand Until
delcommand Finish
delcommand Run
delcommand Arguments
@@ -933,22 +937,30 @@ func s:DeleteCommands()
unlet s:k_map_saved
endif
- exe 'sign unplace ' . s:pc_id
- for [id, entries] in items(s:breakpoints)
- for subid in keys(entries)
- exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
- endfor
- endfor
+ call sign_unplace('TermDebug')
unlet s:breakpoints
unlet s:breakpoint_locations
- sign undefine debugPC
- for val in s:BreakpointSigns
- exe "sign undefine debugBreakpoint" . val
- endfor
+ call sign_undefine('debugPC')
+ call sign_undefine(s:BreakpointSigns->map("'debugBreakpoint' .. v:val"))
let s:BreakpointSigns = []
endfunc
+" :Until - Execute until past a specified position or current line
+func s:Until(at)
+ if s:stopped
+ " reset s:stopped here, it may take a bit of time before we get a response
+ let s:stopped = 0
+ " call ch_log('assume that program is running after this command')
+ " Use the fname:lnum format
+ let at = empty(a:at) ?
+ \ fnameescape(expand('%:p')) . ':' . line('.') : a:at
+ call s:SendCommand('-exec-until ' . at)
+ " else
+ " call ch_log('dropping command, program is running: exec-until')
+ endif
+endfunc
+
" :Break - Set a breakpoint at the cursor position.
func s:SetBreakpoint(at)
" Setting a breakpoint may not work while the program is running.
@@ -982,7 +994,8 @@ func s:ClearBreakpoint()
" Assume this always works, the reply is simply "^done".
call s:SendCommand('-break-delete ' . id)
for subid in keys(s:breakpoints[id])
- exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
+ call sign_unplace('TermDebug',
+ \ #{id: s:Breakpoint2SignNumber(id, subid)})
endfor
unlet s:breakpoints[id]
unlet s:breakpoint_locations[bploc][idx]
@@ -1304,8 +1317,8 @@ func s:GotoAsmwinOrCreateIt()
call s:SendCommand('disassemble $pc')
endif
else
- exe 'sign unplace ' . s:asm_id
- exe 'sign place ' . s:asm_id . ' line=' . lnum . ' name=debugPC'
+ call sign_unplace('TermDebug', #{id: s:asm_id})
+ call sign_place(s:asm_id, 'TermDebug', 'debugPC', '%', #{lnum: lnum})
endif
endif
endfunc
@@ -1340,8 +1353,8 @@ func s:HandleCursor(msg)
if lnum == 0
call s:SendCommand('disassemble $pc')
else
- exe 'sign unplace ' . s:asm_id
- exe 'sign place ' . s:asm_id . ' line=' . lnum . ' name=debugPC'
+ call sign_unplace('TermDebug', #{id: s:asm_id})
+ call sign_place(s:asm_id, 'TermDebug', 'debugPC', '%', #{lnum: lnum})
endif
call win_gotoid(curwinid)
@@ -1378,8 +1391,9 @@ func s:HandleCursor(msg)
endif
exe lnum
normal! zv
- exe 'sign unplace ' . s:pc_id
- exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC file=' . fname
+ call sign_unplace('TermDebug', #{id: s:pc_id})
+ call sign_place(s:pc_id, 'TermDebug', 'debugPC', fname,
+ \ #{lnum: lnum, priority: 110})
if !exists('b:save_signcolumn')
let b:save_signcolumn = &signcolumn
call add(s:signcolumn_buflist, bufnr())
@@ -1387,7 +1401,7 @@ func s:HandleCursor(msg)
setlocal signcolumn=yes
endif
elseif !s:stopped || fname != ''
- exe 'sign unplace ' . s:pc_id
+ call sign_unplace('TermDebug', #{id: s:pc_id})
endif
call win_gotoid(wid)
@@ -1404,7 +1418,9 @@ func s:CreateBreakpoint(id, subid, enabled)
else
let hiName = "debugBreakpoint"
endif
- exe "sign define debugBreakpoint" . nr . " text=" . substitute(nr, '\..*', '', '') . " texthl=" . hiName
+ call sign_define('debugBreakpoint' .. nr,
+ \ #{text: substitute(nr, '\..*', '', ''),
+ \ texthl: hiName})
endif
endfunc
@@ -1482,7 +1498,9 @@ endfunc
func s:PlaceSign(id, subid, entry)
let nr = printf('%d.%d', a:id, a:subid)
- exe 'sign place ' . s:Breakpoint2SignNumber(a:id, a:subid) . ' line=' . a:entry['lnum'] . ' name=debugBreakpoint' . nr . ' priority=110 file=' . a:entry['fname']
+ call sign_place(s:Breakpoint2SignNumber(a:id, a:subid), 'TermDebug',
+ \ 'debugBreakpoint' .. nr, a:entry['fname'],
+ \ #{lnum: a:entry['lnum'], priority: 110})
let a:entry['placed'] = 1
endfunc
@@ -1496,7 +1514,8 @@ func s:HandleBreakpointDelete(msg)
if has_key(s:breakpoints, id)
for [subid, entry] in items(s:breakpoints[id])
if has_key(entry, 'placed')
- exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
+ call sign_unplace('TermDebug',
+ \ #{id: s:Breakpoint2SignNumber(id, subid)})
unlet entry['placed']
endif
endfor
diff --git a/runtime/syntax/krl.vim b/runtime/syntax/krl.vim
new file mode 100644
index 0000000000..a50790841e
--- /dev/null
+++ b/runtime/syntax/krl.vim
@@ -0,0 +1,458 @@
+" Vim syntax file
+" Language: Kuka Robot Language
+" Maintainer: Patrick Meiser-Knosowski <knosowski@graeffrobotics.de>
+" Version: 3.0.0
+" Last Change: 18. Apr 2022
+" Credits: Thanks for contributions to this to Michael Jagusch
+" Thanks for beta testing to Thomas Baginski
+"
+" Note to self:
+" for testing perfomance
+" open a 1000 lines file.
+" :syntime on
+" G
+" hold down CTRL-U until reaching top
+" :syntime report
+
+" Init {{{
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:keepcpo = &cpo
+set cpo&vim
+
+" if colorscheme is tortus(less)? krlGroupName defaults to 1
+if get(g:, 'colors_name', " ") =~ '\<tortus'
+ \&& !exists("g:krlGroupName")
+ let g:krlGroupName=1
+endif
+" krlGroupName defaults to 0 if it's not initialized yet or 0
+if !get(g:, "krlGroupName", 0)
+ let g:krlGroupName = 0
+endif
+
+" krl does ignore case
+syn case ignore
+" take #, $ and & into keyword (syntax only)
+syn iskeyword @,48-57,_,192-255,#,$,&
+" spell checking
+syn spell notoplevel
+" }}} init
+
+" Comment and Folding {{{
+
+" Special Comment
+
+" TODO Comment
+syn keyword krlTodo contained TODO FIXME XXX
+highlight default link krlTodo Todo
+
+" Debug Comment
+syn keyword krlDebug contained DEBUG
+highlight default link krlDebug Debug
+
+" Comment
+" none move fold comment until second ;
+syn match krlFoldComment /\c\v^\s*;\s*%(end)?fold>[^;]*/ containedin=krlFold contains=krlSingleQuoteString,krlInteger,krlFloat,krlMovement,krlDelimiter,krlBoolean
+highlight default link krlFoldComment Comment
+
+" move fold comment until second ;
+syn match krlMoveFoldComment /\c\v^\s*;\s*fold>[^;]*<s?%(ptp|lin|circ|spl)(_rel)?>[^;]*/ containedin=krlFold contains=krlInteger,krlFloat,krlMovement,krlDelimiter
+highlight default link krlMoveFoldComment Comment
+
+" things to highlight in a fold line
+syn keyword krlFoldHighlights CONT IN SYN OUT containedin=krlFoldComment
+syn match krlFoldHighlights /\c\v<(M|F|E|A|t|i|bin|binin|UP|SPSMAKRO)\d+>/ containedin=krlFoldComment
+if g:krlGroupName
+ highlight default link krlFoldHighlights Sysvars
+else
+ " default color for Fold Highlights
+endif
+syn keyword krlVkrcFoldConstants EIN AUS containedin=krlFoldComment
+highlight default link krlVkrcFoldConstants Boolean
+
+" Comment without Fold, also includes endfold lines and fold line part after second ;
+syn match krlComment /\c\v;\s*%(<%(end)?fold>)@!.*$/ containedin=krlFold contains=krlTodo,krlDebug,@Spell
+" Commented out Fold line: "; ;FOLD PTP..."
+syn match krlComment /\c\v^\s*;\s*;.*$/ contains=krlTodo,krlDebug
+highlight default link krlComment Comment
+
+if has("conceal") && get(g:, 'krlConcealFoldTail', 1)
+ syn match krlConcealFoldTail /\c\v(^\s*;\s*fold[^;]*)@250<=;%(--|\s*<fold>|\s*<endfold>)@!.*$/ transparent containedin=krlComment conceal cchar=*
+endif
+" }}} Comment and Folding
+
+" Header {{{
+syn match krlHeader /&\a\w*/
+highlight default link krlHeader PreProc
+" }}} Header
+
+" Operator {{{
+" Boolean operator
+syn keyword krlBoolOperator and or exor not b_and b_or b_exor b_not
+highlight default link krlBoolOperator Operator
+" Arithmetic operator
+syn match krlArithOperator /[+-]/ containedin=krlFloat
+syn match krlArithOperator /[*/]/
+highlight default link krlArithOperator Operator
+" Compare operator
+syn match krlCompOperator /[<>=]/
+highlight default link krlCompOperator Operator
+" Geometric operator
+" Do not move the : operator
+" Must be present befor krlParamdef
+syn match krlGeomOperator /[:]/
+" syn match krlGeomOperator /[:]/ containedin=krlLabel,krlParamdef
+highlight default link krlGeomOperator Operator
+" }}} Operator
+
+" Type, StorageClass and Typedef {{{
+" Simple data types
+syn keyword krlType bool char real int containedin=krlAnyType
+" External program and function
+syn keyword krlType ext extfct extfctp extp containedin=krlAnyType
+" Communication
+syn keyword krlType signal channel containedin=krlAnyType
+highlight default link krlType Type
+" StorageClass
+syn keyword krlStorageClass decl global const struc enum
+highlight default link krlStorageClass StorageClass
+" .dat file public
+syn keyword krlDatStorageClass public
+highlight default link krlDatStorageClass StorageClass
+" Parameter StorageClass
+" Do not move the :in/:out
+" Must be present after krlGeomOperator
+syn match krlParamdef /[:]\s*in\>/
+syn match krlParamdef /[:]\s*out\>/
+highlight default link krlParamdef StorageClass
+" Not a typedef but I like to have those highlighted
+" different then types, structures or strorage classes
+syn keyword krlTypedef DEF DEFFCT ENDFCT DEFDAT ENDDAT
+syn match krlTypedef /^\s*END\>/
+highlight default link krlTypedef Typedef
+" }}} Type, StorageClass and Typedef
+
+" Delimiter {{{
+syn match krlDelimiter /[\[\](),\\]/
+highlight default link krlDelimiter Delimiter
+" }}} Delimiter
+
+" Constant values {{{
+" Boolean
+syn keyword krlBoolean true false containedin=krlStructVal
+highlight default link krlBoolean Boolean
+" Binary integer
+syn match krlBinaryInt /'b[01]\+'/ containedin=krlStructVal
+highlight default link krlBinaryInt Number
+" Hexadecimal integer
+syn match krlHexInt /'h[0-9a-fA-F]\+'/ containedin=krlStructVal
+highlight default link krlHexInt Number
+" Integer
+syn match krlInteger /\W\@1<=[+-]\?\d\+/ containedin=krlStructVal,krlFloat contains=krlArithOperator
+highlight default link krlInteger Number
+" Float
+syn match krlFloat /\v\W@1<=[+-]?\d+\.?\d*%(\s*[eE][+-]?\d+)?/ containedin=krlStructVal
+highlight default link krlFloat Float
+" String
+syn region krlString start=/"/ end=/"/ oneline containedin=krlStructVal contains=@Spell
+highlight default link krlString String
+syn match krlSpecialChar /[|]/ containedin=krlString
+highlight default link krlSpecialChar SpecialChar
+" String within a fold line
+syn region krlSingleQuoteString start=/'/ end=/'/ oneline contained contains=@Spell
+highlight default link krlSingleQuoteString String
+" Enum
+syn match krlEnumVal /#\s*\a\w*/ containedin=krlStructVal
+highlight default link krlEnumVal Constant
+" }}} Constant values
+
+" Predefined Structure and Enum {{{
+" Predefined structures and enums found in
+" /r1/mada/$*.dat, /r1/steu/$*.dat and
+" /r1/system/$config.dat as well as
+" basisTech, gripperTech and spotTech
+"
+" Predefined data types found in krc1
+syn keyword krlStructure servopara keymove powermodul trace techangle tech techfct techcps techfctctrl axis_inc axis_cal date display_var pro_ip con bus
+syn keyword krlEnum ident_state sig_state move_state async_state emt_mode boxmode msg_prm_typ msg_typ cmd_stat asys trace_state trace_mode direction techsys techgeoref techclass techmode hpu_key_val pro_state eax transsys mode_move cosys device rotsys emstop cause_t
+"
+" Predefined data types found in kss functions
+syn keyword krlEnum ediagstate rdc_fs_state ret_c_psync_e var_type cancel_psync_e sys_vars
+syn keyword krlStructure siginf rw_rdc_file rw_mam_file diagpar_t error_t stopmess case_sense_t msgbuf_t e3pos e3axis diagopt_t
+"
+" Predefined structures for movement
+syn keyword krlStructure frame e6pos pos e6axis axis
+syn keyword krlStructure fdat ldat pdat
+syn keyword krlStructure load inertia
+"
+" Predefined structures for shapes
+syn keyword krlStructure axbox cylinder box
+"
+" Predefined structures and enums found in /r1/mada/$machine.dat
+syn keyword krlStructure cp fra acc_car jerk_struc dhart spin trpspin ex_kin et_ax maxtool
+syn keyword krlEnum individual_mames supply_voltage kinclass main_axis wrist_axis sw_onoff
+"
+" Predefined structures and enums found in /r1/mada/$robcor.dat
+" syn keyword krlStructure
+syn keyword krlEnum adap_acc model_type control_parameter eko_mode
+"
+" Predefined structures and enums found in /steu/mada/$custom.dat
+syn keyword krlStructure pro_io_t ser ext_mod_t coop_krc ws_config bin_type coop_update_t ldc_reaction
+syn keyword krlEnum axis_of_coordinates spline_para_variant target_status cp_vel_type cp_statmon
+"
+" Predefined structures and enums found in /steu/mada/$machine.dat
+syn keyword krlStructure emstop_path boxstatesafein boxstatesafeout
+syn keyword krlEnum digincode
+"
+" Predefined structures and enums found in /steu/mada/$option.dat
+syn keyword krlStructure msg_t
+" syn keyword krlEnum
+"
+" Predefined structures and enums found in /r1/system/$config.dat
+" BasisTech
+syn keyword krlStructure dig_out_type ctrl_in_t ctrl_out_t fct_out_t fct_in_t odat basis_sugg_t out_sugg_t md_state machine_def_t machine_tool_t machine_frame_t trigger_para constvel_para condstop_para adat tm_sugg_t tqm_tqdat_t sps_prog_type
+syn keyword krlEnum bas_command out_modetype ipo_m_t apo_mode_t funct_type p00_command timer_actiontype
+"
+" GripperTech
+syn keyword krlStructure grp_typ grp_types grp_sugg_t
+syn keyword krlEnum on_off_typ apo_typ
+"
+" SpotTech
+syn keyword krlStructure spot_type spot_sugg_t
+syn keyword krlEnum s_command s_pair_slct command_retr
+"
+" VW
+syn keyword krlStructure vw_mpara_typ zangentyp zangenbedingung ibszangentyp last_ibs_typ verr_typ verrcheck_t t_fb_state kollisionsdaten state_t modus_t
+syn keyword krlEnum synctype dir_typ subtype ari_typ bool_typ vw_command ibgn_command vw_user_cmd move_types adv_t_type bas_type ibs_mode_typ vw_user_cmd pro_mode mode_op
+"
+" ProgCoop
+syn keyword krlStructure ydat
+" syn keyword krlEnum
+"
+" bas.src
+syn keyword krlStructure cont
+syn keyword krlEnum esys ipo_mode circ_mode circ_type ori_type var_state
+"
+" MsgLib.src
+syn keyword krlStructure KrlMsg_T KrlMsgParType_T KrlMsgPar_T KrlMsgOpt_T KrlMsgDlgSK_T
+syn keyword krlEnum EKrlMsgType
+"
+highlight default link krlStructure Structure
+highlight default link krlEnum Structure
+" }}} Predefined Structure and Enum
+
+" System variable {{{
+syn match krlSysvars /\<\$\a[a-zA-Z0-9_.]*/
+if g:krlGroupName
+ highlight default link krlSysvars Sysvars
+else
+ " default color for Sysvars
+endif
+" }}} System variable
+
+" Statements, keywords et al {{{
+" continue
+syn keyword krlContinue continue
+if g:krlGroupName
+ highlight default link krlContinue Continue
+else
+ highlight default link krlContinue Statement
+endif
+" interrupt
+syn match krlStatement /\v\c%(<global>\s+)?<INTERRUPT>%(\s+<decl>)?/ contains=krlStorageClass
+" keywords
+syn keyword krlStatement wait on off enable disable stop trigger with when distance onstart delay do prio import is minimum maximum confirm on_error_proceed
+syn match krlStatement /\v\c%(<wait\s+)@7<=<sec>/
+syn match krlStatement /\v\c%(<when\s+)@7<=<path>/
+highlight default link krlStatement Statement
+" Conditional
+syn keyword krlConditional if then else endif switch case default endswitch skip endskip
+highlight default link krlConditional Conditional
+" Repeat
+syn keyword krlRepeat for to step endfor while endwhile repeat until loop endloop exit
+highlight default link krlRepeat Repeat
+" Label
+syn keyword krlLabel goto
+syn match krlLabel /^\s*\w\+:\ze\s*\%(;.*\)\?$/
+highlight default link krlLabel Label
+" Keyword
+syn keyword krlKeyword anin anout digin
+highlight default link krlKeyword Keyword
+" Exception
+syn keyword krlException return resume halt
+highlight default link krlException Exception
+" }}} Statements, keywords et al
+
+" special keywords for movement commands {{{
+syn keyword krlMovement PTP PTP_REL LIN LIN_REL CIRC CIRC_REL SPL SPL_REL SPTP SPTP_REL SLIN SLIN_REL SCIRC SCIRC_REL
+syn keyword krlMovement ASYPTP ASYCONT ASYSTOP ASYCANCEL MOVE_EMI
+syn match krlMovement /\v\c^\s*<BRAKE(\s+F)?>/
+if g:krlGroupName
+ highlight default link krlMovement Movement
+else
+ highlight default link krlMovement Special
+endif
+" movement modifiers
+syn match krlMoveBlockInst /\c\v^\s*TIME_BLOCK\s+(START|PART|END)/
+syn match krlMoveBlockInst /\c\v^\s*CONST_VEL\s+(START|END)/
+syn keyword krlMoveBlockInst ptp_spline spline endspline
+highlight default link krlMoveBlockInst Statement
+syn keyword krlMoveMod ca c_ptp c_dis c_vel c_ori c_spl
+if g:krlGroupName
+ highlight default link krlMoveMod Movement
+else
+ highlight default link krlMoveMod Special
+endif
+" }}} special keywords for movement commands
+
+" Structure value {{{
+" avoid coloring structure component names
+syn match krlNames /\.[a-zA-Z_][.a-zA-Z0-9_$]*/
+syn match krlNames contained /[a-zA-Z_][.a-zA-Z0-9_$]*/
+" highlight default link krlNames None
+" Structure value
+syn region krlStructVal start=/{/ end=/}/ oneline containedin=krlStructVal contains=krlNames
+highlight default link krlStructVal Delimiter
+" }}} Structure value
+
+" BuildInFunction {{{
+syn keyword krlBuildInFunction contained Pulse
+syn keyword krlBuildInFunction contained m_comment
+syn keyword krlBuildInFunction contained is_key_pressed
+syn keyword krlBuildInFunction contained set_opt_filter
+syn keyword krlBuildInFunction contained timer_limit
+syn keyword krlBuildInFunction contained tool_adj
+syn keyword krlBuildInFunction contained FRand
+syn keyword krlBuildInFunction contained ExecFunc eb_test EB EK EO LK mbx_rec
+" safe robot
+syn keyword krlbuildinfunction contained get_AxesMask get_BrakeTest_Time
+" math
+syn keyword krlBuildInFunction contained Abs Sin Cos Acos Tan Atan Atan2 Sqrt
+syn keyword krlBuildInFunction contained Forward Inverse inv_pos
+" cFoo sFoo
+syn keyword krlBuildInFunction contained cClose cOpen cRead cWrite sRead sWrite
+" string
+syn keyword krlBuildInFunction contained StrToBool StrToInt StrToReal StrToString StrToFrame StrToPos StrToE3Pos StrToE6Pos StrToAxis StrToE3Axis StrToE6Axis
+syn keyword krlBuildInFunction contained StrAdd StrClear StrCopy StrComp StrFind StrLen StrDeclLen StrToBool StrToInt StrToReal StrToString
+" diag
+syn keyword krlBuildInFunction contained diag_start diag_stop get_DiagState
+" rdc mam pid
+syn keyword krlBuildInFunction contained CheckPidOnRdc check_mam_on_rdc get_rdc_fs_state
+syn keyword krlBuildInFunction contained set_mam_on_hd copy_mam_hd_to_rdc copy_mam_rdc_to_hd
+syn keyword krlBuildInFunction contained PidToHd PidToRdc
+syn keyword krlBuildInFunction contained cal_to_rdc rdc_file_to_hd
+syn keyword krlBuildInFunction contained delete_pid_on_rdc delete_rdc_content
+syn keyword krlBuildInFunction contained create_rdc_archive restore_rdc_archive
+" ioctl
+syn keyword krlBuildInFunction contained IOCtl cIOCtl
+syn keyword krlBuildInFunction contained WSpaceGive WSpaceTake
+" sync
+syn keyword krlBuildInFunction contained Sync SyncCmd CancelProgSync
+" remote
+syn keyword krlBuildInFunction contained RemoteCmd RemoteRead
+" msg/dlg
+syn keyword krlBuildInFunction contained IsMessageSet clear_KrlMsg get_MsgBuffer exists_KrlDlg exists_KrlMsg set_KrlDlg set_KrlDlgAnswer set_KrlMsg
+" robvers
+syn keyword krlBuildInFunction contained maximize_UsedxRobvers set_UsedxRobvers
+" md_foo
+syn keyword krlBuildInFunction contained md_Cmd md_GetState md_SetState md_Asgn
+" emi
+syn keyword krlBuildInFunction contained emi_ActPos emi_EndPos emi_StartPos emi_RecState emi_RecName
+" var
+syn keyword krlBuildInFunction contained cast_from cast_to
+syn keyword krlBuildInFunction contained GetVarsize GetCycDef get_sig_inf get_decl_place VarType VarState
+" sys
+syn keyword krlBuildInFunction contained GetSysState get_system_data set_system_data set_system_data_delayed
+" err
+syn keyword krlBuildInFunction contained err_clear err_raise
+" motion
+syn keyword krlBuildInFunction contained delete_backward_buffer rob_stop rob_stop_release set_brake_delay suppress_repositioning VectorMoveOn VectorMoveOff
+" torque
+syn keyword krlBuildInFunction contained set_torque_limits reset_torque_limits
+" krc1
+syn keyword krlBuildInFunction contained cLcopy cCurpos cNew cClear cRelease cKey
+if g:krlGroupName
+ highlight default link krlBuildInFunction BuildInFunction
+else
+ highlight default link krlBuildInFunction Function
+endif
+" }}} BuildInFunction
+
+" Function {{{
+syn match krlFunction /[a-zA-Z_]\w* *(/me=e-1 contains=krlBuildInFunction
+highlight default link krlFunction Function
+" }}} Function
+
+" Error {{{
+if get(g:, 'krlShowError', 1)
+ " some more or less common typos
+ "
+ " vars or funcs >24 chars are not possible in krl. a234567890123456789012345
+ syn match krlError0 /\w\{25,}/ containedin=krlFunction,krlNames,krlLabel,krlAnyType,krlEnumVal,krlSysvars
+ "
+ " should be interrupt (on|off) \w+
+ syn match krlError1 /\vinterrupt[ \t(]+[_$a-zA-Z0-9]+[_$a-zA-Z0-9.\[\]()+\-*/]*[ \t)]+o%(n|ff)>/
+ "
+ " for bla==5 to 7...
+ " ||
+ syn match krlError3 /\v%(^\s*for%(\(|\s)+[_$a-zA-Z]+[_$a-zA-Z0-9.\[\]()+\-*/ ]*\s*)@<=[:=]\=/
+ "
+ " TODO optimize performance
+ " wait for a=b
+ " |
+ syn match krlError4 /\v%(^\s*%(return|wait\s+for|if|while|until|%(global\s+)?interrupt\s+decl)>[^;]+[^;<>=])@<=\=[^=]/
+ "
+ " wait for a><b
+ " ||
+ syn match krlError5 /\v%(^\s*%(return|wait\s+for|if|while|until|%(global\s+)?interrupt\s+decl)>[^;]+)@<=\>\s*\</
+ "
+ " if (a==5) (b==6) ...
+ " |||
+ syn match krlError6 /\v%(^\s*%(return|wait\s+for|if|while|until|%(global\s+)?interrupt\s+decl)>[^;]+[^;])@<=\)\s*\(/
+ "
+ " TODO optimize performance
+ " a == b + 1
+ " a := b + 1
+ " ||
+ syn match krlError7 /\v%(^\s*%(return|wait\s+for|if|while|until|%(global\s+)?interrupt\s+decl)>[^;]+[^;])@1<!%(^\s*[_$a-zA-Z]+[_$a-zA-Z0-9.\[\],+\-*/]*\s*)@<=[:=]\=/
+ syn match krlError7 /\v\c%(^\s*%(decl\s+)%(global\s+)?%(const\s+)?\w+\s+\w+\s*)@<=[:=]\=/
+ syn match krlError7 /\v\c%(^\s*%(decl\s+)?%(global\s+)?%(const\s+)?%(bool\s+|int\s+|real\s+|char\s+)\w+\s*)@<=[:=]\=/
+ "
+ " this one is tricky. Make sure this does not match trigger instructions; OK, next try, now search for false positives
+ " TODO optimize performance
+ " a = b and c or (int1=int2)
+ " |
+ syn match krlError8 /\v(^\s*[_$a-zA-Z]+[_$a-zA-Z0-9.\[\]()+\-*/]*\s*\=[^;]*[^;<>=])@<=\=\ze[^=]/
+ "
+ " <(distance|delay|prio)> :=
+ " <(distance|delay|prio)> ==
+ " ||
+ syn match krlError9 /\v(^[^;]*<(distance|delay|prio|minimum|maximum)\s*)@<=[:=]\=/
+ "
+ " 'for', 'while' or 'repeat' followed by 'do'
+ syn match krlError10 /\c\v^\s*(until|while|for)>[^;]*<do>/
+ "
+ highlight default link krlError0 Error
+ highlight default link krlError1 Error
+ highlight default link krlError2 Error
+ highlight default link krlError3 Error
+ highlight default link krlError4 Error
+ highlight default link krlError5 Error
+ highlight default link krlError6 Error
+ highlight default link krlError7 Error
+ highlight default link krlError8 Error
+ highlight default link krlError9 Error
+ highlight default link krlError10 Error
+endif
+" }}} Error
+
+" Finish {{{
+let &cpo = s:keepcpo
+unlet s:keepcpo
+
+let b:current_syntax = "krl"
+" }}} Finish
+
+" vim:sw=2 sts=2 et fdm=marker
diff --git a/runtime/syntax/openscad.vim b/runtime/syntax/openscad.vim
new file mode 100644
index 0000000000..1e20c743c4
--- /dev/null
+++ b/runtime/syntax/openscad.vim
@@ -0,0 +1,129 @@
+" Vim syntax file
+" Language: OpenSCAD
+" Maintainer: Niklas Adam <adam@oddodd.org>
+" Last change: 2022-04-15
+"
+"
+" From salkin-mada/openscad.nvim
+" Building on the work of Sirtaj Singh Kang and others for vim-openscad
+"
+
+" quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+syntax case ignore
+
+setlocal iskeyword=a-z,A-Z,48-57,_
+
+syn match openscadAoperator "{"
+syn match openscadAoperator "}"
+syn match openscadLi "\["
+syn match openscadLi "\]"
+syn match openscadPar "("
+syn match openscadPar ")"
+
+syn match openscadSpecialVariable "\$[a-zA-Z_]\+\>" display
+syn match openscadModifier "^\s*[\*\!\#\%]" display
+
+syn match openscadBinaryoperator "+"
+syn match openscadBinaryoperator "-"
+syn match openscadBinaryoperator "*"
+syn match openscadBinaryoperator "/"
+syn match openscadBinaryoperator "%"
+syn match openscadBinaryoperator "\*\*"
+syn match openscadBinaryoperator "<"
+syn match openscadBinaryoperator "<="
+syn match openscadBinaryoperator ">"
+syn match openscadBinaryoperator ">="
+syn match openscadBinaryoperator "="
+syn match openscadBinaryoperator "=="
+syn match openscadBinaryoperator "==="
+syn match openscadBinaryoperator "!="
+syn match openscadBinaryoperator "!=="
+syn match openscadBinaryoperator "&"
+syn match openscadBinaryoperator "|"
+syn match openscadBinaryoperator "<!"
+syn match openscadBinaryoperator "?"
+syn match openscadBinaryoperator "??"
+syn match openscadBinaryoperator "!?"
+syn match openscadBinaryoperator "!"
+syn match openscadBinaryoperator "#"
+syn match openscadBinaryoperator "_"
+syn match openscadBinaryoperator "\.\."
+syn match openscadBinaryoperator "\.\.\."
+syn match openscadBinaryoperator "`"
+syn match openscadBinaryoperator ":"
+
+syn keyword openscadFunctionDef function nextgroup=openscadFunction skipwhite skipempty
+syn match openscadFunction /\<\h\w*\>/ contained display
+
+syn keyword openscadModuleDef module nextgroup=openscadModule skipwhite skipempty
+syn match openscadModule /\<\h\w*\>/ contained display
+
+syn keyword openscadStatement echo assign let assert
+syn keyword openscadConditional if else
+syn keyword openscadRepeat for intersection_for
+syn keyword openscadInclude include use
+syn keyword openscadCsgKeyword union difference intersection render intersection_for
+syn keyword openscadTransform scale rotate translate resize mirror multmatrix color minkowski hull projection linear_extrude rotate_extrude offset
+syn keyword openscadPrimitiveSolid cube sphere cylinder polyhedron surface
+syn keyword openscadPrimitive2D square circle polygon import_dxf text
+syn keyword openscadPrimitiveImport import child children
+
+syn match openscadNumbers "\<\d\|\.\d" contains=openscadNumber display transparent
+syn match openscadNumber "\d\+" display contained
+syn match openscadNumber "\.\d\+" display contained
+
+syn region openscadString start=/"/ skip=/\\"/ end=/"/
+
+syn keyword openscadBoolean true false
+
+syn keyword openscadCommentTodo TODO FIXME XXX NOTE contained display
+syn match openscadInlineComment ://.*$: contains=openscadCommentTodo
+syn region openscadBlockComment start=:/\*: end=:\*/: fold contains=openscadCommentTodo
+
+syn region openscadBlock start="{" end="}" transparent fold
+syn region openscadVector start="\[" end="\]" transparent fold
+
+syn keyword openscadBuiltin abs acos asin atan atan2 ceil cos exp floor ln log
+syn keyword openscadBuiltin lookup max min pow rands round sign sin sqrt tan
+syn keyword openscadBuiltin str len search version version_num concat chr ord cross norm
+syn keyword openscadBuiltin parent_module
+syn keyword openscadBuiltin dxf_cross dxf_dim
+syn keyword openscadBuiltinSpecial PI undef
+
+"""""""""""""""""""""""""""""""""""""""""
+" linkage
+"""""""""""""""""""""""""""""""""""""""""
+hi def link openscadFunctionDef Structure
+hi def link openscadAoperator Function
+hi def link openscadLi Function
+" hi def link openscadPar Structure
+hi def link openscadBuiltinSpecial Special
+hi def link openscadBinaryoperator Special
+hi def link openscadFunction Function
+hi def link openscadModuleDef Structure
+hi def link openscadModule Function
+hi def link openscadBlockComment Comment
+hi def link openscadBoolean Boolean
+hi def link openscadBuiltin Function
+hi def link openscadConditional Conditional
+hi def link openscadCsgKeyword Structure
+hi def link openscadInclude Include
+hi def link openscadInlineComment Comment
+hi def link openscadModifier Special
+hi def link openscadStatement Statement
+hi def link openscadNumbers Number
+hi def link openscadNumber Number
+hi def link openscadPrimitiveSolid Keyword
+hi def link openscadPrimitive2D Keyword
+hi def link openscadPrimitiveImport Keyword
+hi def link openscadRepeat Repeat
+hi def link openscadSpecialVariable Special
+hi def link openscadString String
+hi def link openscadTransform Statement
+hi def link openscadCommentTodo Todo
+
+let b:current_syntax = 'openscad'
diff --git a/runtime/syntax/synload.vim b/runtime/syntax/synload.vim
index bfcd3b06da..b88cd95103 100644
--- a/runtime/syntax/synload.vim
+++ b/runtime/syntax/synload.vim
@@ -1,6 +1,6 @@
" Vim syntax support file
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2020 Apr 13
+" Last Change: 2022 Apr 12
" This file sets up for syntax highlighting.
" It is loaded from "syntax.vim" and "manual.vim".
diff --git a/runtime/syntax/syntax.vim b/runtime/syntax/syntax.vim
index f274d93f4f..ac7dc314b9 100644
--- a/runtime/syntax/syntax.vim
+++ b/runtime/syntax/syntax.vim
@@ -1,6 +1,6 @@
" Vim syntax support file
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2001 Sep 04
+" Last Change: 2022 Apr 12
" This file is used for ":syntax on".
" It installs the autocommands and starts highlighting for all buffers.
diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh
index 195a76763f..a931231fbd 100755
--- a/scripts/pvscheck.sh
+++ b/scripts/pvscheck.sh
@@ -380,7 +380,7 @@ run_analysis() {(
--sourcetree-root . || true
rm -rf PVS-studio.{xml,err,tsk,html.d}
- local plog_args="PVS-studio.log --srcRoot . --excludedCodes V011,V1042,V1051,V1074"
+ local plog_args="PVS-studio.log --srcRoot . --excludedCodes V011,V1042,V1051,V1074,V002"
plog-converter $plog_args --renderTypes xml --output PVS-studio.xml
plog-converter $plog_args --renderTypes errorfile --output PVS-studio.err
plog-converter $plog_args --renderTypes tasklist --output PVS-studio.tsk
diff --git a/src/Doxyfile b/src/Doxyfile
index 461fafe99d..e085e4e198 100644
--- a/src/Doxyfile
+++ b/src/Doxyfile
@@ -1,112 +1,137 @@
-# Doxyfile 1.8.4
+# Doxyfile 1.9.0
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
-# All text after a double hash (##) is considered a comment and is placed
-# in front of the TAG it is preceding .
-# All text after a hash (#) is considered a comment and will be ignored.
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ").
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
+# This tag specifies the encoding used for all characters in the configuration
+# file that follow. The default is UTF-8 which is also the encoding used for all
# text before the first occurrence of this tag. Doxygen uses libiconv (or the
# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
+# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
+# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
-# The PROJECT_NAME tag is a single word (or sequence of words) that should
-# identify the project. Note that if you do not use Doxywizard you need
-# to put quotes around the project name if it contains spaces.
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
-PROJECT_NAME = "Neovim"
+PROJECT_NAME = Neovim
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
PROJECT_NUMBER =
# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer
-# a quick idea about the purpose of the project. Keep the description short.
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF =
-# With the PROJECT_LOGO tag one can specify a logo or icon that is
-# included in the documentation. The maximum height of the logo should not
-# exceed 55 pixels and the maximum width should not exceed 200 pixels.
-# Doxygen will copy the logo to the output directory.
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
PROJECT_LOGO = contrib/doxygen/logo-devdoc.png
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
OUTPUT_DIRECTORY = build/doxygen
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
CREATE_SUBDIRS = NO
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian,
-# Persian, Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic,
-# Slovak, Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
OUTPUT_LANGUAGE = English
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
+# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all generated output in the proper direction.
+# Possible values are: None, LTR, RTL and Context.
+# The default value is: None.
+
+OUTPUT_TEXT_DIRECTION = None
+
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
BRIEF_MEMBER_DESC = YES
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
+# The default value is: YES.
REPEAT_BRIEF = YES
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
ABBREVIATE_BRIEF =
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
+# doxygen will generate a detailed section even if there is only a brief
# description.
+# The default value is: NO.
ALWAYS_DETAILED_SEC = NO
@@ -114,575 +139,764 @@ ALWAYS_DETAILED_SEC = NO
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
+# The default value is: NO.
INLINE_INHERITED_MEMB = NO
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
FULL_PATH_NAMES = YES
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip. Note that you specify absolute paths here, but also
-# relative paths, which will be relative from the directory where doxygen is
-# started.
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH =
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
STRIP_FROM_INC_PATH =
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful if your file system
-# doesn't support long names like on DOS, Mac, or CD-ROM.
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
SHORT_NAMES = NO
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
JAVADOC_AUTOBRIEF = NO
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
+# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
+# such as
+# /***************
+# as being the beginning of a Javadoc-style comment "banner". If set to NO, the
+# Javadoc-style will behave just like regular comments and it will not be
+# interpreted by doxygen.
+# The default value is: NO.
+
+JAVADOC_BANNER = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
QT_AUTOBRIEF = NO
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
MULTILINE_CPP_IS_BRIEF = NO
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
+# By default Python docstrings are displayed as preformatted text and doxygen's
+# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the
+# doxygen's special commands can be used and the contents of the docstring
+# documentation blocks is shown as doxygen documentation.
+# The default value is: YES.
+
+PYTHON_DOCSTRING = YES
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
INHERIT_DOCS = YES
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
SEPARATE_MEMBER_PAGES = NO
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
TAB_SIZE = 4
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines (in the resulting output). You can put ^^ in the value part of an
+# alias to insert a newline as if a physical newline was in the original file.
+# When you need a literal { or } or , in the value part of an alias you have to
+# escape them by means of a backslash (\), this can lead to conflicts with the
+# commands \{ and \} for these it is advised to use the version @{ and @} or use
+# a double escape (\\{ and \\})
ALIASES =
-# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding
-# "class=itcl::class" will allow you to use the command class in the
-# itcl::class meaning.
-
-TCL_SUBST =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = YES
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
OPTIMIZE_OUTPUT_VHDL = NO
+# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
+# sources only. Doxygen will then generate output that is more tailored for that
+# language. For instance, namespaces will be presented as modules, types will be
+# separated into more groups, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_SLICE = NO
+
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension,
-# and language is one of the parsers supported by doxygen: IDL, Java,
-# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C,
-# C++. For instance to make doxygen treat .inc files as Fortran files (default
-# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note
-# that for custom extensions you also need to set FILE_PATTERNS otherwise the
-# files are not read by doxygen.
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
+# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL,
+# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
+# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
+# tries to guess whether the code is fixed or free formatted code, this is the
+# default for Fortran type files). For instance to make doxygen treat .inc files
+# as Fortran files (default is PHP), and .f files as C (default is Fortran),
+# use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen. When specifying no_extension you should add
+# * to the FILE_PATTERNS.
+#
+# Note see also the list of default file extension mappings.
EXTENSION_MAPPING = lua=C
-# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
-# comments according to the Markdown format, which allows for more readable
-# documentation. See http://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you
-# can mix doxygen, HTML, and XML commands with Markdown formatting.
-# Disable only in case of backward compatibilities issues.
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See https://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
MARKDOWN_SUPPORT = YES
+# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
+# to that level are automatically included in the table of contents, even if
+# they do not have an id attribute.
+# Note: This feature currently applies only to Markdown headings.
+# Minimum value: 0, maximum value: 99, default value: 5.
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
+
+TOC_INCLUDE_HEADINGS = 5
+
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
-# be prevented in individual cases by by putting a % sign in front of the word
-# or globally by setting AUTOLINK_SUPPORT to NO.
+# be prevented in individual cases by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
AUTOLINK_SUPPORT = YES
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also makes the inheritance and collaboration
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
BUILTIN_STL_SUPPORT = NO
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
+# The default value is: NO.
CPP_CLI_SUPPORT = NO
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
SIP_SUPPORT = NO
# For Microsoft's IDL there are propget and propput attributes to indicate
-# getter and setter methods for a property. Setting this option to YES (the
-# default) will make doxygen replace the get and set methods by a property in
-# the documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
IDL_PROPERTY_SUPPORT = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
+# tag is set to YES then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
+# The default value is: NO.
DISTRIBUTE_GROUP_DOC = NO
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
+# If one adds a struct or class to a group and this option is enabled, then also
+# any nested class or struct is added to the same group. By default this option
+# is disabled and one has to add nested compounds explicitly via \ingroup.
+# The default value is: NO.
+
+GROUP_NESTED_COMPOUNDS = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
SUBGROUPING = YES
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
-# unions are shown inside the group in which they are included (e.g. using
-# @ingroup) instead of on a separate page (for HTML and Man pages) or
-# section (for LaTeX and RTF).
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
INLINE_GROUPED_CLASSES = NO
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
-# unions with only public data fields or simple typedef fields will be shown
-# inline in the documentation of the scope in which they are defined (i.e. file,
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
# namespace, or group documentation), provided this scope is documented. If set
-# to NO (the default), structs, classes, and unions are shown on a separate
-# page (for HTML and Man pages) or section (for LaTeX and RTF).
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
INLINE_SIMPLE_STRUCTS = NO
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
TYPEDEF_HIDES_STRUCT = NO
# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
-# cache is used to resolve symbols given their name and scope. Since this can
-# be an expensive process and often the same symbol appear multiple times in
-# the code, doxygen keeps a cache of pre-resolved symbols. If the cache is too
-# small doxygen will become slower. If the cache is too large, memory is wasted.
-# The cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid
-# range is 0..9, the default is 0, corresponding to a cache size of 2^16 = 65536
-# symbols.
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
LOOKUP_CACHE_SIZE = 0
+# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use
+# during processing. When set to 0 doxygen will based this on the number of
+# cores available in the system. You can set it explicitly to a value larger
+# than 0 to get more control over the balance between CPU load and processing
+# speed. At this moment only the input processing can be done using multiple
+# threads. Since this is still an experimental feature the default is set to 1,
+# which efficively disables parallel processing. Please report any issues you
+# encounter. Generating dot graphs in parallel is controlled by the
+# DOT_NUM_THREADS setting.
+# Minimum value: 0, maximum value: 32, default value: 1.
+
+NUM_PROC_THREADS = 1
+
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
EXTRACT_ALL = YES
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
EXTRACT_PRIVATE = NO
-# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
+# methods of a class will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIV_VIRTUAL = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
# scope will be included in the documentation.
+# The default value is: NO.
EXTRACT_PACKAGE = NO
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
EXTRACT_STATIC = NO
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
EXTRACT_LOCAL_CLASSES = YES
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespaces are hidden.
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
EXTRACT_ANON_NSPACES = NO
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
+# If this flag is set to YES, the name of an unnamed parameter in a declaration
+# will be determined by the corresponding definition. By default unnamed
+# parameters remain unnamed in the output.
+# The default value is: YES.
+
+RESOLVE_UNNAMED_PARAMS = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
HIDE_UNDOC_MEMBERS = NO
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# declarations. If set to NO, these declarations will be included in the
# documentation.
+# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = NO
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
HIDE_IN_BODY_DOCS = NO
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
INTERNAL_DOCS = NO
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
+# With the correct setting of option CASE_SENSE_NAMES doxygen will better be
+# able to match the capabilities of the underlying filesystem. In case the
+# filesystem is case sensitive (i.e. it supports files in the same directory
+# whose names only differ in casing), the option must be set to YES to properly
+# deal with such files in case they appear in the input. For filesystems that
+# are not case sensitive the option should be be set to NO to properly deal with
+# output files written for symbols that only differ in casing, such as for two
+# classes, one named CLASS and the other named Class, and to also support
+# references to files without having to specify the exact matching casing. On
+# Windows (including Cygwin) and MacOS, users should typically set this option
+# to NO, whereas on Linux or other Unix flavors it should typically be set to
+# YES.
+# The default value is: system dependent.
CASE_SENSE_NAMES = YES
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
HIDE_SCOPE_NAMES = NO
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+HIDE_COMPOUND_REFERENCE= NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
SHOW_INCLUDE_FILES = YES
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
-# will list include files with double quotes in the documentation
-# rather than with sharp brackets.
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
FORCE_LOCAL_INCLUDES = NO
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
INLINE_INFO = YES
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
SORT_MEMBER_DOCS = YES
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
SORT_BRIEF_DOCS = NO
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
-# will sort the (brief and detailed) documentation of class members so that
-# constructors and destructors are listed first. If set to NO (the default)
-# the constructors will appear in the respective orders defined by
-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
-# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
SORT_MEMBERS_CTORS_1ST = NO
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
SORT_GROUP_NAMES = NO
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
SORT_BY_SCOPE_NAME = NO
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
-# do proper type resolution of all parameters of a function it will reject a
-# match between the prototype and the implementation of a member function even
-# if there is only one candidate or it is obvious which candidate to choose
-# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
-# will still accept a match between prototype and implementation in such cases.
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
STRICT_PROTO_MATCHING = NO
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
GENERATE_TODOLIST = YES
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
GENERATE_TESTLIST = YES
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
GENERATE_BUGLIST = YES
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
GENERATE_DEPRECATEDLIST= YES
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if section-label ... \endif
-# and \cond section-label ... \endcond blocks.
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
ENABLED_SECTIONS =
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or macro consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and macros in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
MAX_INITIALIZER_LINES = 30
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES, the
# list will mention the files that were used to generate the documentation.
+# The default value is: YES.
SHOW_USED_FILES = YES
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
SHOW_FILES = YES
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
SHOW_NAMESPACES = YES
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. To create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option.
-# You can optionally specify a file name after the option, if omitted
-# DoxygenLayout.xml will be used as the name of the layout file.
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
LAYOUT_FILE =
-# The CITE_BIB_FILES tag can be used to specify one or more bib files
-# containing the references data. This must be a list of .bib files. The
-# .bib extension is automatically appended if omitted. Using this command
-# requires the bibtex tool to be installed. See also
-# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
-# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
-# feature you need bibtex and perl available in the search path. Do not use
-# file names with spaces, bibtex cannot handle them.
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
CITE_BIB_FILES =
#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
+# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
WARNINGS = YES
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
WARN_IF_DOC_ERROR = YES
-# The WARN_NO_PARAMDOC option can be enabled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO, doxygen will only warn about wrong or incomplete
+# parameter documentation, but not about the absence of documentation. If
+# EXTRACT_ALL is set to YES then this flag will automatically be disabled.
+# The default value is: NO.
WARN_NO_PARAMDOC = NO
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
+# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
+# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS
+# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but
+# at the end of the doxygen process doxygen will return with a non-zero status.
+# Possible values are: NO, YES and FAIL_ON_WARNINGS.
+# The default value is: NO.
+
+WARN_AS_ERROR = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
WARN_LOGFILE =
#---------------------------------------------------------------------------
-# configuration options related to the input files
+# Configuration options related to the input files
#---------------------------------------------------------------------------
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
+# Note: If this tag is empty the current directory is searched.
INPUT = src/
# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see:
+# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
+# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
-# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
-# *.f90 *.f *.for *.vhd *.vhdl
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# read by doxygen.
+#
+# Note the list of default checked file patterns might differ from the list of
+# default file extension mappings.
+#
+# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
+# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
+# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
+# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment),
+# *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, *.vhdl,
+# *.ucf, *.qsf and *.ice.
-FILE_PATTERNS = *.h *.c *.lua
+FILE_PATTERNS = *.h \
+ *.c \
+ *.lua
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
# Note that relative paths are relative to the directory from which doxygen is
# run.
@@ -691,14 +905,16 @@ EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
+# The default value is: NO.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS =
@@ -707,215 +923,275 @@ EXCLUDE_PATTERNS =
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS =
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
EXAMPLE_RECURSIVE = NO
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be ignored.
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
# Note that the filter must not add or remove lines; it is applied before the
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty or if
-# non of the patterns match the file name, INPUT_FILTER is applied.
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
FILTER_PATTERNS = *.lua=scripts/lua2dox_filter
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# INPUT_FILTER) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
FILTER_SOURCE_FILES = NO
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
-# and it is also possible to disable source filtering for a specific pattern
-# using *.ext= (so without naming a filter). This option only has effect when
-# FILTER_SOURCE_FILES is enabled.
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
FILTER_SOURCE_PATTERNS =
-# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
# is part of the input, its contents will be placed on the main page
# (index.html). This can be useful if you have a project on for instance GitHub
-# and want reuse the introduction page also for the doxygen output.
+# and want to reuse the introduction page also for the doxygen output.
USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
-# configuration options related to source browsing
+# Configuration options related to source browsing
#---------------------------------------------------------------------------
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
SOURCE_BROWSER = NO
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
INLINE_SOURCES = NO
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C, C++ and Fortran comments will always remain visible.
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
STRIP_CODE_COMMENTS = YES
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# entity all documented functions referencing it will be listed.
+# The default value is: NO.
REFERENCED_BY_RELATION = NO
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
REFERENCES_RELATION = NO
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
REFERENCES_LINK_SOURCE = YES
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see https://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
USE_HTAGS = NO
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
+# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
ALPHABETICAL_INDEX = YES
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
-# configuration options related to the HTML output
+# Configuration options related to the HTML output
#---------------------------------------------------------------------------
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# The default value is: YES.
GENERATE_HTML = YES
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_OUTPUT = html
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FILE_EXTENSION = .html
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header. Note that when using a custom header you are responsible
-# for the proper inclusion of any scripts and style sheets that doxygen
-# needs, which is dependent on the configuration options used.
-# It is advised to generate a default header using "doxygen -w html
-# header.html footer.html stylesheet.css YourConfigFile" and then modify
-# that header. Note that the header is subject to change so you typically
-# have to redo this when upgrading to a newer version of doxygen or when
-# changing the value of configuration settings such as GENERATE_TREEVIEW!
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_HEADER = contrib/doxygen/header.html
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FOOTER = contrib/doxygen/footer.html
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If left blank doxygen will
-# generate a default style sheet. Note that it is recommended to use
-# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this
-# tag will in the future become obsolete.
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET = contrib/doxygen/customdoxygen.css
-# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional
-# user-defined cascading style sheet that is included after the standard
-# style sheets created by doxygen. Using this option one can overrule
-# certain style aspects. This is preferred over using HTML_STYLESHEET
-# since it does not replace the standard style sheet and is therefor more
-# robust against future updates. Doxygen will copy the style sheet file to
-# the output directory.
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET = contrib/doxygen/extra.css
@@ -923,632 +1199,911 @@ HTML_EXTRA_STYLESHEET = contrib/doxygen/extra.css
# other source files which should be copied to the HTML output directory. Note
# that these files will be copied to the base HTML output directory. Use the
# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that
-# the files will be copied as-is; there are no commands or markers available.
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_FILES =
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
-# Doxygen will adjust the colors in the style sheet and background images
-# according to this color. Hue is specified as an angle on a colorwheel,
-# see http://en.wikipedia.org/wiki/Hue for more information.
-# For instance the value 0 represents red, 60 is yellow, 120 is green,
-# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
-# The allowed range is 0 to 359.
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the style sheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_HUE = 220
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
-# the colors in the HTML output. For a value of 0 the output will use
-# grayscales only. A value of 255 will produce the most vivid colors.
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_SAT = 100
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
-# the luminance component of the colors in the HTML output. Values below
-# 100 gradually make the output lighter, whereas values above 100 make
-# the output darker. The value divided by 100 is the actual gamma applied,
-# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
-# and 100 does not change the gamma.
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting
-# this to NO can help when comparing the output of multiple runs.
+# page will contain the date and time when the page was generated. Setting this
+# to YES can help to show when doxygen was last run and thus if the
+# documentation is up to date.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = YES
+# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
+# documentation will contain a main index with vertical navigation menus that
+# are dynamically created via JavaScript. If disabled, the navigation index will
+# consists of multiple levels of tabs that are statically embedded in every HTML
+# page. Disable this option to support browsers that do not have JavaScript,
+# like the Qt help browser.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_MENUS = YES
+
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_SECTIONS = NO
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
-# entries shown in the various tree structured indices initially; the user
-# can expand and collapse entries dynamically later on. Doxygen will expand
-# the tree to such a level that at most the specified number of entries are
-# visible (unless a fully collapsed tree already exceeds this amount).
-# So setting the number of entries 1 will produce a full collapsed tree by
-# default. 0 is a special value representing an infinite number of entries
-# and will result in a full expanded tree by default.
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_INDEX_NUM_ENTRIES = 100
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see:
+# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To
+# create a documentation set, doxygen will generate a Makefile in the HTML
+# output directory. Running make will produce the docset in that directory and
+# running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
+# genXcode/_index.html for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_DOCSET = NO
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_FEEDNAME = "Doxygen generated docs"
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_BUNDLE_ID = org.doxygen.Project
-# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely
-# identify the documentation publisher. This should be a reverse domain-name
-# style string, e.g. com.mycompany.MyDocSet.documentation.
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_NAME = Publisher
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see:
+# https://www.microsoft.com/en-us/download/details.aspx?id=21138) on Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_FILE =
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION =
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the main .chm file (NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
BINARY_TOC = NO
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
TOC_EXPAND = NO
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
-# that can be used as input for Qt's qhelpgenerator to generate a
-# Qt Compressed Help (.qch) of the generated HTML documentation.
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_QHP = NO
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE =
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_NAMESPACE = org.doxygen.Project
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER = doc
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
-# add. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
-# Qt Help Project / Custom Filters</a>.
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
-# Qt Help Project / Filter Attributes</a>.
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
+# The QHG_LOCATION tag can be used to specify the location (absolute path
+# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to
+# run qhelpgenerator on the generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION =
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
-# will be generated, which together with the HTML files, form an Eclipse help
-# plugin. To install this plugin and make it available under the help contents
-# menu in Eclipse, the contents of the directory containing the HTML and XML
-# files needs to be copied into the plugins directory of eclipse. The name of
-# the directory within the plugins directory should be the same as
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
-# the help appears.
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_ECLIPSEHELP = NO
-# A unique identifier for the eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have
-# this name.
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
ECLIPSE_DOC_ID = org.doxygen.Project
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
-# at top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it. Since the tabs have the same information as the
-# navigation tree you can set this option to NO if you already set
-# GENERATE_TREEVIEW to YES.
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
DISABLE_INDEX = NO
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to YES, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
-# Windows users are probably better off using the HTML help feature.
-# Since the tree basically has the same information as the tab index you
-# could consider to set DISABLE_INDEX to NO when enabling this option.
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = NO
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
-# (range [0,1..20]) that doxygen will group on one line in the generated HTML
-# documentation. Note that a value of 0 will completely suppress the enum
-# values from appearing in the overview section.
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
ENUM_VALUES_PER_LINE = 4
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
TREEVIEW_WIDTH = 250
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
-# links to external symbols imported via tag files in a separate window.
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
EXT_LINKS_IN_WINDOW = NO
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
+# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg
+# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see
+# https://inkscape.org) to generate formulas as SVG images instead of PNGs for
+# the HTML output. These images will generally look nicer at scaled resolutions.
+# Possible values are: png (the default) and svg (looks nicer but requires the
+# pdf2svg or inkscape tool).
+# The default value is: png.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FORMULA_FORMAT = png
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 10
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are
-# not supported properly for IE 6.0, but are supported on all modern browsers.
-# Note that when changing this option you need to delete any form_*.png files
-# in the HTML output before the changes have effect.
+# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_TRANSPARENT = YES
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
-# (see http://www.mathjax.org) which uses client side Javascript for the
-# rendering instead of using prerendered bitmaps. Use this if you do not
-# have LaTeX installed or if you want to formulas look prettier in the HTML
-# output. When enabled you may also need to install MathJax separately and
-# configure the path to it using the MATHJAX_RELPATH option.
+# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
+# to create new LaTeX commands to be used in formulas as building blocks. See
+# the section "Including formulas" for details.
+
+FORMULA_MACROFILE =
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# https://www.mathjax.org) which uses client side JavaScript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = NO
# When MathJax is enabled you can set the default output format to be used for
-# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and
-# SVG. The default value is HTML-CSS, which is slower, but has the best
-# compatibility.
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_FORMAT = HTML-CSS
-# When MathJax is enabled you need to specify the location relative to the
-# HTML output directory using the MATHJAX_RELPATH option. The destination
-# directory should contain the MathJax.js script. For instance, if the mathjax
-# directory is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to
-# the MathJax Content Delivery Network so you can quickly see the result without
-# installing MathJax.
-# However, it is strongly recommended to install a local
-# copy of MathJax from http://www.mathjax.org before deployment.
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from https://www.mathjax.org before deployment.
+# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2.
+# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
-# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
-# names that should be enabled during MathJax rendering.
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
-# The MATHJAX_CODEFILE tag can be used to specify a file with javascript
-# pieces of code that will be used on startup of the MathJax code.
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see:
+# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_CODEFILE =
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box
-# for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using
-# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
-# (GENERATE_DOCSET) there is already a search function so this one should
-# typically be disabled. For large projects the javascript based search engine
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
SEARCHENGINE = YES
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a web server instead of a web client using Javascript.
-# There are two flavours of web server based search depending on the
-# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
-# searching and an index file used by the script. When EXTERNAL_SEARCH is
-# enabled the indexing and searching needs to be provided by external tools.
-# See the manual for details.
+# implemented using a web server instead of a web client using JavaScript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
SERVER_BASED_SEARCH = NO
-# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
# script for searching. Instead the search results are written to an XML file
# which needs to be processed by an external indexer. Doxygen will invoke an
-# external search engine pointed to by the SEARCHENGINE_URL option to obtain
-# the search results. Doxygen ships with an example indexer (doxyindexer) and
-# search engine (doxysearch.cgi) which are based on the open source search
-# engine library Xapian. See the manual for configuration details.
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see:
+# https://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH = NO
# The SEARCHENGINE_URL should point to a search engine hosted by a web server
-# which will returned the search results when EXTERNAL_SEARCH is enabled.
-# Doxygen ships with an example search engine (doxysearch) which is based on
-# the open source search engine library Xapian. See the manual for configuration
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see:
+# https://xapian.org/). See the section "External Indexing and Searching" for
# details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHENGINE_URL =
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
# search data is written to a file for indexing by an external tool. With the
# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHDATA_FILE = searchdata.xml
-# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH_ID =
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
# projects other than the one defined by this configuration file, but that are
# all added to the same external search index. Each project needs to have a
-# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id
-# of to a relative location where the documentation can be found.
-# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ...
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
+# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# The default value is: YES.
GENERATE_LATEX = YES
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-# Note that when enabling USE_PDFLATEX this option is only used for
-# generating bitmaps for formulas in the HTML output, but not in the
-# Makefile that is written to the output directory.
+# invoked.
+#
+# Note that when not enabling USE_PDFLATEX the default is latex when enabling
+# USE_PDFLATEX the default is pdflatex and when in the later case latex is
+# chosen this is overwritten by pdflatex. For specific output languages the
+# default can have been set differently, this depends on the implementation of
+# the output language.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# Note: This tag is used in the Makefile / make.bat.
+# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file
+# (.tex).
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = makeindex
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
+# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
+# generate index for LaTeX. In case there is no backslash (\) as first character
+# it will be automatically added in the LaTeX code.
+# Note: This tag is used in the generated output file (.tex).
+# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
+# The default value is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_MAKEINDEX_CMD = makeindex
+
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
COMPACT_LATEX = NO
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, letter, legal and
-# executive. If left blank a4 will be used.
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
PAPER_TYPE = a4
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. The package can be specified just
+# by its name or with the correct syntax as to be used with the LaTeX
+# \usepackage command. To get the times font for instance you can specify :
+# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
+# To use the option intlimits with the amsmath package you can specify:
+# EXTRA_PACKAGES=[intlimits]{amsmath}
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
EXTRA_PACKAGES =
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
+# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
+# string, for the replacement values of the other commands the user is referred
+# to HTML_HEADER.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
-# the generated latex document. The footer should contain everything after
-# the last chapter. If it is left blank doxygen will generate a
-# standard footer. Notice: only use this tag if you know what you are doing!
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_FOOTER =
-# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images
-# or other source files which should be copied to the LaTeX output directory.
-# Note that the files will be copied as-is; there are no commands or markers
-# available.
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_STYLESHEET =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EXTRA_FILES =
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
PDF_HYPERLINKS = YES
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
+# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as
+# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX
+# files. Set this option to YES, to get a higher quality PDF documentation.
+#
+# See also section LATEX_CMD_NAME for selecting the engine.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
USE_PDFLATEX = YES
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BATCHMODE = NO
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HIDE_INDICES = NO
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
-# source code with syntax highlighting in the LaTeX output.
-# Note that which sources are shown also depends on other settings
-# such as SOURCE_BROWSER.
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
-# http://en.wikipedia.org/wiki/BibTeX for more info.
+# bibliography, e.g. plainnat, or ieeetr. See
+# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BIB_STYLE = plain
+# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_TIMESTAMP = NO
+
+# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
+# path from which the emoji images will be read. If a relative path is entered,
+# it will be relative to the LATEX_OUTPUT directory. If left blank the
+# LATEX_OUTPUT directory will be used.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EMOJI_DIRECTORY =
+
#---------------------------------------------------------------------------
-# configuration options related to the RTF output
+# Configuration options related to the RTF output
#---------------------------------------------------------------------------
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
GENERATE_RTF = NO
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_OUTPUT = rtf
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
COMPACT_RTF = NO
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_HYPERLINKS = NO
-# Load style sheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# configuration file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_STYLESHEET_FILE =
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's configuration file. A template extensions file can be
+# generated using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
+# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
+# with syntax highlighting in the RTF output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_SOURCE_CODE = NO
+
#---------------------------------------------------------------------------
-# configuration options related to the man page output
+# Configuration options related to the man page output
#---------------------------------------------------------------------------
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
GENERATE_MAN = NO
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_OUTPUT = man
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_EXTENSION = .3
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = NO
#---------------------------------------------------------------------------
-# configuration options related to the XML output
+# Configuration options related to the XML output
#---------------------------------------------------------------------------
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
GENERATE_XML = NO
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
XML_OUTPUT = xml
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
+XML_PROGRAMLISTING = YES
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
+# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
+# namespace members in file scope as well, matching the HTML output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_XML is set to YES.
-XML_PROGRAMLISTING = YES
+XML_NS_MEMB_FILE_SCOPE = NO
#---------------------------------------------------------------------------
-# configuration options related to the DOCBOOK output
+# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
-# If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
# that can be used to generate PDF.
+# The default value is: NO.
GENERATE_DOCBOOK = NO
-# The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put.
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
-# front of it. If left blank docbook will be used as the default path.
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
DOCBOOK_OUTPUT = docbook
+# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
+# program listings (including syntax highlighting and cross-referencing
+# information) to the DOCBOOK output. Note that enabling this will significantly
+# increase the size of the DOCBOOK output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_PROGRAMLISTING = NO
+
#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
+# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures
+# the structure of the code including all documentation. Note that this feature
+# is still experimental and incomplete at the moment.
+# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
+# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
GENERATE_PERLMOD = NO
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_LATEX = NO
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO, the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_PRETTY = YES
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_MAKEVAR_PREFIX =
@@ -1556,335 +2111,456 @@ PERLMOD_MAKEVAR_PREFIX =
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
ENABLE_PREPROCESSING = YES
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = NO
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_ONLY_PREDEF = NO
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# pointed to by INCLUDE_PATH will be searched when a #include is found.
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
INCLUDE_FILE_PATTERNS =
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED =
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition that
-# overrules the definition found in the source code.
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_AS_DEFINED =
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all references to function-like macros
-# that are alone on a line, have an all uppercase name, and do not end with a
-# semicolon, because these will confuse the parser if not removed.
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
-# Configuration::additions related to external references
+# Configuration options related to external references
#---------------------------------------------------------------------------
-# The TAGFILES option can be used to specify one or more tagfiles. For each
-# tag file the location of the external documentation should be added. The
-# format of a tag file without this location is as follows:
-#
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
-#
# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths
-# or URLs. Note that each tag file must have a unique name (where the name does
-# NOT include the path). If a tag file is not located in the directory in which
-# doxygen is run, you must also specify the path to the tagfile here.
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
TAGFILES =
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE =
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
+# The default value is: NO.
ALLEXTERNALS = NO
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
EXTERNAL_GROUPS = YES
-# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed
-# in the related pages index. If set to NO, only the current project's
-# pages will be listed.
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
EXTERNAL_PAGES = YES
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH = /usr/bin/perl
-
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate an inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option also works with HAVE_DOT disabled, but it is recommended to
-# install and use dot, since it yields more powerful graphs.
+# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
CLASS_DIAGRAMS = YES
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
-MSCGEN_PATH =
+DIA_PATH =
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
+# If set to YES the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
HAVE_DOT = NO
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
-# allowed to run in parallel. When set to 0 (the default) doxygen will
-# base this on the number of processors available in the system. You can set it
-# explicitly to a value larger than 0 to get control over the balance
-# between CPU load and processing speed.
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_NUM_THREADS = 0
-# By default doxygen will use the Helvetica font for all dot files that
-# doxygen generates. When you want a differently looking font you can specify
-# the font name using DOT_FONTNAME. You need to make sure dot is able to find
-# the font, which can be done by putting it in a standard location or by setting
-# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
-# directory containing the font.
+# When you want a differently looking font in the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTNAME = Helvetica
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTSIZE = 10
-# By default doxygen will tell dot to use the Helvetica font.
-# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
-# set the path where dot can find it.
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTPATH =
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# CLASS_DIAGRAMS tag to NO.
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
CLASS_GRAPH = YES
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
COLLABORATION_GRAPH = YES
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GROUP_GRAPHS = YES
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = NO
-# If the UML_LOOK tag is enabled, the fields and methods are shown inside
-# the class node. If there are many fields or methods and many nodes the
-# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
-# threshold limits the number of items for each type to make the size more
-# manageable. Set this to 0 for no limit. Note that the threshold may be
-# exceeded by 50% before the limit is enforced.
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag UML_LOOK is set to YES.
UML_LIMIT_NUM_FIELDS = 10
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
+# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and
+# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS
+# tag is set to YES, doxygen will add type and arguments for attributes and
+# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen
+# will not generate fields with class member information in the UML graphs. The
+# class diagrams will look similar to the default class diagrams but using UML
+# notation for the relationships.
+# Possible values are: NO, YES and NONE.
+# The default value is: NO.
+# This tag requires that the tag UML_LOOK is set to YES.
+
+DOT_UML_DETAILS = NO
+
+# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters
+# to display on a single line. If the actual line length exceeds this threshold
+# significantly it will wrapped across multiple lines. Some heuristics are apply
+# to avoid ugly line breaks.
+# Minimum value: 0, maximum value: 1000, default value: 17.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_WRAP_THRESHOLD = 17
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
TEMPLATE_RELATIONS = NO
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDE_GRAPH = YES
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = YES
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command. Disabling a call graph can be
+# accomplished by means of the command \hidecallgraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = NO
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command. Disabling a caller graph can be
+# accomplished by means of the command \hidecallergraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = NO
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will generate a graphical hierarchy of all classes instead of a textual one.
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GRAPHICAL_HIERARCHY = YES
-# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are svg, png, jpg, or gif.
-# If left blank png will be used. If you choose svg you need to set
-# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
-# visible in IE 9+ (other browsers do not have this requirement).
+# generated by dot. For an explanation of the image formats see the section
+# output formats in the documentation of the dot tool (Graphviz (see:
+# http://www.graphviz.org/)).
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,
+# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
+# png:gdiplus:gdiplus.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_IMAGE_FORMAT = png
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
-# Note that this requires a modern browser other than Internet Explorer.
-# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
-# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
-# visible. Older versions of IE do not have SVG support.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
INTERACTIVE_SVG = NO
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
DOTFILE_DIRS =
# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the
-# \mscfile command).
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
MSCFILE_DIRS =
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
+
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
+
+PLANTUML_JAR_PATH =
+
+# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
+# configuration file for plantuml.
+
+PLANTUML_CFG_FILE =
+
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
+
+PLANTUML_INCLUDE_PATH =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_GRAPH_MAX_NODES = 50
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_TRANSPARENT = NO
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = YES
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate
+# files that are used to generate the various graphs.
+#
+# Note: This setting is not only used for dot files but also for msc and
+# plantuml temporary files.
+# The default value is: YES.
DOT_CLEANUP = YES
diff --git a/src/clint.py b/src/clint.py
index 75aaba176d..cb91d9bd68 100755
--- a/src/clint.py
+++ b/src/clint.py
@@ -1,5 +1,4 @@
-#!/usr/bin/env python
-# vim: set fileencoding=utf-8
+#!/usr/bin/env python3
#
# Copyright (c) 2009 Google Inc. All rights reserved.
#
@@ -41,10 +40,6 @@ We do a small hack, which is to ignore //'s with "'s after them on the
same line, but it is far from perfect (in either direction).
"""
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-from __future__ import unicode_literals
import codecs
import copy
@@ -267,7 +262,7 @@ _line_length = 100
# The allowed extensions for file names
# This is set by --extensions flag.
-_valid_extensions = set(['c', 'h'])
+_valid_extensions = {'c', 'h'}
_RE_COMMENTLINE = re.compile(r'^\s*//')
@@ -459,7 +454,7 @@ class _IncludeState(dict): # lgtm [py/missing-equals]
return ''
-class _CppLintState(object):
+class _CppLintState:
"""Maintains module-wide state.."""
@@ -554,7 +549,7 @@ class _CppLintState(object):
fname, lines, category = json.loads(line)
lines = tuple(lines)
self.suppressed_errors[fname][lines].add(category)
- except IOError:
+ except OSError:
pass
def RecordErrorsTo(self, fname):
@@ -620,7 +615,7 @@ def _SetFilters(filters):
_cpplint_state.SetFilters(filters)
-class _FunctionState(object):
+class _FunctionState:
"""Tracks current function name and the number of lines in its body."""
@@ -899,7 +894,7 @@ def CleanseComments(line):
return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line)
-class CleansedLines(object):
+class CleansedLines:
"""Holds 5 copies of all lines with different preprocessing applied to them.
@@ -973,7 +968,7 @@ BRACES = {
}
-CLOSING_BRACES = dict(((v, k) for k, v in BRACES.items()))
+CLOSING_BRACES = {v: k for k, v in BRACES.items()}
def GetExprBracesPosition(clean_lines, linenum, pos):
@@ -1196,9 +1191,9 @@ def CheckForHeaderGuard(filename, lines, error):
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found.
"""
- if filename.endswith('.c.h') or FileInfo(filename).RelativePath() in set((
+ if filename.endswith('.c.h') or FileInfo(filename).RelativePath() in {
'func_attr.h',
- )):
+ }:
return
cppvar = GetHeaderGuardCPPVariable(filename)
@@ -1282,7 +1277,7 @@ def CheckForBadCharacters(filename, lines, error):
error: The function to call with any errors found.
"""
for linenum, line in enumerate(lines):
- if u'\ufffd' in line:
+ if '\ufffd' in line:
error(filename, linenum, 'readability/utf8', 5,
'Line contains invalid UTF-8'
' (or Unicode replacement character).')
@@ -1491,7 +1486,7 @@ _RE_PATTERN_INVALID_INCREMENT = re.compile(
r'^\s*\*\w+(\+\+|--);')
-class _BlockInfo(object):
+class _BlockInfo:
"""Stores information about a generic block of code."""
@@ -1501,7 +1496,7 @@ class _BlockInfo(object):
self.inline_asm = _NO_ASM
-class _PreprocessorInfo(object):
+class _PreprocessorInfo:
"""Stores checkpoints of nesting stacks when #if/#else is seen."""
@@ -1516,7 +1511,7 @@ class _PreprocessorInfo(object):
self.seen_else = False
-class _NestingState(object):
+class _NestingState:
"""Holds states related to parsing braces."""
@@ -2439,7 +2434,7 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
CheckSpacingForFunctionCall(filename, line, linenum, error)
# Check whether everything inside expressions is aligned correctly
- if any((line.find(k) >= 0 for k in BRACES if k != '{')):
+ if any(line.find(k) >= 0 for k in BRACES if k != '{'):
CheckExpressionAlignment(filename, clean_lines, linenum, error)
# Except after an opening paren, or after another opening brace (in case of
@@ -2656,7 +2651,7 @@ def CheckBraces(filename, clean_lines, linenum, error):
clean_lines, linenum, pos)
if endline[endpos:].find('{') == -1:
error(filename, linenum, 'readability/braces', 5,
- '{0} should always use braces'.format(blockstart))
+ '{} should always use braces'.format(blockstart))
# If braces come on one side of an else, they should be on both.
# However, we have to worry about "else if" that spans multiple lines!
@@ -2940,7 +2935,7 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
not Match(r'^\s*//.*http(s?)://\S*$', line) and
not Match(r'^// \$Id:.*#[0-9]+ \$$', line)):
line_width = GetLineWidth(line)
- extended_length = int((_line_length * 1.25))
+ extended_length = int(_line_length * 1.25)
if line_width > extended_length:
error(filename, linenum, 'whitespace/line_length', 4,
'Lines should very rarely be longer than %i characters' %
@@ -3274,7 +3269,7 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension,
if match:
token = match.group(1)
error(filename, linenum, 'readability/bool', 4,
- 'Use %s instead of %s.' % (token.lower(), token))
+ 'Use {} instead of {}.'.format(token.lower(), token))
# Detect MAYBE
match = Search(r'\b(MAYBE)\b', line)
@@ -3451,7 +3446,7 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]):
lines[linenum] = lines[linenum].rstrip('\r')
carriage_return_found = True
- except IOError:
+ except OSError:
sys.stderr.write(
"Skipping input '%s': Can't open for reading\n" % filename)
return
diff --git a/src/nvim/api/autocmd.c b/src/nvim/api/autocmd.c
index a012f3d7fc..45972ec8ea 100644
--- a/src/nvim/api/autocmd.c
+++ b/src/nvim/api/autocmd.c
@@ -346,6 +346,22 @@ cleanup:
/// })
/// </pre>
///
+/// Lua functions receive a table with information about the autocmd event as an argument. To use
+/// a function which itself accepts another (optional) parameter, wrap the function
+/// in a lambda:
+///
+/// <pre>
+/// -- Lua function with an optional parameter.
+/// -- The autocmd callback would pass a table as argument but this
+/// -- function expects number|nil
+/// local myluafun = function(bufnr) bufnr = bufnr or vim.api.nvim_get_current_buf() end
+///
+/// vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
+/// pattern = {"*.c", "*.h"},
+/// callback = function() myluafun() end,
+/// })
+/// </pre>
+///
/// Example using command:
/// <pre>
/// vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index 6d5803a5fe..0c68325f40 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -529,9 +529,9 @@ end:
/// @param channel_id
/// @param buffer Buffer handle, or 0 for current buffer
/// @param start_row First line index
-/// @param start_column First column
+/// @param start_col First column
/// @param end_row Last line index
-/// @param end_column Last column
+/// @param end_col Last column
/// @param replacement Array of lines to use as replacement
/// @param[out] err Error details, if any
void nvim_buf_set_text(uint64_t channel_id, Buffer buffer, Integer start_row, Integer start_col,
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c
index d86aecc318..383c9c16ab 100644
--- a/src/nvim/api/ui.c
+++ b/src/nvim/api/ui.c
@@ -14,6 +14,7 @@
#include "nvim/map.h"
#include "nvim/memory.h"
#include "nvim/msgpack_rpc/channel.h"
+#include "nvim/option.h"
#include "nvim/popupmnu.h"
#include "nvim/screen.h"
#include "nvim/ui.h"
@@ -255,6 +256,33 @@ static void ui_set_option(UI *ui, bool init, String name, Object value, Error *e
return;
}
+ if (strequal(name.data, "term_name")) {
+ if (value.type != kObjectTypeString) {
+ api_set_error(error, kErrorTypeValidation, "term_name must be a String");
+ return;
+ }
+ set_tty_option("term", xstrdup(value.data.string.data));
+ return;
+ }
+
+ if (strequal(name.data, "term_colors")) {
+ if (value.type != kObjectTypeInteger) {
+ api_set_error(error, kErrorTypeValidation, "term_colors must be a Integer");
+ return;
+ }
+ t_colors = (int)value.data.integer;
+ return;
+ }
+
+ if (strequal(name.data, "term_background")) {
+ if (value.type != kObjectTypeString) {
+ api_set_error(error, kErrorTypeValidation, "term_background must be a String");
+ return;
+ }
+ set_tty_background(value.data.string.data);
+ return;
+ }
+
// LEGACY: Deprecated option, use `ext_cmdline` instead.
bool is_popupmenu = strequal(name.data, "popupmenu_external");
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 626f7dc3eb..7a966777af 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -526,8 +526,7 @@ String nvim__get_lib_dir(void)
///
/// @param pat pattern of files to search for
/// @param all whether to return all matches or only the first
-/// @param options
-/// is_lua: only search lua subdirs
+/// @param opts is_lua: only search lua subdirs
/// @return list of absolute paths to the found files
ArrayOf(String) nvim__get_runtime(Array pat, Boolean all, Dict(runtime) *opts, Error *err)
FUNC_API_SINCE(8)
diff --git a/src/nvim/arabic.c b/src/nvim/arabic.c
index 5dcc3d3d0d..db78e0e68f 100644
--- a/src/nvim/arabic.c
+++ b/src/nvim/arabic.c
@@ -974,6 +974,7 @@ int arabic_shape(int c, int *ccp, int *c1p, int prev_c, int prev_c1, int next_c)
/// @param one First character.
/// @param two Character just after "one".
bool arabic_combine(int one, int two)
+ FUNC_ATTR_PURE
{
if (one == a_LAM) {
return arabic_maycombine(two);
@@ -984,6 +985,7 @@ bool arabic_combine(int one, int two)
/// Check whether we are dealing with a character that could be regarded as an
/// Arabic combining character, need to check the character before this.
bool arabic_maycombine(int two)
+ FUNC_ATTR_PURE
{
if (p_arshape && !p_tbidi) {
return two == a_ALEF_MADDA
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c
index 1b146f82c6..173f8e17af 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -379,6 +379,7 @@ static void au_cleanup(void)
// Get the first AutoPat for a particular event.
AutoPat *au_get_autopat_for_event(event_T event)
+ FUNC_ATTR_PURE
{
return first_autopat[(int)event];
}
@@ -1143,6 +1144,7 @@ int autocmd_register(int64_t id, event_T event, char_u *pat, int patlen, int gro
}
size_t aucmd_pattern_length(char_u *pat)
+ FUNC_ATTR_PURE
{
if (*pat == NUL) {
return 0;
@@ -1175,6 +1177,7 @@ size_t aucmd_pattern_length(char_u *pat)
}
char_u *aucmd_next_pattern(char_u *pat, size_t patlen)
+ FUNC_ATTR_PURE
{
pat = pat + patlen;
if (*pat == ',') {
@@ -2383,6 +2386,7 @@ theend:
// Checks if a pattern is buflocal
bool aupat_is_buflocal(char_u *pat, int patlen)
+ FUNC_ATTR_PURE
{
return patlen >= 8
&& STRNCMP(pat, "<buffer", 7) == 0
@@ -2445,7 +2449,7 @@ bool autocmd_delete_id(int64_t id)
// Note that since multiple AutoCmd objects can have the same ID, we need to do a full scan.
FOR_ALL_AUEVENTS(event) {
- FOR_ALL_AUPATS_IN_EVENT(event, ap) {
+ FOR_ALL_AUPATS_IN_EVENT(event, ap) { // -V756
for (AutoCmd *ac = ap->cmds; ac != NULL; ac = ac->next) {
if (ac->id == id) {
aucmd_del(ac);
@@ -2492,6 +2496,7 @@ char *aucmd_exec_default_desc(AucmdExecutable acc)
}
char *aucmd_exec_to_string(AutoCmd *ac, AucmdExecutable acc)
+ FUNC_ATTR_PURE
{
switch (acc.type) {
case CALLABLE_EX:
@@ -2542,6 +2547,7 @@ AucmdExecutable aucmd_exec_copy(AucmdExecutable src)
}
bool aucmd_exec_is_deleted(AucmdExecutable acc)
+ FUNC_ATTR_PURE
{
switch (acc.type) {
case CALLABLE_EX:
@@ -2556,6 +2562,7 @@ bool aucmd_exec_is_deleted(AucmdExecutable acc)
}
bool au_event_is_empty(event_T event)
+ FUNC_ATTR_PURE
{
return first_autopat[event] == NULL;
}
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 4d914acea4..633575bce7 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -357,6 +357,7 @@ void set_bufref(bufref_T *bufref, buf_T *buf)
///
/// @param bufref Buffer reference to check for.
bool bufref_valid(bufref_T *bufref)
+ FUNC_ATTR_PURE
{
return bufref->br_buf_free_count == buf_free_count
? true
@@ -466,6 +467,7 @@ bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last, bool i
// When the buffer is no longer in a window, trigger BufWinLeave
if (buf->b_nwindows == 1) {
buf->b_locked++;
+ buf->b_locked_split++;
if (apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname, false,
buf) && !bufref_valid(&bufref)) {
// Autocommands deleted the buffer.
@@ -473,6 +475,7 @@ bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last, bool i
return false;
}
buf->b_locked--;
+ buf->b_locked_split--;
if (abort_if_last && last_nonfloat(win)) {
// Autocommands made this the only window.
emsg(_(e_auabort));
@@ -483,6 +486,7 @@ bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last, bool i
// BufHidden
if (!unload_buf) {
buf->b_locked++;
+ buf->b_locked_split++;
if (apply_autocmds(EVENT_BUFHIDDEN, buf->b_fname, buf->b_fname, false,
buf) && !bufref_valid(&bufref)) {
// Autocommands deleted the buffer.
@@ -490,6 +494,7 @@ bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last, bool i
return false;
}
buf->b_locked--;
+ buf->b_locked_split--;
if (abort_if_last && last_nonfloat(win)) {
// Autocommands made this the only window.
emsg(_(e_auabort));
@@ -678,6 +683,7 @@ void buf_freeall(buf_T *buf, int flags)
// Make sure the buffer isn't closed by autocommands.
buf->b_locked++;
+ buf->b_locked_split++;
bufref_T bufref;
set_bufref(&bufref, buf);
@@ -703,6 +709,7 @@ void buf_freeall(buf_T *buf, int flags)
return;
}
buf->b_locked--;
+ buf->b_locked_split--;
// If the buffer was in curwin and the window has changed, go back to that
// window, if it still exists. This avoids that ":edit x" triggering a
@@ -1466,8 +1473,8 @@ void set_curbuf(buf_T *buf, int action)
set_bufref(&prevbufref, prevbuf);
set_bufref(&newbufref, buf);
- // Autocommands may delete the current buffer and/or the buffer we want to go
- // to. In those cases don't close the buffer.
+ // Autocommands may delete the current buffer and/or the buffer we want to
+ // go to. In those cases don't close the buffer.
if (!apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, false, curbuf)
|| (bufref_valid(&prevbufref) && bufref_valid(&newbufref)
&& !aborting())) {
@@ -1742,21 +1749,14 @@ buf_T *buflist_new(char_u *ffname_arg, char_u *sfname_arg, linenr_T lnum, int fl
buf = curbuf;
// It's like this buffer is deleted. Watch out for autocommands that
// change curbuf! If that happens, allocate a new buffer anyway.
- if (curbuf->b_p_bl) {
- apply_autocmds(EVENT_BUFDELETE, NULL, NULL, false, curbuf);
- }
- if (buf == curbuf) {
- apply_autocmds(EVENT_BUFWIPEOUT, NULL, NULL, false, curbuf);
+ buf_freeall(buf, BFA_WIPE | BFA_DEL);
+ if (buf != curbuf) { // autocommands deleted the buffer!
+ return NULL;
}
if (aborting()) { // autocmds may abort script processing
xfree(ffname);
return NULL;
}
- if (buf == curbuf) {
- // Make sure 'bufhidden' and 'buftype' are empty
- clear_string_option(&buf->b_p_bh);
- clear_string_option(&buf->b_p_bt);
- }
}
if (buf != curbuf || curbuf == NULL) {
buf = xcalloc(1, sizeof(buf_T));
@@ -1776,14 +1776,6 @@ buf_T *buflist_new(char_u *ffname_arg, char_u *sfname_arg, linenr_T lnum, int fl
buf->b_wininfo = xcalloc(1, sizeof(wininfo_T));
if (buf == curbuf) {
- // free all things allocated for this buffer
- buf_freeall(buf, 0);
- if (buf != curbuf) { // autocommands deleted the buffer!
- return NULL;
- }
- if (aborting()) { // autocmds may abort script processing
- return NULL;
- }
free_buffer_stuff(buf, kBffInitChangedtick); // delete local vars et al.
// Init the options.
@@ -2109,6 +2101,7 @@ buf_T *buflist_findname(char_u *ffname)
///
/// @return buffer or NULL if not found
static buf_T *buflist_findname_file_id(char_u *ffname, FileID *file_id, bool file_id_valid)
+ FUNC_ATTR_PURE
{
// Start at the last buffer, expect to find a match sooner.
FOR_ALL_BUFFERS_BACKWARDS(buf) {
@@ -2540,7 +2533,7 @@ static bool wininfo_other_tab_diff(wininfo_T *wip)
///
/// @return NULL when there isn't any info.
static wininfo_T *find_wininfo(buf_T *buf, bool need_options, bool skip_diff_buffer)
- FUNC_ATTR_NONNULL_ALL
+ FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE
{
wininfo_T *wip;
@@ -2618,6 +2611,7 @@ void get_winopts(buf_T *buf)
///
/// @return a pointer to no_position if no position is found.
pos_T *buflist_findfpos(buf_T *buf)
+ FUNC_ATTR_PURE
{
static pos_T no_position = { 1, 0, 0 };
@@ -2627,6 +2621,7 @@ pos_T *buflist_findfpos(buf_T *buf)
/// Find the lnum for the buffer 'buf' for the current window.
linenr_T buflist_findlnum(buf_T *buf)
+ FUNC_ATTR_PURE
{
return buflist_findfpos(buf)->lnum;
}
@@ -4855,6 +4850,10 @@ void do_arg_all(int count, int forceit, int keep_tabs)
if (keep_tabs) {
new_curwin = wp;
new_curtab = curtab;
+ } else if (wp->w_frame->fr_parent != curwin->w_frame->fr_parent) {
+ emsg(_("E249: window layout changed unexpectedly"));
+ i = count;
+ break;
} else {
win_move_after(wp, curwin);
}
@@ -4933,6 +4932,7 @@ void do_arg_all(int count, int forceit, int keep_tabs)
/// @return true if "buf" is a prompt buffer.
bool bt_prompt(buf_T *buf)
+ FUNC_ATTR_PURE
{
return buf != NULL && buf->b_p_bt[0] == 'p';
}
@@ -5344,6 +5344,7 @@ bool bt_dontwrite_msg(const buf_T *const buf)
/// @return true if the buffer should be hidden, according to 'hidden', ":hide"
/// and 'bufhidden'.
bool buf_hide(const buf_T *const buf)
+ FUNC_ATTR_PURE
{
// 'bufhidden' overrules 'hidden' and ":hide", check it first
switch (buf->b_p_bh[0]) {
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index 298bec808c..a0b63ca605 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -532,6 +532,8 @@ struct file_buffer {
int b_flags; // various BF_ flags
int b_locked; // Buffer is being closed or referenced, don't
// let autocommands wipe it out.
+ int b_locked_split; // Buffer is being closed, don't allow opening
+ // a new window with it.
int b_ro_locked; // Non-zero when the buffer can't be changed.
// Used for FileChangedRO
@@ -1024,6 +1026,7 @@ typedef struct {
colnr_T startcol; // in win_line() points to char where HL starts
colnr_T endcol; // in win_line() points to char where HL ends
bool is_addpos; // position specified directly by matchaddpos()
+ bool has_cursor; // true if the cursor is inside the match, used for CurSearch
proftime_T tm; // for a time limit
} match_T;
diff --git a/src/nvim/buffer_updates.c b/src/nvim/buffer_updates.c
index ee1b7ebc95..3e2d04b3a2 100644
--- a/src/nvim/buffer_updates.c
+++ b/src/nvim/buffer_updates.c
@@ -84,6 +84,7 @@ bool buf_updates_register(buf_T *buf, uint64_t channel_id, BufUpdateCallbacks cb
}
bool buf_updates_active(buf_T *buf)
+ FUNC_ATTR_PURE
{
return kv_size(buf->update_channels) || kv_size(buf->update_callbacks);
}
diff --git a/src/nvim/charset.c b/src/nvim/charset.c
index ec1866e9cc..31c61a1398 100644
--- a/src/nvim/charset.c
+++ b/src/nvim/charset.c
@@ -654,6 +654,7 @@ static inline unsigned nr2hex(unsigned n)
///
/// @reeturn Number of display cells.
int byte2cells(int b)
+ FUNC_ATTR_PURE
{
if (b >= 0x80) {
return 0;
@@ -1176,6 +1177,7 @@ intptr_t getwhitecols_curline(void)
}
intptr_t getwhitecols(const char_u *p)
+ FUNC_ATTR_PURE
{
return skipwhite(p) - p;
}
@@ -1222,6 +1224,7 @@ const char *skipbin(const char *q)
/// @return Pointer to the character after the skipped digits and hex
/// characters.
char_u *skiphex(char_u *q)
+ FUNC_ATTR_PURE
{
char_u *p = q;
while (ascii_isxdigit(*p)) {
@@ -1237,6 +1240,7 @@ char_u *skiphex(char_u *q)
///
/// @return Pointer to the digit or (NUL after the string).
char_u *skiptodigit(char_u *q)
+ FUNC_ATTR_PURE
{
char_u *p = q;
while (*p != NUL && !ascii_isdigit(*p)) {
@@ -1270,6 +1274,7 @@ const char *skiptobin(const char *q)
///
/// @return Pointer to the hex character or (NUL after the string).
char_u *skiptohex(char_u *q)
+ FUNC_ATTR_PURE
{
char_u *p = q;
while (*p != NUL && !ascii_isxdigit(*p)) {
@@ -1285,7 +1290,7 @@ char_u *skiptohex(char_u *q)
///
/// @return Pointer to the next whitespace or NUL character.
char_u *skiptowhite(const char_u *p)
- FUNC_ATTR_NONNULL_ALL
+ FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE
{
while (*p != ' ' && *p != '\t' && *p != NUL) {
p++;
@@ -1299,6 +1304,7 @@ char_u *skiptowhite(const char_u *p)
///
/// @return Pointer to the next whitespace character.
char_u *skiptowhite_esc(char_u *p)
+ FUNC_ATTR_PURE
{
while (*p != ' ' && *p != '\t' && *p != NUL) {
if (((*p == '\\') || (*p == Ctrl_V)) && (*(p + 1) != NUL)) {
@@ -1392,6 +1398,7 @@ long getdigits_long(char_u **pp, bool strict, long def)
///
/// @param lbuf line buffer to check
bool vim_isblankline(char_u *lbuf)
+ FUNC_ATTR_PURE
{
char_u *p = skipwhite(lbuf);
return *p == NUL || *p == '\r' || *p == '\n';
@@ -1618,6 +1625,7 @@ vim_str2nr_proceed:
///
/// @return The value of the hex character.
int hex2nr(int c)
+ FUNC_ATTR_CONST
{
if ((c >= 'a') && (c <= 'f')) {
return c - 'a' + 10;
@@ -1632,6 +1640,7 @@ int hex2nr(int c)
/// Convert two hex characters to a byte.
/// Return -1 if one of the characters is not hex.
int hexhex2nr(char_u *p)
+ FUNC_ATTR_PURE
{
if (!ascii_isxdigit(p[0]) || !ascii_isxdigit(p[1])) {
return -1;
diff --git a/src/nvim/context.c b/src/nvim/context.c
index 9434b4e0ea..c30a05a3c8 100644
--- a/src/nvim/context.c
+++ b/src/nvim/context.c
@@ -33,6 +33,7 @@ void ctx_free_all(void)
/// Returns the size of the context stack.
size_t ctx_size(void)
+ FUNC_ATTR_PURE
{
return kv_size(ctx_stack);
}
@@ -40,6 +41,7 @@ size_t ctx_size(void)
/// Returns pointer to Context object with given zero-based index from the top
/// of context stack or NULL if index is out of bounds.
Context *ctx_get(size_t index)
+ FUNC_ATTR_PURE
{
if (index < kv_size(ctx_stack)) {
return &kv_Z(ctx_stack, index);
diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c
index 0e4a4bcfb0..73adff6579 100644
--- a/src/nvim/cursor_shape.c
+++ b/src/nvim/cursor_shape.c
@@ -277,6 +277,7 @@ char *parse_shape_opt(int what)
///
/// @param exclusive If 'selection' option is "exclusive".
bool cursor_is_block_during_visual(bool exclusive)
+ FUNC_ATTR_PURE
{
int mode_idx = exclusive ? SHAPE_IDX_VE : SHAPE_IDX_V;
return (SHAPE_BLOCK == shape_table[mode_idx].shape
@@ -300,6 +301,7 @@ int cursor_mode_str2int(const char *mode)
/// Check if a syntax id is used as a cursor style.
bool cursor_mode_uses_syn_id(int syn_id)
+ FUNC_ATTR_PURE
{
if (*p_guicursor == NUL) {
return false;
@@ -316,6 +318,7 @@ bool cursor_mode_uses_syn_id(int syn_id)
/// Return the index into shape_table[] for the current mode.
int cursor_get_mode_idx(void)
+ FUNC_ATTR_PURE
{
if (State == SHOWMATCH) {
return SHAPE_IDX_SM;
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index 0b55fb877c..9e8fa2e62d 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -883,6 +883,7 @@ theend:
/// diff will be used anyway.
///
int diff_internal(void)
+ FUNC_ATTR_PURE
{
return (diff_flags & DIFF_INTERNAL) != 0 && *p_dex == NUL;
}
@@ -2250,6 +2251,7 @@ bool diffopt_horizontal(void)
// Return true if 'diffopt' contains "hiddenoff".
bool diffopt_hiddenoff(void)
+ FUNC_ATTR_PURE
{
return (diff_flags & DIFF_HIDDEN_OFF) != 0;
}
diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c
index 083c868607..0e148543aa 100644
--- a/src/nvim/digraph.c
+++ b/src/nvim/digraph.c
@@ -1551,6 +1551,7 @@ int get_digraph(bool cmdline)
/// @return If no match, return "char2". If "meta_char" is true and "char1"
// is a space, return "char2" | 0x80.
static int getexactdigraph(int char1, int char2, bool meta_char)
+ FUNC_ATTR_PURE
{
int retval = 0;
@@ -1601,6 +1602,7 @@ static int getexactdigraph(int char1, int char2, bool meta_char)
///
/// @return The digraph.
int digraph_get(int char1, int char2, bool meta_char)
+ FUNC_ATTR_PURE
{
int retval;
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 47d491033b..72a9220983 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -846,6 +846,7 @@ static int insert_execute(VimState *state, int key)
/// Don't do this when still processing a command or a mapping.
/// Don't do this when inside a ":normal" command.
bool goto_im(void)
+ FUNC_ATTR_PURE
{
return p_im && stuff_empty() && typebuf_typed();
}
@@ -1654,7 +1655,7 @@ void edit_putchar(int c, bool highlight)
/// Return the effective prompt for the specified buffer.
char_u *buf_prompt_text(const buf_T *const buf)
- FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
+ FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_PURE
{
if (buf->b_prompt_text == NULL) {
return (char_u *)"% ";
@@ -1663,7 +1664,8 @@ char_u *buf_prompt_text(const buf_T *const buf)
}
// Return the effective prompt for the current buffer.
-char_u *prompt_text(void) FUNC_ATTR_WARN_UNUSED_RESULT
+char_u *prompt_text(void)
+ FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_PURE
{
return buf_prompt_text(curbuf);
}
@@ -1711,6 +1713,7 @@ static void init_prompt(int cmdchar_todo)
/// @return true if the cursor is in the editable position of the prompt line.
bool prompt_curpos_editable(void)
+ FUNC_ATTR_PURE
{
return curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count
&& curwin->w_cursor.col >= (int)STRLEN(prompt_text());
@@ -2101,6 +2104,7 @@ static void ins_ctrl_x(void)
// Whether other than default completion has been selected.
bool ctrl_x_mode_not_default(void)
+ FUNC_ATTR_PURE
{
return ctrl_x_mode != CTRL_X_NORMAL;
}
@@ -2108,6 +2112,7 @@ bool ctrl_x_mode_not_default(void)
// Whether CTRL-X was typed without a following character,
// not including when in CTRL-X CTRL-V mode.
bool ctrl_x_mode_not_defined_yet(void)
+ FUNC_ATTR_PURE
{
return ctrl_x_mode == CTRL_X_NOT_DEFINED_YET;
}
@@ -3140,6 +3145,7 @@ static void ins_compl_files(int count, char_u **files, int thesaurus, int flags,
* Returns a pointer to the first char of the word. Also stops at a NUL.
*/
char_u *find_word_start(char_u *ptr)
+ FUNC_ATTR_PURE
{
while (*ptr != NUL && *ptr != '\n' && mb_get_class(ptr) <= 1) {
ptr += utfc_ptr2len(ptr);
@@ -3152,6 +3158,7 @@ char_u *find_word_start(char_u *ptr)
* Returns a pointer to just after the word.
*/
char_u *find_word_end(char_u *ptr)
+ FUNC_ATTR_PURE
{
const int start_class = mb_get_class(ptr);
if (start_class > 1) {
@@ -7144,6 +7151,7 @@ int stuff_inserted(int c, long count, int no_esc)
}
char_u *get_last_insert(void)
+ FUNC_ATTR_PURE
{
if (last_insert == NULL) {
return NULL;
@@ -7690,6 +7698,7 @@ bool in_cinkeys(int keytyped, int when, bool line_is_empty)
* Map Hebrew keyboard when in hkmap mode.
*/
int hkmap(int c)
+ FUNC_ATTR_PURE
{
if (p_hkmapp) { // phonetic mapping, by Ilya Dogolazky
enum {
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 3e855ece15..bebadc1282 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -5050,6 +5050,7 @@ static int get_lit_string_tv(char_u **arg, typval_T *rettv, int evaluate)
/// @return the function name of the partial.
char_u *partial_name(partial_T *pt)
+ FUNC_ATTR_PURE
{
if (pt->pt_name != NULL) {
return pt->pt_name;
@@ -6401,6 +6402,9 @@ dict_T *get_win_info(win_T *wp, int16_t tpnr, int16_t winnr)
{
dict_T *const dict = tv_dict_alloc();
+ // make sure w_botline is valid
+ validate_botline(wp);
+
tv_dict_add_nr(dict, S_LEN("tabnr"), tpnr);
tv_dict_add_nr(dict, S_LEN("winnr"), winnr);
tv_dict_add_nr(dict, S_LEN("winid"), wp->handle);
@@ -8522,6 +8526,7 @@ static void check_vars(const char *name, size_t len)
/// check if special v:lua value for calling lua functions
bool is_luafunc(partial_T *partial)
+ FUNC_ATTR_PURE
{
return partial == vvlua_partial;
}
@@ -9919,6 +9924,7 @@ void func_line_end(void *cookie)
}
static var_flavour_T var_flavour(char_u *varname)
+ FUNC_ATTR_PURE
{
char_u *p = varname;
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 61bd9571b5..5e0dac5e55 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -2497,16 +2497,19 @@ int do_ecmd(int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T new
if (buf->b_fname != NULL) {
new_name = vim_strsave(buf->b_fname);
}
+ const bufref_T save_au_new_curbuf = au_new_curbuf;
set_bufref(&au_new_curbuf, buf);
apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, false, curbuf);
cmdwin_type = save_cmdwin_type;
if (!bufref_valid(&au_new_curbuf)) {
// New buffer has been deleted.
delbuf_msg(new_name); // Frees new_name.
+ au_new_curbuf = save_au_new_curbuf;
goto theend;
}
if (aborting()) { // autocmds may abort script processing
xfree(new_name);
+ au_new_curbuf = save_au_new_curbuf;
goto theend;
}
if (buf == curbuf) { // already in new buffer
@@ -2540,12 +2543,14 @@ int do_ecmd(int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T new
// autocmds may abort script processing
if (aborting() && curwin->w_buffer != NULL) {
xfree(new_name);
+ au_new_curbuf = save_au_new_curbuf;
goto theend;
}
// Be careful again, like above.
if (!bufref_valid(&au_new_curbuf)) {
// New buffer has been deleted.
delbuf_msg(new_name); // Frees new_name.
+ au_new_curbuf = save_au_new_curbuf;
goto theend;
}
if (buf == curbuf) { // already in new buffer
@@ -2585,8 +2590,7 @@ int do_ecmd(int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T new
did_get_winopts = true;
}
xfree(new_name);
- au_new_curbuf.br_buf = NULL;
- au_new_curbuf.br_buf_free_count = 0;
+ au_new_curbuf = save_au_new_curbuf;
}
curwin->w_pcmark.lnum = 1;
@@ -4965,6 +4969,7 @@ char_u *check_help_lang(char_u *arg)
///
/// @return a heuristic indicating how well the given string matches.
int help_heuristic(char_u *matched_string, int offset, int wrong_case)
+ FUNC_ATTR_PURE
{
int num_letters;
char_u *p;
diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua
index c2d40c8bb7..427e018141 100644
--- a/src/nvim/ex_cmds.lua
+++ b/src/nvim/ex_cmds.lua
@@ -2947,7 +2947,7 @@ module.cmds = {
},
{
command='undo',
- flags=bit.bor(RANGE, COUNT, ZEROR, TRLBAR, CMDWIN),
+ flags=bit.bor(BANG, RANGE, COUNT, ZEROR, TRLBAR, CMDWIN),
addr_type='ADDR_OTHER',
func='ex_undo',
},
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index ac1d760bce..04fcb0304e 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -201,6 +201,7 @@ static char *pexpand_cmds[] = {
/// Function given to ExpandGeneric() to obtain the profile command
/// specific expansion.
char_u *get_profile_name(expand_T *xp, int idx)
+ FUNC_ATTR_PURE
{
switch (pexpand_what) {
case PEXP_SUBCMD:
@@ -439,6 +440,7 @@ static void script_dump_profile(FILE *fd)
/// @return true when a function defined in the current script should be
/// profiled.
bool prof_def_func(void)
+ FUNC_ATTR_PURE
{
if (current_sctx.sc_sid > 0) {
return SCRIPT_ITEM(current_sctx.sc_sid).sn_pr_force;
@@ -1732,6 +1734,7 @@ int *source_dbg_tick(void *cookie)
/// @return the nesting level for a source cookie.
int source_level(void *cookie)
+ FUNC_ATTR_PURE
{
return ((struct source_cookie *)cookie)->level;
}
@@ -2288,6 +2291,7 @@ void free_scriptnames(void)
#endif
linenr_T get_sourced_lnum(LineGetter fgetline, void *cookie)
+ FUNC_ATTR_PURE
{
return fgetline == getsourceline
? ((struct source_cookie *)cookie)->sourcing_lnum
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 4ffed77c14..2c7dcffaf1 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -76,6 +76,7 @@
#include "nvim/terminal.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
+#include "nvim/undo_defs.h"
#include "nvim/version.h"
#include "nvim/vim.h"
#include "nvim/window.h"
@@ -2373,8 +2374,13 @@ int parse_cmd_address(exarg_T *eap, char **errormsg, bool silent)
switch (eap->addr_type) {
case ADDR_LINES:
case ADDR_OTHER:
- // default is current line number
- eap->line2 = curwin->w_cursor.lnum;
+ // Default is the cursor line number. Avoid using an invalid
+ // line number though.
+ if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) {
+ eap->line2 = curbuf->b_ml.ml_line_count;
+ } else {
+ eap->line2 = curwin->w_cursor.lnum;
+ }
break;
case ADDR_WINDOWS:
eap->line2 = CURRENT_WIN_NR;
@@ -8225,10 +8231,39 @@ static void ex_bang(exarg_T *eap)
/// ":undo".
static void ex_undo(exarg_T *eap)
{
- if (eap->addr_count == 1) { // :undo 123
- undo_time(eap->line2, false, false, true);
- } else {
- u_undo(1);
+ if (eap->addr_count != 1) {
+ if (eap->forceit) {
+ u_undo_and_forget(1); // :undo!
+ } else {
+ u_undo(1); // :undo
+ }
+ return;
+ }
+
+ long step = eap->line2;
+
+ if (eap->forceit) { // undo! 123
+ // change number for "undo!" must be lesser than current change number
+ if (step >= curbuf->b_u_seq_cur) {
+ emsg(_(e_undobang_cannot_redo_or_move_branch));
+ return;
+ }
+ // ensure that target change number is in same branch
+ // while also counting the amount of undoes it'd take to reach target
+ u_header_T *uhp;
+ int count = 0;
+
+ for (uhp = curbuf->b_u_curhead ? curbuf->b_u_curhead : curbuf->b_u_newhead;
+ uhp != NULL && uhp->uh_seq > step;
+ uhp = uhp->uh_next.ptr, ++count) {
+ }
+ if (step != 0 && (uhp == NULL || uhp->uh_seq < step)) {
+ emsg(_(e_undobang_cannot_redo_or_move_branch));
+ return;
+ }
+ u_undo_and_forget(count);
+ } else { // :undo 123
+ undo_time(step, false, false, true);
}
}
diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c
index a32f7db5f2..21e8a00d7d 100644
--- a/src/nvim/ex_eval.c
+++ b/src/nvim/ex_eval.c
@@ -129,6 +129,7 @@ int should_abort(int retcode)
/// to find finally clauses to be executed, and that some errors in skipped
/// commands are still reported.
int aborted_in_try(void)
+ FUNC_ATTR_PURE
{
// This function is only called after an error. In this case, "force_abort"
// determines whether searching for finally clauses is necessary.
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 49bd8e7b21..b7d75855d6 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -2604,6 +2604,7 @@ char_u *getexline(int c, void *cookie, int indent, bool do_concat)
}
bool cmdline_overstrike(void)
+ FUNC_ATTR_PURE
{
return ccline.overstrike;
}
@@ -2611,6 +2612,7 @@ bool cmdline_overstrike(void)
/// Return true if the cursor is at the end of the cmdline.
bool cmdline_at_end(void)
+ FUNC_ATTR_PURE
{
return (ccline.cmdpos >= ccline.cmdlen);
}
@@ -6374,6 +6376,7 @@ static int open_cmdwin(void)
// Create a window for the command-line buffer.
if (win_split((int)p_cwh, WSP_BOT) == FAIL) {
beep_flush();
+ ga_clear(&winsizes);
return K_IGNORE;
}
cmdwin_type = get_cmdline_type();
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index d4407b4982..be66a6ce80 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -1118,7 +1118,7 @@ retry:
&& tmpname == NULL
&& (*fenc == 'u' || *fenc == NUL)))) {
char_u *ccname;
- int blen;
+ int blen = 0;
// no BOM detection in a short file or in binary mode
if (size < 2 || curbuf->b_p_bin) {
diff --git a/src/nvim/fold.c b/src/nvim/fold.c
index 3643ceb460..bc31fe42ba 100644
--- a/src/nvim/fold.c
+++ b/src/nvim/fold.c
@@ -1058,7 +1058,7 @@ void cloneFoldGrowArray(garray_T *from, garray_T *to)
// foldFind() {{{2
/// Search for line "lnum" in folds of growarray "gap".
-/// Set *fpp to the fold struct for the fold that contains "lnum" or
+/// Set "*fpp" to the fold struct for the fold that contains "lnum" or
/// the first fold below it (careful: it can be beyond the end of the array!).
///
/// @return false when there is no fold that contains "lnum".
@@ -2615,7 +2615,8 @@ static void foldSplit(buf_T *buf, garray_T *const gap, const int i, const linenr
// any between top and bot, they have been removed by the caller.
garray_T *const gap1 = &fp->fd_nested;
garray_T *const gap2 = &fp[1].fd_nested;
- if (foldFind(gap1, bot + 1 - fp->fd_top, &fp2)) {
+ (void)foldFind(gap1, bot + 1 - fp->fd_top, &fp2);
+ if (fp2 != NULL) {
const int len = (int)((fold_T *)gap1->ga_data + gap1->ga_len - fp2);
if (len > 0) {
ga_grow(gap2, len);
@@ -2751,6 +2752,7 @@ static void truncate_fold(win_T *const wp, fold_T *fp, linenr_T end)
}
#define FOLD_END(fp) ((fp)->fd_top + (fp)->fd_len - 1)
+// -V:VALID_FOLD:V560
#define VALID_FOLD(fp, gap) \
((gap)->ga_len > 0 && (fp) < ((fold_T *)(gap)->ga_data + (gap)->ga_len))
#define FOLD_INDEX(fp, gap) ((size_t)((fp) - ((fold_T *)(gap)->ga_data)))
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 85479b220a..f2df7b49fd 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -397,6 +397,7 @@ static void start_stuff(void)
* Return TRUE if the stuff buffer is empty.
*/
int stuff_empty(void)
+ FUNC_ATTR_PURE
{
return (readbuf1.bh_first.b_next == NULL && readbuf2.bh_first.b_next == NULL);
}
@@ -406,6 +407,7 @@ int stuff_empty(void)
* redbuf2.
*/
int readbuf1_empty(void)
+ FUNC_ATTR_PURE
{
return (readbuf1.bh_first.b_next == NULL);
}
@@ -1025,10 +1027,10 @@ int ins_char_typebuf(int c, int modifier)
///
/// @param tb_change_cnt old value of typebuf.tb_change_cnt
bool typebuf_changed(int tb_change_cnt)
+ FUNC_ATTR_PURE
{
return tb_change_cnt != 0 && (typebuf.tb_change_cnt != tb_change_cnt
- || typebuf_was_filled
- );
+ || typebuf_was_filled);
}
/*
@@ -1036,6 +1038,7 @@ bool typebuf_changed(int tb_change_cnt)
* not been typed (result from a mapping or come from ":normal").
*/
int typebuf_typed(void)
+ FUNC_ATTR_PURE
{
return typebuf.tb_maplen == 0;
}
@@ -1044,6 +1047,7 @@ int typebuf_typed(void)
* Return the number of characters that are mapped (or not typed).
*/
int typebuf_maplen(void)
+ FUNC_ATTR_PURE
{
return typebuf.tb_maplen;
}
@@ -1403,6 +1407,7 @@ void close_all_scripts(void)
* Return TRUE when reading keys from a script file.
*/
int using_script(void)
+ FUNC_ATTR_PURE
{
return scriptin[curscript] != NULL;
}
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 2b85b6a208..e07a0e22ca 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -1013,6 +1013,9 @@ EXTERN char e_line_number_out_of_range[] INIT(= N_("E1247: Line number out of ra
EXTERN char e_highlight_group_name_too_long[] INIT(= N_("E1249: Highlight group name too long"));
+EXTERN char e_undobang_cannot_redo_or_move_branch[]
+INIT(= N_("E5767: Cannot use :undo! to redo or move to a different undo branch"));
+
EXTERN char top_bot_msg[] INIT(= N_("search hit TOP, continuing at BOTTOM"));
EXTERN char bot_top_msg[] INIT(= N_("search hit BOTTOM, continuing at TOP"));
diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h
index e0ee649013..0515842b61 100644
--- a/src/nvim/highlight_defs.h
+++ b/src/nvim/highlight_defs.h
@@ -63,6 +63,7 @@ typedef enum {
HLF_E, // error messages
HLF_I, // incremental search
HLF_L, // last search string
+ HLF_LC, // current search match
HLF_M, // "--More--" message
HLF_CM, // Mode (e.g., "-- INSERT --")
HLF_N, // line number for ":number" and ":#" commands
@@ -123,6 +124,7 @@ EXTERN const char *hlf_names[] INIT(= {
[HLF_E] = "ErrorMsg",
[HLF_I] = "IncSearch",
[HLF_L] = "Search",
+ [HLF_LC] = "CurSearch",
[HLF_M] = "MoreMsg",
[HLF_CM] = "ModeMsg",
[HLF_N] = "LineNr",
diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c
index 3092aaefab..a9ced84280 100644
--- a/src/nvim/highlight_group.c
+++ b/src/nvim/highlight_group.c
@@ -1927,7 +1927,7 @@ void highlight_changed(void)
}
highlight_attr[hlf] = hl_get_ui_attr(hlf, final_id,
- hlf == HLF_INACTIVE);
+ (hlf == HLF_INACTIVE || hlf == HLF_LC));
if (highlight_attr[hlf] != highlight_attr_last[hlf]) {
if (hlf == HLF_MSG) {
diff --git a/src/nvim/match.c b/src/nvim/match.c
index af89319a09..ed320eb6fc 100644
--- a/src/nvim/match.c
+++ b/src/nvim/match.c
@@ -4,6 +4,7 @@
// match.c: functions for highlighting matches
#include <stdbool.h>
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/fold.h"
#include "nvim/highlight_group.h"
@@ -372,6 +373,7 @@ static int next_search_hl_pos(match_T *shl, linenr_T lnum, posmatch_T *posmatch,
shl->rm.endpos[0].lnum = 0;
shl->rm.endpos[0].col = end;
shl->is_addpos = true;
+ shl->has_cursor = false;
posmatch->cur = found + 1;
return 1;
}
@@ -558,6 +560,22 @@ void prepare_search_hl(win_T *wp, match_T *search_hl, linenr_T lnum)
}
}
+/// Update "shl->has_cursor" based on the match in "shl" and the cursor
+/// position.
+static void check_cur_search_hl(win_T *wp, match_T *shl)
+{
+ linenr_T linecount = shl->rm.endpos[0].lnum - shl->rm.startpos[0].lnum;
+
+ if (wp->w_cursor.lnum >= shl->lnum
+ && wp->w_cursor.lnum <= shl->lnum + linecount
+ && (wp->w_cursor.lnum > shl->lnum || wp->w_cursor.col >= shl->rm.startpos[0].col)
+ && (wp->w_cursor.lnum < shl->lnum + linecount || wp->w_cursor.col < shl->rm.endpos[0].col)) {
+ shl->has_cursor = true;
+ } else {
+ shl->has_cursor = false;
+ }
+}
+
/// Prepare for 'hlsearch' and match highlighting in one window line.
/// Return true if there is such highlighting and set "search_attr" to the
/// current highlight attribute.
@@ -583,6 +601,7 @@ bool prepare_search_hl_line(win_T *wp, linenr_T lnum, colnr_T mincol, char_u **l
shl->endcol = MAXCOL;
shl->attr_cur = 0;
shl->is_addpos = false;
+ shl->has_cursor = false;
if (cur != NULL) {
cur->pos.cur = 0;
}
@@ -605,6 +624,12 @@ bool prepare_search_hl_line(win_T *wp, linenr_T lnum, colnr_T mincol, char_u **l
} else {
shl->endcol = MAXCOL;
}
+
+ // check if the cursor is in the match before changing the columns
+ if (shl == search_hl) {
+ check_cur_search_hl(wp, shl);
+ }
+
// Highlight one character for an empty match.
if (shl->startcol == shl->endcol) {
if ((*line)[shl->endcol] != NUL) {
@@ -667,7 +692,13 @@ int update_search_hl(win_T *wp, linenr_T lnum, colnr_T col, char_u **line, match
if (shl->endcol < next_col) {
shl->endcol = next_col;
}
- shl->attr_cur = shl->attr;
+ // Highlight the match were the cursor is using the CurSearch
+ // group.
+ if (shl == search_hl && shl->has_cursor && (HL_ATTR(HLF_LC) || wp->w_hl_ids[HLF_LC])) {
+ shl->attr_cur = win_hl_attr(wp, HLF_LC) ? win_hl_attr(wp, HLF_LC) : HL_ATTR(HLF_LC);
+ } else {
+ shl->attr_cur = shl->attr;
+ }
// Match with the "Conceal" group results in hiding
// the match.
if (cur != NULL
@@ -697,6 +728,11 @@ int update_search_hl(win_T *wp, linenr_T lnum, colnr_T col, char_u **line, match
shl->endcol = MAXCOL;
}
+ // check if the cursor is in the match
+ if (shl == search_hl) {
+ check_cur_search_hl(wp, shl);
+ }
+
if (shl->startcol == shl->endcol) {
// highlight empty match, try again after it
shl->endcol += utfc_ptr2len(*line + shl->endcol);
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index f634c7dda8..6e3c5322e7 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -334,10 +334,9 @@ enc_alias_table[] =
* Returns -1 if not found.
*/
static int enc_canon_search(const char_u *name)
+ FUNC_ATTR_PURE
{
- int i;
-
- for (i = 0; i < IDX_COUNT; ++i) {
+ for (int i = 0; i < IDX_COUNT; i++) {
if (STRCMP(name, enc_canon_table[i].name) == 0) {
return i;
}
@@ -351,10 +350,9 @@ static int enc_canon_search(const char_u *name)
* Returns 0 if not found.
*/
int enc_canon_props(const char_u *name)
+ FUNC_ATTR_PURE
{
- int i;
-
- i = enc_canon_search(name);
+ int i = enc_canon_search(name);
if (i >= 0) {
return enc_canon_table[i].prop;
} else if (STRNCMP(name, "2byte-", 6) == 0) {
@@ -373,6 +371,7 @@ int enc_canon_props(const char_u *name)
* 3 - UTF-8 BOM
*/
int bomb_size(void)
+ FUNC_ATTR_PURE
{
int n = 0;
@@ -414,11 +413,13 @@ void remove_bom(char_u *s)
* >2 for other word characters
*/
int mb_get_class(const char_u *p)
+ FUNC_ATTR_PURE
{
return mb_get_class_tab(p, curbuf->b_chartab);
}
int mb_get_class_tab(const char_u *p, const uint64_t *const chartab)
+ FUNC_ATTR_PURE
{
if (MB_BYTE2LEN(p[0]) == 1) {
if (p[0] == NUL || ascii_iswhite(p[0])) {
@@ -436,6 +437,7 @@ int mb_get_class_tab(const char_u *p, const uint64_t *const chartab)
* Return true if "c" is in "table".
*/
static bool intable(const struct interval *table, size_t n_items, int c)
+ FUNC_ATTR_PURE
{
int mid, bot, top;
@@ -1087,6 +1089,7 @@ int utf_class(const int c)
}
int utf_class_tab(const int c, const uint64_t *const chartab)
+ FUNC_ATTR_PURE
{
// sorted list of non-overlapping intervals
static struct clinterval {
diff --git a/src/nvim/move.c b/src/nvim/move.c
index eda3298101..ae908e893c 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -95,27 +95,31 @@ static void comp_botline(win_T *wp)
win_check_anchored_floats(wp);
}
-/// Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is set.
+/// Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is set
+/// or if the 'CurSearch' highlight is defined.
/// Also when concealing is on and 'concealcursor' is not active.
void redraw_for_cursorline(win_T *wp)
FUNC_ATTR_NONNULL_ALL
{
if ((wp->w_valid & VALID_CROW) == 0 && !pum_visible()
- && (wp->w_p_rnu || win_cursorline_standout(wp))) {
- // win_line() will redraw the number column and cursorline only.
+ && (wp->w_p_rnu || win_cursorline_standout(wp)
+ || HL_ATTR(HLF_LC) || wp->w_hl_ids[HLF_LC])) {
+ // win_line() will redraw the number column and cursorline only
+ // and also update the CurSearch highlight (if needed).
redraw_later(wp, VALID);
}
}
/// Redraw when w_virtcol changes and 'cursorcolumn' is set or 'cursorlineopt'
-/// contains "screenline".
+/// contains "screenline" or when the 'CurSearch' highlight is defined.
/// Also when concealing is on and 'concealcursor' is active.
static void redraw_for_cursorcolumn(win_T *wp)
FUNC_ATTR_NONNULL_ALL
{
if ((wp->w_valid & VALID_VIRTCOL) == 0 && !pum_visible()) {
- if (wp->w_p_cuc) {
- // When 'cursorcolumn' is set need to redraw with SOME_VALID.
+ if (wp->w_p_cuc || HL_ATTR(HLF_LC) || wp->w_hl_ids[HLF_LC]) {
+ // When 'cursorcolumn' is set or 'CurSearch' is defined
+ // need to redraw with SOME_VALID.
redraw_later(wp, SOME_VALID);
} else if (wp->w_p_cul && (wp->w_p_culopt_flags & CULOPT_SCRLINE)) {
// When 'cursorlineopt' contains "screenline" need to redraw with VALID.
@@ -2275,9 +2279,7 @@ void do_check_cursorbind(void)
int restart_edit_save = restart_edit;
restart_edit = true;
check_cursor();
- if (win_cursorline_standout(curwin) || curwin->w_p_cuc) {
- validate_cursor();
- }
+ validate_cursor();
restart_edit = restart_edit_save;
}
// Correct cursor for multi-byte character.
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index d6b3b53c86..ed5f13d00a 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -97,18 +97,14 @@ static inline void normal_state_init(NormalState *s)
s->state.execute = normal_execute;
}
-/*
- * nv_*(): functions called to handle Normal and Visual mode commands.
- * n_*(): functions called to handle Normal mode commands.
- * v_*(): functions called to handle Visual mode commands.
- */
+// nv_*(): functions called to handle Normal and Visual mode commands.
+// n_*(): functions called to handle Normal mode commands.
+// v_*(): functions called to handle Visual mode commands.
static char *e_noident = N_("E349: No identifier under cursor");
-/*
- * Function to be called for a Normal or Visual mode command.
- * The argument is a cmdarg_T.
- */
+/// Function to be called for a Normal or Visual mode command.
+/// The argument is a cmdarg_T.
typedef void (*nv_func_T)(cmdarg_T *cap);
// Values for cmd_flags.
@@ -124,26 +120,22 @@ typedef void (*nv_func_T)(cmdarg_T *cap);
#define NV_KEEPREG 0x100 // don't clear regname
#define NV_NCW 0x200 // not allowed in command-line window
-/*
- * Generally speaking, every Normal mode command should either clear any
- * pending operator (with *clearop*()), or set the motion type variable
- * oap->motion_type.
- *
- * When a cursor motion command is made, it is marked as being a character or
- * line oriented motion. Then, if an operator is in effect, the operation
- * becomes character or line oriented accordingly.
- */
-
-/*
- * This table contains one entry for every Normal or Visual mode command.
- * The order doesn't matter, init_normal_cmds() will create a sorted index.
- * It is faster when all keys from zero to '~' are present.
- */
+// Generally speaking, every Normal mode command should either clear any
+// pending operator (with *clearop*()), or set the motion type variable
+// oap->motion_type.
+//
+// When a cursor motion command is made, it is marked as being a character or
+// line oriented motion. Then, if an operator is in effect, the operation
+// becomes character or line oriented accordingly.
+
+/// This table contains one entry for every Normal or Visual mode command.
+/// The order doesn't matter, init_normal_cmds() will create a sorted index.
+/// It is faster when all keys from zero to '~' are present.
static const struct nv_cmd {
- int cmd_char; // (first) command character
- nv_func_T cmd_func; // function for this command
- uint16_t cmd_flags; // NV_ flags
- short cmd_arg; // value for ca.arg
+ int cmd_char; ///< (first) command character
+ nv_func_T cmd_func; ///< function for this command
+ uint16_t cmd_flags; ///< NV_ flags
+ int16_t cmd_arg; ///< value for ca.arg
} nv_cmds[] =
{
{ NUL, nv_error, 0, 0 },
@@ -341,23 +333,21 @@ static const struct nv_cmd {
#define NV_CMDS_SIZE ARRAY_SIZE(nv_cmds)
// Sorted index of commands in nv_cmds[].
-static short nv_cmd_idx[NV_CMDS_SIZE];
+static int16_t nv_cmd_idx[NV_CMDS_SIZE];
// The highest index for which
// nv_cmds[idx].cmd_char == nv_cmd_idx[nv_cmds[idx].cmd_char]
static int nv_max_linear;
-/*
- * Compare functions for qsort() below, that checks the command character
- * through the index in nv_cmd_idx[].
- */
+/// Compare functions for qsort() below, that checks the command character
+/// through the index in nv_cmd_idx[].
static int nv_compare(const void *s1, const void *s2)
{
int c1, c2;
// The commands are sorted on absolute value.
- c1 = nv_cmds[*(const short *)s1].cmd_char;
- c2 = nv_cmds[*(const short *)s2].cmd_char;
+ c1 = nv_cmds[*(const int16_t *)s1].cmd_char;
+ c2 = nv_cmds[*(const int16_t *)s2].cmd_char;
if (c1 < 0) {
c1 = -c1;
}
@@ -367,24 +357,22 @@ static int nv_compare(const void *s1, const void *s2)
return c1 - c2;
}
-/*
- * Initialize the nv_cmd_idx[] table.
- */
+/// Initialize the nv_cmd_idx[] table.
void init_normal_cmds(void)
{
assert(NV_CMDS_SIZE <= SHRT_MAX);
// Fill the index table with a one to one relation.
- for (short int i = 0; i < (short int)NV_CMDS_SIZE; ++i) {
+ for (int16_t i = 0; i < (int16_t)NV_CMDS_SIZE; i++) {
nv_cmd_idx[i] = i;
}
// Sort the commands by the command character.
- qsort(&nv_cmd_idx, NV_CMDS_SIZE, sizeof(short), nv_compare);
+ qsort(&nv_cmd_idx, NV_CMDS_SIZE, sizeof(int16_t), nv_compare);
// Find the first entry that can't be indexed by the command character.
- short int i;
- for (i = 0; i < (short int)NV_CMDS_SIZE; ++i) {
+ int16_t i;
+ for (i = 0; i < (int16_t)NV_CMDS_SIZE; i++) {
if (i != nv_cmds[nv_cmd_idx[i]].cmd_char) {
break;
}
@@ -392,10 +380,9 @@ void init_normal_cmds(void)
nv_max_linear = i - 1;
}
-/*
- * Search for a command in the commands table.
- * Returns -1 for invalid command.
- */
+/// Search for a command in the commands table.
+///
+/// @return -1 for invalid command.
static int find_command(int cmdchar)
{
int i;
@@ -841,10 +828,10 @@ static bool normal_get_command_count(NormalState *s)
no_mapping++;
}
- ++no_zero_mapping; // don't map zero here
+ no_zero_mapping++; // don't map zero here
s->c = plain_vgetc();
LANGMAP_ADJUST(s->c, true);
- --no_zero_mapping;
+ no_zero_mapping--;
if (s->ctrl_w) {
no_mapping--;
}
@@ -1419,10 +1406,8 @@ static int normal_check(VimState *state)
return 1;
}
-/*
- * Set v:count and v:count1 according to "cap".
- * Set v:prevcount only when "set_prevcount" is true.
- */
+/// Set v:count and v:count1 according to "cap".
+/// Set v:prevcount only when "set_prevcount" is true.
static void set_vcount_ca(cmdarg_T *cap, bool *set_prevcount)
{
long count = cap->count0;
@@ -1528,8 +1513,7 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
int save_mouse_row = mouse_row;
int save_mouse_col = mouse_col;
- /* Need to get the character, peeking doesn't get the actual
- * one. */
+ // Need to get the character, peeking doesn't get the actual one.
nc = safe_vgetc();
if (c == nc) {
continue;
@@ -1548,9 +1532,7 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
return false;
}
- /*
- * Ignore drag and release events if we didn't get a click.
- */
+ // Ignore drag and release events if we didn't get a click.
if (is_click) {
got_click = true;
} else {
@@ -1567,9 +1549,7 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
}
- /*
- * CTRL right mouse button does CTRL-T
- */
+ // CTRL right mouse button does CTRL-T
if (is_click && (mod_mask & MOD_MASK_CTRL) && which_button == MOUSE_RIGHT) {
if (State & INSERT) {
stuffcharReadbuff(Ctrl_O);
@@ -1582,18 +1562,14 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
return false;
}
- /*
- * CTRL only works with left mouse button
- */
+ // CTRL only works with left mouse button
if ((mod_mask & MOD_MASK_CTRL) && which_button != MOUSE_LEFT) {
return false;
}
- /*
- * When a modifier is down, ignore drag and release events, as well as
- * multiple clicks and the middle mouse button.
- * Accept shift-leftmouse drags when 'mousemodel' is "popup.*".
- */
+ // When a modifier is down, ignore drag and release events, as well as
+ // multiple clicks and the middle mouse button.
+ // Accept shift-leftmouse drags when 'mousemodel' is "popup.*".
if ((mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL | MOD_MASK_ALT
| MOD_MASK_META))
&& (!is_click
@@ -1608,11 +1584,9 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
return false;
}
- /*
- * If the button press was used as the movement command for an operator
- * (eg "d<MOUSE>"), or it is the middle button that is held down, ignore
- * drag/release events.
- */
+ // If the button press was used as the movement command for an operator (eg
+ // "d<MOUSE>"), or it is the middle button that is held down, ignore
+ // drag/release events.
if (!is_click && which_button == MOUSE_MIDDLE) {
return false;
}
@@ -1623,25 +1597,19 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
regname = 0;
}
- /*
- * Middle mouse button does a 'put' of the selected text
- */
+ // Middle mouse button does a 'put' of the selected text
if (which_button == MOUSE_MIDDLE) {
if (State == NORMAL) {
- /*
- * If an operator was pending, we don't know what the user wanted
- * to do. Go back to normal mode: Clear the operator and beep().
- */
+ // If an operator was pending, we don't know what the user wanted to do.
+ // Go back to normal mode: Clear the operator and beep().
if (oap != NULL && oap->op_type != OP_NOP) {
clearopbeep(oap);
return false;
}
- /*
- * If visual was active, yank the highlighted text and put it
- * before the mouse pointer position.
- * In Select mode replace the highlighted text with the clipboard.
- */
+ // If visual was active, yank the highlighted text and put it
+ // before the mouse pointer position.
+ // In Select mode replace the highlighted text with the clipboard.
if (VIsual_active) {
if (VIsual_select) {
stuffcharReadbuff(Ctrl_G);
@@ -1652,20 +1620,16 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
}
return false;
}
- /*
- * The rest is below jump_to_mouse()
- */
+ // The rest is below jump_to_mouse()
} else if ((State & INSERT) == 0) {
return false;
}
- /*
- * Middle click in insert mode doesn't move the mouse, just insert the
- * contents of a register. '.' register is special, can't insert that
- * with do_put().
- * Also paste at the cursor if the current mode isn't in 'mouse' (only
- * happens for the GUI).
- */
+ // Middle click in insert mode doesn't move the mouse, just insert the
+ // contents of a register. '.' register is special, can't insert that
+ // with do_put().
+ // Also paste at the cursor if the current mode isn't in 'mouse' (only
+ // happens for the GUI).
if ((State & INSERT)) {
if (regname == '.') {
insert_reg(regname, true);
@@ -1762,28 +1726,27 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
.v_lock = VAR_FIXED,
.v_type = VAR_NUMBER,
.vval = {
- .v_number = (((mod_mask & MOD_MASK_MULTI_CLICK)
- == MOD_MASK_4CLICK)
- ? 4
- : ((mod_mask & MOD_MASK_MULTI_CLICK)
- == MOD_MASK_3CLICK)
- ? 3
- : ((mod_mask & MOD_MASK_MULTI_CLICK)
- == MOD_MASK_2CLICK)
- ? 2
- : 1)
+ .v_number = ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_4CLICK
+ ? 4
+ : ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_3CLICK
+ ? 3
+ : ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK
+ ? 2
+ : 1)))
},
},
{
.v_lock = VAR_FIXED,
.v_type = VAR_STRING,
- .vval = { .v_string = (char_u *)(which_button == MOUSE_LEFT
- ? "l"
- : which_button == MOUSE_RIGHT
- ? "r"
- : which_button == MOUSE_MIDDLE
- ? "m"
- : "?") },
+ .vval = {
+ .v_string = (char_u *)(which_button == MOUSE_LEFT
+ ? "l"
+ : (which_button == MOUSE_RIGHT
+ ? "r"
+ : (which_button == MOUSE_MIDDLE
+ ? "m"
+ : "?")))
+ },
},
{
.v_lock = VAR_FIXED,
@@ -1818,19 +1781,15 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
}
- /*
- * When 'mousemodel' is "popup" or "popup_setpos", translate mouse events:
- * right button up -> pop-up menu
- * shift-left button -> right button
- * alt-left button -> alt-right button
- */
+ // When 'mousemodel' is "popup" or "popup_setpos", translate mouse events:
+ // right button up -> pop-up menu
+ // shift-left button -> right button
+ // alt-left button -> alt-right button
if (mouse_model_popup()) {
if (which_button == MOUSE_RIGHT
&& !(mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))) {
- /*
- * NOTE: Ignore right button down and drag mouse events.
- * Windows only shows the popup menu on the button up event.
- */
+ // NOTE: Ignore right button down and drag mouse events. Windows only
+ // shows the popup menu on the button up event.
return false;
}
if (which_button == MOUSE_LEFT
@@ -1844,8 +1803,7 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
&& !(mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))) {
if (which_button == MOUSE_LEFT) {
if (is_click) {
- /* stop Visual mode for a left click in a window, but not when
- * on a status line */
+ // stop Visual mode for a left click in a window, but not when on a status line
if (VIsual_active) {
jump_flags |= MOUSE_MAY_STOP_VIS;
}
@@ -1854,10 +1812,7 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
}
} else if (which_button == MOUSE_RIGHT) {
if (is_click && VIsual_active) {
- /*
- * Remember the start and end of visual before moving the
- * cursor.
- */
+ // Remember the start and end of visual before moving the cursor.
if (lt(curwin->w_cursor, VIsual)) {
start_visual = curwin->w_cursor;
end_visual = VIsual;
@@ -1871,10 +1826,7 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
}
}
- /*
- * If an operator is pending, ignore all drags and releases until the
- * next mouse click.
- */
+ // If an operator is pending, ignore all drags and releases until the next mouse click.
if (!is_drag && oap != NULL && oap->op_type != OP_NOP) {
got_click = false;
oap->motion_type = kMTCharWise;
@@ -1885,9 +1837,7 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
jump_flags |= MOUSE_RELEASED;
}
- /*
- * JUMP!
- */
+ // JUMP!
jump_flags = jump_to_mouse(jump_flags,
oap == NULL ? NULL : &(oap->inclusive),
which_button);
@@ -1897,8 +1847,8 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
in_sep_line = (jump_flags & IN_SEP_LINE);
- /* When jumping to another window, clear a pending operator. That's a bit
- * friendlier than beeping and not jumping to that window. */
+ // When jumping to another window, clear a pending operator. That's a bit
+ // friendlier than beeping and not jumping to that window.
if (curwin != old_curwin && oap != NULL && oap->op_type != OP_NOP) {
clearop(oap);
}
@@ -1920,8 +1870,8 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
}
- /* Set global flag that we are extending the Visual area with mouse
- * dragging; temporarily minimize 'scrolloff'. */
+ // Set global flag that we are extending the Visual area with mouse dragging;
+ // temporarily minimize 'scrolloff'.
if (VIsual_active && is_drag && get_scrolloff_value(curwin)) {
// In the very first line, allow scrolling one line
if (mouse_row == 0) {
@@ -1943,10 +1893,8 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
VIsual_mode = Ctrl_V;
}
- /*
- * In Visual-block mode, divide the area in four, pick up the corner
- * that is in the quarter that the cursor is in.
- */
+ // In Visual-block mode, divide the area in four, pick up the corner
+ // that is in the quarter that the cursor is in.
if (VIsual_mode == Ctrl_V) {
getvcols(curwin, &start_visual, &end_visual, &leftcol, &rightcol);
if (curwin->w_curswant > (leftcol + rightcol) / 2) {
@@ -1966,11 +1914,9 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
VIsual = curwin->w_cursor;
curwin->w_cursor = start_visual; // restore the cursor
} else {
- /*
- * If the click is before the start of visual, change the start.
- * If the click is after the end of visual, change the end. If
- * the click is inside the visual, change the closest side.
- */
+ // If the click is before the start of visual, change the start.
+ // If the click is after the end of visual, change the end. If
+ // the click is inside the visual, change the closest side.
if (lt(curwin->w_cursor, start_visual)) {
VIsual = end_visual;
} else if (lt(end_visual, curwin->w_cursor)) {
@@ -1984,9 +1930,8 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
} else {
VIsual = end_visual;
}
- }
- // In different lines, compare line number
- else {
+ } else {
+ // In different lines, compare line number
diff = (curwin->w_cursor.lnum - start_visual.lnum) -
(end_visual.lnum - curwin->w_cursor.lnum);
@@ -2005,17 +1950,12 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
}
}
}
- }
- /*
- * If Visual mode started in insert mode, execute "CTRL-O"
- */
- else if ((State & INSERT) && VIsual_active) {
+ } else if ((State & INSERT) && VIsual_active) {
+ // If Visual mode started in insert mode, execute "CTRL-O"
stuffcharReadbuff(Ctrl_O);
}
- /*
- * Middle mouse click: Put text before cursor.
- */
+ // Middle mouse click: Put text before cursor.
if (which_button == MOUSE_MIDDLE) {
if (regname == 0 && eval_has_provider("clipboard")) {
regname = '*';
@@ -2037,49 +1977,34 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
}
prep_redo(regname, count, NUL, c1, NUL, c2, NUL);
- /*
- * Remember where the paste started, so in edit() Insstart can be set
- * to this position
- */
+ // Remember where the paste started, so in edit() Insstart can be set to this position
if (restart_edit != 0) {
where_paste_started = curwin->w_cursor;
}
do_put(regname, NULL, dir, count,
(fixindent ? PUT_FIXINDENT : 0)| PUT_CURSEND);
- }
- /*
- * Ctrl-Mouse click or double click in a quickfix window jumps to the
- * error under the mouse pointer.
- */
- else if (((mod_mask & MOD_MASK_CTRL)
- || (mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK)
- && bt_quickfix(curbuf)) {
+ } else if (((mod_mask & MOD_MASK_CTRL) || (mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK)
+ && bt_quickfix(curbuf)) {
+ // Ctrl-Mouse click or double click in a quickfix window jumps to the
+ // error under the mouse pointer.
if (curwin->w_llist_ref == NULL) { // quickfix window
do_cmdline_cmd(".cc");
} else { // location list window
do_cmdline_cmd(".ll");
}
got_click = false; // ignore drag&release now
- }
- /*
- * Ctrl-Mouse click (or double click in a help window) jumps to the tag
- * under the mouse pointer.
- */
- else if ((mod_mask & MOD_MASK_CTRL) || (curbuf->b_help
- && (mod_mask &
- MOD_MASK_MULTI_CLICK) ==
- MOD_MASK_2CLICK)) {
+ } else if ((mod_mask & MOD_MASK_CTRL)
+ || (curbuf->b_help && (mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK)) {
+ // Ctrl-Mouse click (or double click in a help window) jumps to the tag
+ // under the mouse pointer.
if (State & INSERT) {
stuffcharReadbuff(Ctrl_O);
}
stuffcharReadbuff(Ctrl_RSB);
got_click = false; // ignore drag&release now
- }
- /*
- * Shift-Mouse click searches for the next occurrence of the word under
- * the mouse pointer
- */
- else if ((mod_mask & MOD_MASK_SHIFT)) {
+ } else if ((mod_mask & MOD_MASK_SHIFT)) {
+ // Shift-Mouse click searches for the next occurrence of the word under
+ // the mouse pointer
if (State & INSERT
|| (VIsual_active && VIsual_select)) {
stuffcharReadbuff(Ctrl_O);
@@ -2118,17 +2043,15 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
VIsual_mode = Ctrl_V;
}
}
- /*
- * A double click selects a word or a block.
- */
+ // A double click selects a word or a block.
if ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK) {
pos_T *pos = NULL;
int gc;
if (is_click) {
- /* If the character under the cursor (skipping white space) is
- * not a word character, try finding a match and select a (),
- * {}, [], #if/#endif, etc. block. */
+ // If the character under the cursor (skipping white space) is
+ // not a word character, try finding a match and select a (),
+ // {}, [], #if/#endif, etc. block.
end_visual = curwin->w_cursor;
while (gc = gchar_pos(&end_visual), ascii_iswhite(gc)) {
inc(&end_visual);
@@ -2155,8 +2078,7 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
}
if (pos == NULL && (is_click || is_drag)) {
- /* When not found a match or when dragging: extend to include
- * a word. */
+ // When not found a match or when dragging: extend to include a word.
if (lt(curwin->w_cursor, orig_cursor)) {
find_start_of_word(&curwin->w_cursor);
find_end_of_word(&VIsual);
@@ -2192,9 +2114,7 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent)
return moved;
}
-/*
- * Move "pos" back to the start of the word it's in.
- */
+/// Move "pos" back to the start of the word it's in.
static void find_start_of_word(pos_T *pos)
{
char_u *line;
@@ -2214,10 +2134,8 @@ static void find_start_of_word(pos_T *pos)
}
}
-/*
- * Move "pos" forward to the end of the word it's in.
- * When 'selection' is "exclusive", the position is just after the word.
- */
+/// Move "pos" forward to the end of the word it's in.
+/// When 'selection' is "exclusive", the position is just after the word.
static void find_end_of_word(pos_T *pos)
{
char_u *line;
@@ -2242,13 +2160,11 @@ static void find_end_of_word(pos_T *pos)
}
}
-/*
- * Get class of a character for selection: same class means same word.
- * 0: blank
- * 1: punctuation groups
- * 2: normal word character
- * >2: multi-byte word character.
- */
+/// Get class of a character for selection: same class means same word.
+/// 0: blank
+/// 1: punctuation groups
+/// 2: normal word character
+/// >2: multi-byte word character.
static int get_mouse_class(char_u *p)
{
if (MB_BYTE2LEN(p[0]) > 1) {
@@ -2263,23 +2179,19 @@ static int get_mouse_class(char_u *p)
return 2;
}
- /*
- * There are a few special cases where we want certain combinations of
- * characters to be considered as a single word. These are things like
- * "->", "/ *", "*=", "+=", "&=", "<=", ">=", "!=" etc. Otherwise, each
- * character is in its own class.
- */
+ // There are a few special cases where we want certain combinations of
+ // characters to be considered as a single word. These are things like
+ // "->", "/ *", "*=", "+=", "&=", "<=", ">=", "!=" etc. Otherwise, each
+ // character is in its own class.
if (c != NUL && vim_strchr((char_u *)"-+*/%<>&|^!=", c) != NULL) {
return 1;
}
return c;
}
-/*
- * End Visual mode.
- * This function should ALWAYS be called to end Visual mode, except from
- * do_pending_operator().
- */
+/// End Visual mode.
+/// This function should ALWAYS be called to end Visual mode, except from
+/// do_pending_operator().
void end_visual_mode(void)
{
VIsual_active = false;
@@ -2302,9 +2214,7 @@ void end_visual_mode(void)
may_trigger_modechanged();
}
-/*
- * Reset VIsual_active and VIsual_reselect.
- */
+/// Reset VIsual_active and VIsual_reselect.
void reset_VIsual_and_resel(void)
{
if (VIsual_active) {
@@ -2314,9 +2224,7 @@ void reset_VIsual_and_resel(void)
VIsual_reselect = false;
}
-/*
- * Reset VIsual_active and VIsual_reselect if it's set.
- */
+/// Reset VIsual_active and VIsual_reselect if it's set.
void reset_VIsual(void)
{
if (VIsual_active) {
@@ -2499,19 +2407,15 @@ size_t find_ident_at_pos(win_T *wp, linenr_T lnum, colnr_T startcol, char_u **te
return (size_t)col;
}
-/*
- * Prepare for redo of a normal command.
- */
+/// Prepare for redo of a normal command.
static void prep_redo_cmd(cmdarg_T *cap)
{
prep_redo(cap->oap->regname, cap->count0,
NUL, cap->cmdchar, NUL, NUL, cap->nchar);
}
-/*
- * Prepare for redo of any command.
- * Note that only the last argument can be a multi-byte char.
- */
+/// Prepare for redo of any command.
+/// Note that only the last argument can be a multi-byte char.
void prep_redo(int regname, long num, int cmd1, int cmd2, int cmd3, int cmd4, int cmd5)
{
ResetRedobuff();
@@ -2540,11 +2444,9 @@ void prep_redo(int regname, long num, int cmd1, int cmd2, int cmd3, int cmd4, in
}
}
-/*
- * check for operator active and clear it
- *
- * return true if operator was active
- */
+/// check for operator active and clear it
+///
+/// @return true if operator was active
static bool checkclearop(oparg_T *oap)
{
if (oap->op_type == OP_NOP) {
@@ -2554,11 +2456,9 @@ static bool checkclearop(oparg_T *oap)
return true;
}
-/*
- * Check for operator or Visual active. Clear active operator.
- *
- * Return true if operator or Visual was active.
- */
+/// Check for operator or Visual active. Clear active operator.
+///
+/// @return true if operator or Visual was active.
static bool checkclearopq(oparg_T *oap)
{
if (oap->op_type == OP_NOP
@@ -2584,9 +2484,7 @@ void clearopbeep(oparg_T *oap)
beep_flush();
}
-/*
- * Remove the shift modifier from a special key.
- */
+/// Remove the shift modifier from a special key.
static void unshift_special(cmdarg_T *cap)
{
switch (cap->cmdchar) {
@@ -2681,12 +2579,12 @@ void clear_showcmd(void)
while ((*p_sel != 'e') ? s <= e : s < e) {
l = utfc_ptr2len(s);
if (l == 0) {
- ++bytes;
- ++chars;
+ bytes++;
+ chars++;
break; // end of line
}
bytes += l;
- ++chars;
+ chars++;
s += l;
}
if (bytes == chars) {
@@ -2711,16 +2609,14 @@ void clear_showcmd(void)
display_showcmd();
}
-/*
- * Add 'c' to string of shown command chars.
- * Return true if output has been written (and setcursor() has been called).
- */
+/// Add 'c' to string of shown command chars.
+///
+/// @return true if output has been written (and setcursor() has been called).
bool add_to_showcmd(int c)
{
char_u *p;
int i;
- static int ignore[] =
- {
+ static int ignore[] = {
K_IGNORE,
K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE, K_MOUSEMOVE,
K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE,
@@ -2742,7 +2638,7 @@ bool add_to_showcmd(int c)
// Ignore keys that are scrollbar updates and mouse clicks
if (IS_SPECIAL(c)) {
- for (i = 0; ignore[i] != 0; ++i) {
+ for (i = 0; ignore[i] != 0; i++) {
if (ignore[i] == c) {
return false;
}
@@ -2777,9 +2673,7 @@ void add_to_showcmd_c(int c)
setcursor();
}
-/*
- * Delete 'len' characters from the end of the shown command.
- */
+/// Delete 'len' characters from the end of the shown command.
static void del_from_showcmd(int len)
{
int old_len;
@@ -2799,10 +2693,8 @@ static void del_from_showcmd(int len)
}
}
-/*
- * push_showcmd() and pop_showcmd() are used when waiting for the user to type
- * something and there is a partial mapping.
- */
+/// push_showcmd() and pop_showcmd() are used when waiting for the user to type
+/// something and there is a partial mapping.
void push_showcmd(void)
{
if (p_sc) {
@@ -2856,11 +2748,9 @@ static void display_showcmd(void)
grid_puts_line_flush(false);
}
-/*
- * When "check" is false, prepare for commands that scroll the window.
- * When "check" is true, take care of scroll-binding after the window has
- * scrolled. Called from normal_cmd() and edit().
- */
+/// When "check" is false, prepare for commands that scroll the window.
+/// When "check" is true, take care of scroll-binding after the window has
+/// scrolled. Called from normal_cmd() and edit().
void do_check_scrollbind(bool check)
{
static win_T *old_curwin = NULL;
@@ -2875,11 +2765,9 @@ void do_check_scrollbind(bool check)
if (did_syncbind) {
did_syncbind = false;
} else if (curwin == old_curwin) {
- /*
- * Synchronize other windows, as necessary according to
- * 'scrollbind'. Don't do this after an ":edit" command, except
- * when 'diff' is set.
- */
+ // Synchronize other windows, as necessary according to
+ // 'scrollbind'. Don't do this after an ":edit" command, except
+ // when 'diff' is set.
if ((curwin->w_buffer == old_buf
|| curwin->w_p_diff
)
@@ -2890,16 +2778,14 @@ void do_check_scrollbind(bool check)
(long)(curwin->w_leftcol - old_leftcol));
}
} else if (vim_strchr(p_sbo, 'j')) { // jump flag set in 'scrollopt'
- /*
- * When switching between windows, make sure that the relative
- * vertical offset is valid for the new window. The relative
- * offset is invalid whenever another 'scrollbind' window has
- * scrolled to a point that would force the current window to
- * scroll past the beginning or end of its buffer. When the
- * resync is performed, some of the other 'scrollbind' windows may
- * need to jump so that the current window's relative position is
- * visible on-screen.
- */
+ // When switching between windows, make sure that the relative
+ // vertical offset is valid for the new window. The relative
+ // offset is invalid whenever another 'scrollbind' window has
+ // scrolled to a point that would force the current window to
+ // scroll past the beginning or end of its buffer. When the
+ // resync is performed, some of the other 'scrollbind' windows may
+ // need to jump so that the current window's relative position is
+ // visible on-screen.
check_scrollbind(curwin->w_topline - curwin->w_scbind_pos, 0L);
}
curwin->w_scbind_pos = curwin->w_topline;
@@ -2912,11 +2798,9 @@ void do_check_scrollbind(bool check)
old_leftcol = curwin->w_leftcol;
}
-/*
- * Synchronize any windows that have "scrollbind" set, based on the
- * number of rows by which the current window has changed
- * (1998-11-02 16:21:01 R. Edward Ralston <eralston@computer.org>)
- */
+/// Synchronize any windows that have "scrollbind" set, based on the
+/// number of rows by which the current window has changed
+/// (1998-11-02 16:21:01 R. Edward Ralston <eralston@computer.org>)
void check_scrollbind(linenr_T topline_diff, long leftcol_diff)
{
bool want_ver;
@@ -2929,16 +2813,12 @@ void check_scrollbind(linenr_T topline_diff, long leftcol_diff)
long topline;
long y;
- /*
- * check 'scrollopt' string for vertical and horizontal scroll options
- */
+ // check 'scrollopt' string for vertical and horizontal scroll options
want_ver = (vim_strchr(p_sbo, 'v') && topline_diff != 0);
want_ver |= old_curwin->w_p_diff;
want_hor = (vim_strchr(p_sbo, 'h') && (leftcol_diff || topline_diff != 0));
- /*
- * loop through the scrollbound windows and scroll accordingly
- */
+ // loop through the scrollbound windows and scroll accordingly
VIsual_select = VIsual_active = 0;
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
curwin = wp;
@@ -2947,9 +2827,7 @@ void check_scrollbind(linenr_T topline_diff, long leftcol_diff)
if (curwin == old_curwin || !curwin->w_p_scb) {
continue;
}
- /*
- * do the vertical scroll
- */
+ // do the vertical scroll
if (want_ver) {
if (old_curwin->w_p_diff && curwin->w_p_diff) {
diff_set_topline(old_curwin, curwin);
@@ -2976,53 +2854,41 @@ void check_scrollbind(linenr_T topline_diff, long leftcol_diff)
curwin->w_redr_status = true;
}
- /*
- * do the horizontal scroll
- */
+ // do the horizontal scroll
if (want_hor && curwin->w_leftcol != tgt_leftcol) {
curwin->w_leftcol = tgt_leftcol;
leftcol_changed();
}
}
- /*
- * reset current-window
- */
+ // reset current-window
VIsual_select = old_VIsual_select;
VIsual_active = old_VIsual_active;
curwin = old_curwin;
curbuf = old_curbuf;
}
-/*
- * Command character that's ignored.
- * Used for CTRL-Q and CTRL-S to avoid problems with terminals that use
- * xon/xoff.
- */
+/// Command character that's ignored.
+/// Used for CTRL-Q and CTRL-S to avoid problems with terminals that use
+/// xon/xoff.
static void nv_ignore(cmdarg_T *cap)
{
cap->retval |= CA_COMMAND_BUSY; // don't call edit() now
}
-/*
- * Command character that doesn't do anything, but unlike nv_ignore() does
- * start edit(). Used for "startinsert" executed while starting up.
- */
+/// Command character that doesn't do anything, but unlike nv_ignore() does
+/// start edit(). Used for "startinsert" executed while starting up.
static void nv_nop(cmdarg_T *cap)
{
}
-/*
- * Command character doesn't exist.
- */
+/// Command character doesn't exist.
static void nv_error(cmdarg_T *cap)
{
clearopbeep(cap->oap);
}
-/*
- * <Help> and <F1> commands.
- */
+/// <Help> and <F1> commands.
static void nv_help(cmdarg_T *cap)
{
if (!checkclearopq(cap->oap)) {
@@ -3030,9 +2896,7 @@ static void nv_help(cmdarg_T *cap)
}
}
-/*
- * CTRL-A and CTRL-X: Add or subtract from letter or number under cursor.
- */
+/// CTRL-A and CTRL-X: Add or subtract from letter or number under cursor.
static void nv_addsub(cmdarg_T *cap)
{
if (bt_prompt(curbuf) && !prompt_curpos_editable()) {
@@ -3049,9 +2913,7 @@ static void nv_addsub(cmdarg_T *cap)
}
}
-/*
- * CTRL-F, CTRL-B, etc: Scroll page up or down.
- */
+/// CTRL-F, CTRL-B, etc: Scroll page up or down.
static void nv_page(cmdarg_T *cap)
{
if (!checkclearop(cap->oap)) {
@@ -3089,8 +2951,8 @@ static void nv_gd(oparg_T *oap, int nchar, int thisblock)
}
}
-// Return true if line[offset] is not inside a C-style comment or string, false
-// otherwise.
+/// @return true if line[offset] is not inside a C-style comment or string,
+/// false otherwise.
static bool is_ident(char_u *line, int offset)
{
bool incomment = false;
@@ -3156,11 +3018,9 @@ bool find_decl(char_u *ptr, size_t len, bool locally, bool thisblock, int flags_
p_ws = false; // don't wrap around end of file now
p_scs = false; // don't switch ignorecase off now
- /*
- * With "gD" go to line 1.
- * With "gd" Search back for the start of the current function, then go
- * back until a blank line. If this fails go to line 1.
- */
+ // With "gD" go to line 1.
+ // With "gd" Search back for the start of the current function, then go
+ // back until a blank line. If this fails go to line 1.
if (!locally || !findpar(&incll, BACKWARD, 1L, '{', false)) {
setpcmark(); // Set in findpar() otherwise
curwin->w_cursor.lnum = 1;
@@ -3169,7 +3029,7 @@ bool find_decl(char_u *ptr, size_t len, bool locally, bool thisblock, int flags_
par_pos = curwin->w_cursor;
while (curwin->w_cursor.lnum > 1
&& *skipwhite(get_cursor_line_ptr()) != NUL) {
- --curwin->w_cursor.lnum;
+ curwin->w_cursor.lnum--;
}
}
curwin->w_cursor.col = 0;
@@ -3207,7 +3067,7 @@ bool find_decl(char_u *ptr, size_t len, bool locally, bool thisblock, int flags_
}
if (get_leader_len(get_cursor_line_ptr(), NULL, false, true) > 0) {
// Ignore this line, continue at start of next line.
- ++curwin->w_cursor.lnum;
+ curwin->w_cursor.lnum++;
curwin->w_cursor.col = 0;
continue;
}
@@ -3259,13 +3119,11 @@ bool find_decl(char_u *ptr, size_t len, bool locally, bool thisblock, int flags_
return retval;
}
-/*
- * Move 'dist' lines in direction 'dir', counting lines by *screen*
- * lines rather than lines in the file.
- * 'dist' must be positive.
- *
- * Return true if able to move cursor, false otherwise.
- */
+/// Move 'dist' lines in direction 'dir', counting lines by *screen*
+/// lines rather than lines in the file.
+/// 'dist' must be positive.
+///
+/// @return true if able to move cursor, false otherwise.
static bool nv_screengo(oparg_T *oap, int dir, long dist)
{
int linelen = linetabsize(get_cursor_line_ptr());
@@ -3388,11 +3246,9 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
}
if (curwin->w_cursor.col > 0 && curwin->w_p_wrap) {
- /*
- * Check for landing on a character that got split at the end of the
- * last line. We want to advance a screenline, not end up in the same
- * screenline or move two screenlines.
- */
+ // Check for landing on a character that got split at the end of the
+ // last line. We want to advance a screenline, not end up in the same
+ // screenline or move two screenlines.
validate_virtcol();
colnr_T virtcol = curwin->w_virtcol;
if (virtcol > (colnr_T)width1 && *get_showbreak_value(curwin) != NUL) {
@@ -3411,7 +3267,7 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
? (curwin->w_curswant > (colnr_T)width1 / 2)
: ((curwin->w_curswant - width1) % width2
> (colnr_T)width2 / 2))) {
- --curwin->w_cursor.col;
+ curwin->w_cursor.col--;
}
}
@@ -3421,12 +3277,10 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
return retval;
}
-/*
- * Mouse scroll wheel: Default action is to scroll three lines, or one page
- * when Shift or Ctrl is used.
- * K_MOUSEUP (cap->arg == 1) or K_MOUSEDOWN (cap->arg == 0) or
- * K_MOUSELEFT (cap->arg == -1) or K_MOUSERIGHT (cap->arg == -2)
- */
+/// Mouse scroll wheel: Default action is to scroll three lines, or one page
+/// when Shift or Ctrl is used.
+/// K_MOUSEUP (cap->arg == 1) or K_MOUSEDOWN (cap->arg == 0) or
+/// K_MOUSELEFT (cap->arg == -1) or K_MOUSERIGHT (cap->arg == -2)
static void nv_mousescroll(cmdarg_T *cap)
{
win_T *old_curwin = curwin;
@@ -3468,18 +3322,14 @@ static void nv_mousescroll(cmdarg_T *cap)
curbuf = curwin->w_buffer;
}
-/*
- * Mouse clicks and drags.
- */
+/// Mouse clicks and drags.
static void nv_mouse(cmdarg_T *cap)
{
(void)do_mouse(cap->oap, cap->cmdchar, BACKWARD, cap->count1, 0);
}
-/*
- * Handle CTRL-E and CTRL-Y commands: scroll a line up or down.
- * cap->arg must be true for CTRL-E.
- */
+/// Handle CTRL-E and CTRL-Y commands: scroll a line up or down.
+/// cap->arg must be true for CTRL-E.
static void nv_scroll_line(cmdarg_T *cap)
{
if (!checkclearop(cap->oap)) {
@@ -3487,9 +3337,7 @@ static void nv_scroll_line(cmdarg_T *cap)
}
}
-/*
- * Scroll "count" lines up or down, and redraw.
- */
+/// Scroll "count" lines up or down, and redraw.
void scroll_redraw(int up, long count)
{
linenr_T prev_topline = curwin->w_topline;
@@ -3539,9 +3387,7 @@ void scroll_redraw(int up, long count)
redraw_later(curwin, VALID);
}
-/*
- * Commands that start with "z".
- */
+/// Commands that start with "z".
static void nv_zet(cmdarg_T *cap)
{
int n;
@@ -3554,9 +3400,7 @@ static void nv_zet(cmdarg_T *cap)
int l_p_siso = (int)get_sidescrolloff_value(curwin);
if (ascii_isdigit(nchar)) {
- /*
- * "z123{nchar}": edit the count before obtaining {nchar}
- */
+ // "z123{nchar}": edit the count before obtaining {nchar}
if (checkclearop(cap->oap)) {
return;
}
@@ -3600,10 +3444,8 @@ dozet:
return;
}
- /*
- * For "z+", "z<CR>", "zt", "z.", "zz", "z^", "z-", "zb":
- * If line number given, set cursor.
- */
+ // For "z+", "z<CR>", "zt", "z.", "zz", "z^", "z-", "zb":
+ // If line number given, set cursor.
if ((vim_strchr((char_u *)"+\r\nt.z^-b", nchar) != NULL)
&& cap->count0
&& cap->count0 != curwin->w_cursor.lnum) {
@@ -4026,9 +3868,7 @@ dozet:
}
-/*
- * "Q" command.
- */
+/// "Q" command.
static void nv_regreplay(cmdarg_T *cap)
{
if (checkclearop(cap->oap)) {
@@ -4106,9 +3946,7 @@ static void nv_colon(cmdarg_T *cap)
}
}
-/*
- * Handle CTRL-G command.
- */
+/// Handle CTRL-G command.
static void nv_ctrlg(cmdarg_T *cap)
{
if (VIsual_active) { // toggle Selection/Visual mode
@@ -4121,9 +3959,7 @@ static void nv_ctrlg(cmdarg_T *cap)
}
}
-/*
- * Handle CTRL-H <Backspace> command.
- */
+/// Handle CTRL-H <Backspace> command.
static void nv_ctrlh(cmdarg_T *cap)
{
if (VIsual_active && VIsual_select) {
@@ -4134,9 +3970,7 @@ static void nv_ctrlh(cmdarg_T *cap)
}
}
-/*
- * CTRL-L: clear screen and redraw.
- */
+/// CTRL-L: clear screen and redraw.
static void nv_clear(cmdarg_T *cap)
{
if (!checkclearop(cap->oap)) {
@@ -4149,10 +3983,8 @@ static void nv_clear(cmdarg_T *cap)
}
}
-/*
- * CTRL-O: In Select mode: switch to Visual mode for one command.
- * Otherwise: Go to older pcmark.
- */
+/// CTRL-O: In Select mode: switch to Visual mode for one command.
+/// Otherwise: Go to older pcmark.
static void nv_ctrlo(cmdarg_T *cap)
{
if (VIsual_active && VIsual_select) {
@@ -4176,9 +4008,7 @@ static void nv_hat(cmdarg_T *cap)
}
}
-/*
- * "Z" commands.
- */
+/// "Z" commands.
static void nv_Zet(cmdarg_T *cap)
{
if (!checkclearopq(cap->oap)) {
@@ -4199,9 +4029,7 @@ static void nv_Zet(cmdarg_T *cap)
}
}
-/*
- * Call nv_ident() as if "c1" was used, with "c2" as next character.
- */
+/// Call nv_ident() as if "c1" was used, with "c2" as next character.
void do_nv_ident(int c1, int c2)
{
oparg_T oa;
@@ -4215,14 +4043,12 @@ void do_nv_ident(int c1, int c2)
nv_ident(&ca);
}
-/*
- * Handle the commands that use the word under the cursor.
- * [g] CTRL-] :ta to current identifier
- * [g] 'K' run program for current identifier
- * [g] '*' / to current identifier or string
- * [g] '#' ? to current identifier or string
- * g ']' :tselect for current identifier
- */
+/// Handle the commands that use the word under the cursor.
+/// [g] CTRL-] :ta to current identifier
+/// [g] 'K' run program for current identifier
+/// [g] '*' / to current identifier or string
+/// [g] '#' ? to current identifier or string
+/// g ']' :tselect for current identifier
static void nv_ident(cmdarg_T *cap)
{
char_u *ptr = NULL;
@@ -4245,9 +4071,7 @@ static void nv_ident(cmdarg_T *cap)
cmdchar = '#';
}
- /*
- * The "]", "CTRL-]" and "K" commands accept an argument in Visual mode.
- */
+ // The "]", "CTRL-]" and "K" commands accept an argument in Visual mode.
if (cmdchar == ']' || cmdchar == Ctrl_RSB || cmdchar == 'K') {
if (VIsual_active && get_visual_text(cap, &ptr, &n) == false) {
return;
@@ -4284,12 +4108,10 @@ static void nv_ident(cmdarg_T *cap)
switch (cmdchar) {
case '*':
case '#':
- /*
- * Put cursor at start of word, makes search skip the word
- * under the cursor.
- * Call setpcmark() first, so "*``" puts the cursor back where
- * it was.
- */
+ // Put cursor at start of word, makes search skip the word
+ // under the cursor.
+ // Call setpcmark() first, so "*``" puts the cursor back where
+ // it was.
setpcmark();
curwin->w_cursor.col = (colnr_T)(ptr - get_cursor_line_ptr());
@@ -4312,8 +4134,8 @@ static void nv_ident(cmdarg_T *cap)
// An external command will probably use an argument starting
// with "-" as an option. To avoid trouble we skip the "-".
while (*ptr == '-' && n > 0) {
- ++ptr;
- --n;
+ ptr++;
+ n--;
}
if (n == 0) {
emsg(_(e_noident)); // found dashes only
@@ -4415,9 +4237,7 @@ static void nv_ident(cmdarg_T *cap)
*p = NUL;
}
- /*
- * Execute the command.
- */
+ // Execute the command.
if (cmdchar == '*' || cmdchar == '#') {
if (!g_cmd
&& vim_iswordp(mb_prevptr(get_cursor_line_ptr(), ptr))) {
@@ -4484,9 +4304,7 @@ bool get_visual_text(cmdarg_T *cap, char_u **pp, size_t *lenp)
return true;
}
-/*
- * CTRL-T: backwards in tag stack
- */
+/// CTRL-T: backwards in tag stack
static void nv_tagpop(cmdarg_T *cap)
{
if (!checkclearopq(cap->oap)) {
@@ -4494,9 +4312,7 @@ static void nv_tagpop(cmdarg_T *cap)
}
}
-/*
- * Handle scrolling command 'H', 'L' and 'M'.
- */
+/// Handle scrolling command 'H', 'L' and 'M'.
static void nv_scroll(cmdarg_T *cap)
{
int used = 0;
@@ -4516,10 +4332,10 @@ static void nv_scroll(cmdarg_T *cap)
if (hasAnyFolding(curwin)) {
// Count a fold for one screen line.
for (n = cap->count1 - 1; n > 0
- && curwin->w_cursor.lnum > curwin->w_topline; --n) {
+ && curwin->w_cursor.lnum > curwin->w_topline; n--) {
(void)hasFolding(curwin->w_cursor.lnum,
&curwin->w_cursor.lnum, NULL);
- --curwin->w_cursor.lnum;
+ curwin->w_cursor.lnum--;
}
} else {
curwin->w_cursor.lnum -= cap->count1 - 1;
@@ -4575,9 +4391,7 @@ static void nv_scroll(cmdarg_T *cap)
beginline(BL_SOL | BL_FIX);
}
-/*
- * Cursor right commands.
- */
+/// Cursor right commands.
static void nv_right(cmdarg_T *cap)
{
long n;
@@ -4596,15 +4410,13 @@ static void nv_right(cmdarg_T *cap)
cap->oap->inclusive = false;
PAST_LINE = (VIsual_active && *p_sel != 'o');
- /*
- * In virtual mode, there's no such thing as "PAST_LINE", as lines are
- * (theoretically) infinitely long.
- */
+ // In virtual mode, there's no such thing as "PAST_LINE", as lines are
+ // (theoretically) infinitely long.
if (virtual_active()) {
PAST_LINE = 0;
}
- for (n = cap->count1; n > 0; --n) {
+ for (n = cap->count1; n > 0; n--) {
if ((!PAST_LINE && oneright() == false)
|| (PAST_LINE
&& *get_cursor_pos_ptr() == NUL)) {
@@ -4623,7 +4435,7 @@ static void nv_right(cmdarg_T *cap)
&& !LINEEMPTY(curwin->w_cursor.lnum)) {
cap->oap->inclusive = true;
} else {
- ++curwin->w_cursor.lnum;
+ curwin->w_cursor.lnum++;
curwin->w_cursor.col = 0;
curwin->w_cursor.coladd = 0;
curwin->w_set_curswant = true;
@@ -4657,11 +4469,9 @@ static void nv_right(cmdarg_T *cap)
}
}
-/*
- * Cursor left commands.
- *
- * Returns true when operator end should not be adjusted.
- */
+/// Cursor left commands.
+///
+/// @return true when operator end should not be adjusted.
static void nv_left(cmdarg_T *cap)
{
long n;
@@ -4677,7 +4487,7 @@ static void nv_left(cmdarg_T *cap)
cap->oap->motion_type = kMTCharWise;
cap->oap->inclusive = false;
- for (n = cap->count1; n > 0; --n) {
+ for (n = cap->count1; n > 0; n--) {
if (oneleft() == false) {
// <BS> and <Del> wrap to previous line if 'whichwrap' has 'b'.
// 'h' wraps to previous line if 'whichwrap' has 'h'.
@@ -4705,9 +4515,8 @@ static void nv_left(cmdarg_T *cap)
cap->retval |= CA_NO_ADJ_OP_END;
}
continue;
- }
- // Only beep and flush if not moved at all
- else if (cap->oap->op_type == OP_NOP && n == cap->count1) {
+ } else if (cap->oap->op_type == OP_NOP && n == cap->count1) {
+ // Only beep and flush if not moved at all
beep_flush();
}
break;
@@ -4719,10 +4528,8 @@ static void nv_left(cmdarg_T *cap)
}
}
-/*
- * Cursor up commands.
- * cap->arg is true for "-": Move cursor to first non-blank.
- */
+/// Cursor up commands.
+/// cap->arg is true for "-": Move cursor to first non-blank.
static void nv_up(cmdarg_T *cap)
{
if (mod_mask & MOD_MASK_SHIFT) {
@@ -4739,10 +4546,8 @@ static void nv_up(cmdarg_T *cap)
}
}
-/*
- * Cursor down commands.
- * cap->arg is true for CR and "+": Move cursor to first non-blank.
- */
+/// Cursor down commands.
+/// cap->arg is true for CR and "+": Move cursor to first non-blank.
static void nv_down(cmdarg_T *cap)
{
if (mod_mask & MOD_MASK_SHIFT) {
@@ -4774,9 +4579,7 @@ static void nv_down(cmdarg_T *cap)
}
}
-/*
- * Grab the file name under the cursor and edit it.
- */
+/// Grab the file name under the cursor and edit it.
static void nv_gotofile(cmdarg_T *cap)
{
char_u *ptr;
@@ -4813,9 +4616,7 @@ static void nv_gotofile(cmdarg_T *cap)
}
}
-/*
- * <End> command: to end of current line or last line.
- */
+/// <End> command: to end of current line or last line.
static void nv_end(cmdarg_T *cap)
{
if (cap->arg || (mod_mask & MOD_MASK_CTRL)) { // CTRL-END = goto last line
@@ -4826,9 +4627,7 @@ static void nv_end(cmdarg_T *cap)
nv_dollar(cap);
}
-/*
- * Handle the "$" command.
- */
+/// Handle the "$" command.
static void nv_dollar(cmdarg_T *cap)
{
cap->oap->motion_type = kMTCharWise;
@@ -4848,10 +4647,8 @@ static void nv_dollar(cmdarg_T *cap)
}
}
-/*
- * Implementation of '?' and '/' commands.
- * If cap->arg is true don't set PC mark.
- */
+/// Implementation of '?' and '/' commands.
+/// If cap->arg is true don't set PC mark.
static void nv_search(cmdarg_T *cap)
{
oparg_T *oap = cap->oap;
@@ -4879,10 +4676,8 @@ static void nv_search(cmdarg_T *cap)
? 0 : SEARCH_MARK, NULL);
}
-/*
- * Handle "N" and "n" commands.
- * cap->arg is SEARCH_REV for "N", 0 for "n".
- */
+/// Handle "N" and "n" commands.
+/// cap->arg is SEARCH_REV for "N", 0 for "n".
static void nv_next(cmdarg_T *cap)
{
pos_T old = curwin->w_cursor;
@@ -4939,12 +4734,10 @@ static int normal_search(cmdarg_T *cap, int dir, char_u *pat, int opt, int *wrap
return i;
}
-/*
- * Character search commands.
- * cap->arg is BACKWARD for 'F' and 'T', FORWARD for 'f' and 't', true for
- * ',' and false for ';'.
- * cap->nchar is NUL for ',' and ';' (repeat the search)
- */
+/// Character search commands.
+/// cap->arg is BACKWARD for 'F' and 'T', FORWARD for 'f' and 't', true for
+/// ',' and false for ';'.
+/// cap->nchar is NUL for ',' and ';' (repeat the search)
static void nv_csearch(cmdarg_T *cap)
{
bool t_cmd;
@@ -4977,10 +4770,8 @@ static void nv_csearch(cmdarg_T *cap)
}
}
-/*
- * "[" and "]" commands.
- * cap->arg is BACKWARD for "[" and FORWARD for "]".
- */
+/// "[" and "]" commands.
+/// cap->arg is BACKWARD for "[" and FORWARD for "]".
static void nv_brackets(cmdarg_T *cap)
{
pos_T new_pos = { 0, 0, 0 };
@@ -4995,24 +4786,19 @@ static void nv_brackets(cmdarg_T *cap)
cap->oap->motion_type = kMTCharWise;
cap->oap->inclusive = false;
old_pos = curwin->w_cursor;
- curwin->w_cursor.coladd = 0; // TODO: don't do this for an error.
+ curwin->w_cursor.coladd = 0; // TODO(Unknown): don't do this for an error.
- /*
- * "[f" or "]f" : Edit file under the cursor (same as "gf")
- */
+ // "[f" or "]f" : Edit file under the cursor (same as "gf")
if (cap->nchar == 'f') {
nv_gotofile(cap);
- } else
- /*
- * Find the occurrence(s) of the identifier or define under cursor
- * in current and included files or jump to the first occurrence.
- *
- * search list jump
- * fwd bwd fwd bwd fwd bwd
- * identifier "]i" "[i" "]I" "[I" "]^I" "[^I"
- * define "]d" "[d" "]D" "[D" "]^D" "[^D"
- */
- if (vim_strchr((char_u *)"iI\011dD\004", cap->nchar) != NULL) {
+ } else if (vim_strchr((char_u *)"iI\011dD\004", cap->nchar) != NULL) {
+ // Find the occurrence(s) of the identifier or define under cursor
+ // in current and included files or jump to the first occurrence.
+ //
+ // search list jump
+ // fwd bwd fwd bwd fwd bwd
+ // identifier "]i" "[i" "]I" "[I" "]^I" "[^I"
+ // define "]d" "[d" "]D" "[D" "]^D" "[^D"
char_u *ptr;
size_t len;
@@ -5034,18 +4820,13 @@ static void nv_brackets(cmdarg_T *cap)
MAXLNUM);
curwin->w_set_curswant = true;
}
- } else
- /*
- * "[{", "[(", "]}" or "])": go to Nth unclosed '{', '(', '}' or ')'
- * "[#", "]#": go to start/end of Nth innermost #if..#endif construct.
- * "[/", "[*", "]/", "]*": go to Nth comment start/end.
- * "[m" or "]m" search for prev/next start of (Java) method.
- * "[M" or "]M" search for prev/next end of (Java) method.
- */
- if ((cap->cmdchar == '['
- && vim_strchr((char_u *)"{(*/#mM", cap->nchar) != NULL)
- || (cap->cmdchar == ']'
- && vim_strchr((char_u *)"})*/#mM", cap->nchar) != NULL)) {
+ } else if ((cap->cmdchar == '[' && vim_strchr((char_u *)"{(*/#mM", cap->nchar) != NULL)
+ || (cap->cmdchar == ']' && vim_strchr((char_u *)"})*/#mM", cap->nchar) != NULL)) {
+ // "[{", "[(", "]}" or "])": go to Nth unclosed '{', '(', '}' or ')'
+ // "[#", "]#": go to start/end of Nth innermost #if..#endif construct.
+ // "[/", "[*", "]/", "]*": go to Nth comment start/end.
+ // "[m" or "]m" search for prev/next start of (Java) method.
+ // "[M" or "]M" search for prev/next end of (Java) method.
if (cap->nchar == '*') {
cap->nchar = '/';
}
@@ -5061,7 +4842,7 @@ static void nv_brackets(cmdarg_T *cap)
findc = cap->nchar;
n = cap->count1;
}
- for (; n > 0; --n) {
+ for (; n > 0; n--) {
if ((pos = findmatchlimit(cap->oap, findc,
(cap->cmdchar == '[') ? FM_BACKWARD : FM_FORWARD, 0)) == NULL) {
if (new_pos.lnum == 0) { // nothing found
@@ -5079,12 +4860,10 @@ static void nv_brackets(cmdarg_T *cap)
}
curwin->w_cursor = old_pos;
- /*
- * Handle "[m", "]m", "[M" and "[M". The findmatchlimit() only
- * brought us to the match for "[m" and "]M" when inside a method.
- * Try finding the '{' or '}' we want to be at.
- * Also repeat for the given count.
- */
+ // Handle "[m", "]m", "[M" and "[M". The findmatchlimit() only
+ // brought us to the match for "[m" and "]M" when inside a method.
+ // Try finding the '{' or '}' we want to be at.
+ // Also repeat for the given count.
if (cap->nchar == 'm' || cap->nchar == 'M') {
// norm is true for "]M" and "[m"
int norm = ((findc == '{') == (cap->nchar == 'm'));
@@ -5095,7 +4874,7 @@ static void nv_brackets(cmdarg_T *cap)
pos = &prev_pos;
curwin->w_cursor = prev_pos;
if (norm) {
- --n;
+ n--;
}
} else {
pos = NULL;
@@ -5123,11 +4902,10 @@ static void nv_brackets(cmdarg_T *cap)
// class and we're inside now. Just go on.
new_pos = curwin->w_cursor;
pos = &new_pos;
- }
- // found start/end of other method: go to match
- else if ((pos = findmatchlimit(cap->oap, findc,
- (cap->cmdchar == '[') ? FM_BACKWARD : FM_FORWARD,
- 0)) == NULL) {
+ } else if ((pos = findmatchlimit(cap->oap, findc,
+ (cap->cmdchar == '[') ? FM_BACKWARD : FM_FORWARD,
+ 0)) == NULL) {
+ // found start/end of other method: go to match
n = 0;
} else {
curwin->w_cursor = *pos;
@@ -5135,7 +4913,7 @@ static void nv_brackets(cmdarg_T *cap)
break;
}
}
- --n;
+ n--;
}
curwin->w_cursor = old_pos;
if (pos == NULL && new_pos.lnum != 0) {
@@ -5151,21 +4929,15 @@ static void nv_brackets(cmdarg_T *cap)
foldOpenCursor();
}
}
- }
- /*
- * "[[", "[]", "]]" and "][": move to start or end of function
- */
- else if (cap->nchar == '[' || cap->nchar == ']') {
+ } else if (cap->nchar == '[' || cap->nchar == ']') {
+ // "[[", "[]", "]]" and "][": move to start or end of function
if (cap->nchar == cap->cmdchar) { // "]]" or "[["
flag = '{';
} else {
flag = '}'; // "][" or "[]"
}
curwin->w_set_curswant = true;
- /*
- * Imitate strange Vi behaviour: When using "]]" with an operator
- * we also stop at '}'.
- */
+ // Imitate strange Vi behaviour: When using "]]" with an operator we also stop at '}'.
if (!findpar(&cap->oap->inclusive, cap->arg, cap->count1, flag,
(cap->oap->op_type != OP_NOP
&& cap->arg == FORWARD && flag == '{'))) {
@@ -5181,13 +4953,10 @@ static void nv_brackets(cmdarg_T *cap)
} else if (cap->nchar == 'p' || cap->nchar == 'P') {
// "[p", "[P", "]P" and "]p": put with indent adjustment
nv_put_opt(cap, true);
- }
- /*
- * "['", "[`", "]'" and "]`": jump to next mark
- */
- else if (cap->nchar == '\'' || cap->nchar == '`') {
+ } else if (cap->nchar == '\'' || cap->nchar == '`') {
+ // "['", "[`", "]'" and "]`": jump to next mark
pos = &curwin->w_cursor;
- for (n = cap->count1; n > 0; --n) {
+ for (n = cap->count1; n > 0; n--) {
prev_pos = *pos;
pos = getnextmark(pos, cap->cmdchar == '[' ? BACKWARD : FORWARD,
cap->nchar == '\'');
@@ -5199,40 +4968,28 @@ static void nv_brackets(cmdarg_T *cap)
pos = &prev_pos;
}
nv_cursormark(cap, cap->nchar == '\'', pos);
- }
- /*
- * [ or ] followed by a middle mouse click: put selected text with
- * indent adjustment. Any other button just does as usual.
- */
- else if (cap->nchar >= K_RIGHTRELEASE && cap->nchar <= K_LEFTMOUSE) {
+ } else if (cap->nchar >= K_RIGHTRELEASE && cap->nchar <= K_LEFTMOUSE) {
+ // [ or ] followed by a middle mouse click: put selected text with
+ // indent adjustment. Any other button just does as usual.
(void)do_mouse(cap->oap, cap->nchar,
(cap->cmdchar == ']') ? FORWARD : BACKWARD,
cap->count1, PUT_FIXINDENT);
- }
- /*
- * "[z" and "]z": move to start or end of open fold.
- */
- else if (cap->nchar == 'z') {
+ } else if (cap->nchar == 'z') {
+ // "[z" and "]z": move to start or end of open fold.
if (foldMoveTo(false, cap->cmdchar == ']' ? FORWARD : BACKWARD,
cap->count1) == false) {
clearopbeep(cap->oap);
}
- }
- /*
- * "[c" and "]c": move to next or previous diff-change.
- */
- else if (cap->nchar == 'c') {
+ } else if (cap->nchar == 'c') {
+ // "[c" and "]c": move to next or previous diff-change.
if (diff_move_to(cap->cmdchar == ']' ? FORWARD : BACKWARD,
cap->count1) == false) {
clearopbeep(cap->oap);
}
- }
- /*
- * "[s", "[S", "]s" and "]S": move to next spell error.
- */
- else if (cap->nchar == 's' || cap->nchar == 'S') {
+ } else if (cap->nchar == 's' || cap->nchar == 'S') {
+ // "[s", "[S", "]s" and "]S": move to next spell error.
setpcmark();
- for (n = 0; n < cap->count1; ++n) {
+ for (n = 0; n < cap->count1; n++) {
if (spell_move_to(curwin, cap->cmdchar == ']' ? FORWARD : BACKWARD,
cap->nchar == 's', false, NULL) == 0) {
clearopbeep(cap->oap);
@@ -5244,16 +5001,13 @@ static void nv_brackets(cmdarg_T *cap)
if (cap->oap->op_type == OP_NOP && (fdo_flags & FDO_SEARCH) && KeyTyped) {
foldOpenCursor();
}
- }
- // Not a valid cap->nchar.
- else {
+ } else {
+ // Not a valid cap->nchar.
clearopbeep(cap->oap);
}
}
-/*
- * Handle Normal mode "%" command.
- */
+/// Handle Normal mode "%" command.
static void nv_percent(cmdarg_T *cap)
{
pos_T *pos;
@@ -5306,10 +5060,8 @@ static void nv_percent(cmdarg_T *cap)
}
}
-/*
- * Handle "(" and ")" commands.
- * cap->arg is BACKWARD for "(" and FORWARD for ")".
- */
+/// Handle "(" and ")" commands.
+/// cap->arg is BACKWARD for "(" and FORWARD for ")".
static void nv_brace(cmdarg_T *cap)
{
cap->oap->motion_type = kMTCharWise;
@@ -5330,9 +5082,7 @@ static void nv_brace(cmdarg_T *cap)
}
}
-/*
- * "m" command: Mark a position.
- */
+/// "m" command: Mark a position.
static void nv_mark(cmdarg_T *cap)
{
if (!checkclearop(cap->oap)) {
@@ -5342,10 +5092,8 @@ static void nv_mark(cmdarg_T *cap)
}
}
-/*
- * "{" and "}" commands.
- * cmd->arg is BACKWARD for "{" and FORWARD for "}".
- */
+/// "{" and "}" commands.
+/// cmd->arg is BACKWARD for "{" and FORWARD for "}".
static void nv_findpar(cmdarg_T *cap)
{
cap->oap->motion_type = kMTCharWise;
@@ -5362,9 +5110,7 @@ static void nv_findpar(cmdarg_T *cap)
}
}
-/*
- * "u" command: Undo or make lower case.
- */
+/// "u" command: Undo or make lower case.
static void nv_undo(cmdarg_T *cap)
{
if (cap->oap->op_type == OP_LOWER
@@ -5378,9 +5124,7 @@ static void nv_undo(cmdarg_T *cap)
}
}
-/*
- * <Undo> command.
- */
+/// <Undo> command.
static void nv_kundo(cmdarg_T *cap)
{
if (!checkclearopq(cap->oap)) {
@@ -5393,9 +5137,7 @@ static void nv_kundo(cmdarg_T *cap)
}
}
-/*
- * Handle the "r" command.
- */
+/// Handle the "r" command.
static void nv_replace(cmdarg_T *cap)
{
char_u *ptr;
@@ -5486,14 +5228,12 @@ static void nv_replace(cmdarg_T *cap)
}
if (had_ctrl_v != Ctrl_V && (cap->nchar == '\r' || cap->nchar == '\n')) {
- /*
- * Replace character(s) by a single newline.
- * Strange vi behaviour: Only one newline is inserted.
- * Delete the characters here.
- * Insert the newline with an insert command, takes care of
- * autoindent. The insert command depends on being on the last
- * character of a line or not.
- */
+ // Replace character(s) by a single newline.
+ // Strange vi behaviour: Only one newline is inserted.
+ // Delete the characters here.
+ // Insert the newline with an insert command, takes care of
+ // autoindent. The insert command depends on being on the last
+ // character of a line or not.
(void)del_chars(cap->count1, false); // delete the characters
stuffcharReadbuff('\r');
stuffcharReadbuff(ESC);
@@ -5551,10 +5291,8 @@ static void nv_replace(cmdarg_T *cap)
foldUpdateAfterInsert();
}
-/*
- * 'o': Exchange start and end of Visual area.
- * 'O': same, but in block mode exchange left and right corners.
- */
+/// 'o': Exchange start and end of Visual area.
+/// 'O': same, but in block mode exchange left and right corners.
static void v_swap_corners(int cmdchar)
{
pos_T old_cursor;
@@ -5572,7 +5310,7 @@ static void v_swap_corners(int cmdchar)
// 'selection "exclusive" and cursor at right-bottom corner: move it
// right one column
if (old_cursor.lnum >= VIsual.lnum && *p_sel == 'e') {
- ++curwin->w_curswant;
+ curwin->w_curswant++;
}
coladvance(curwin->w_curswant);
if (curwin->w_cursor.col == old_cursor.col
@@ -5581,7 +5319,7 @@ static void v_swap_corners(int cmdchar)
old_cursor.coladd)) {
curwin->w_cursor.lnum = VIsual.lnum;
if (old_cursor.lnum <= VIsual.lnum && *p_sel == 'e') {
- ++right;
+ right++;
}
coladvance(right);
VIsual = curwin->w_cursor;
@@ -5598,9 +5336,7 @@ static void v_swap_corners(int cmdchar)
}
}
-/*
- * "R" (cap->arg is false) and "gR" (cap->arg is true).
- */
+/// "R" (cap->arg is false) and "gR" (cap->arg is true).
static void nv_Replace(cmdarg_T *cap)
{
if (VIsual_active) { // "R" is replace lines
@@ -5621,9 +5357,7 @@ static void nv_Replace(cmdarg_T *cap)
}
}
-/*
- * "gr".
- */
+/// "gr".
static void nv_vreplace(cmdarg_T *cap)
{
if (VIsual_active) {
@@ -5647,9 +5381,7 @@ static void nv_vreplace(cmdarg_T *cap)
}
}
-/*
- * Swap case for "~" command, when it does not work like an operator.
- */
+/// Swap case for "~" command, when it does not work like an operator.
static void n_swapchar(cmdarg_T *cap)
{
long n;
@@ -5672,13 +5404,13 @@ static void n_swapchar(cmdarg_T *cap)
}
startpos = curwin->w_cursor;
- for (n = cap->count1; n > 0; --n) {
+ for (n = cap->count1; n > 0; n--) {
did_change |= swapchar(cap->oap->op_type, &curwin->w_cursor);
inc_cursor();
if (gchar_cursor() == NUL) {
if (vim_strchr(p_ww, '~') != NULL
&& curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) {
- ++curwin->w_cursor.lnum;
+ curwin->w_cursor.lnum++;
curwin->w_cursor.col = 0;
if (n > 1) {
if (u_savesub(curwin->w_cursor.lnum) == false) {
@@ -5701,14 +5433,12 @@ static void n_swapchar(cmdarg_T *cap)
curbuf->b_op_start = startpos;
curbuf->b_op_end = curwin->w_cursor;
if (curbuf->b_op_end.col > 0) {
- --curbuf->b_op_end.col;
+ curbuf->b_op_end.col--;
}
}
}
-/*
- * Move cursor to mark.
- */
+/// Move cursor to mark.
static void nv_cursormark(cmdarg_T *cap, int flag, pos_T *pos)
{
if (check_mark(pos) == false) {
@@ -5735,9 +5465,7 @@ static void nv_cursormark(cmdarg_T *cap, int flag, pos_T *pos)
curwin->w_set_curswant = true;
}
-/*
- * Handle commands that are operators in Visual mode.
- */
+/// Handle commands that are operators in Visual mode.
static void v_visop(cmdarg_T *cap)
{
static char_u trans[] = "YyDdCcxdXdAAIIrr";
@@ -5756,9 +5484,7 @@ static void v_visop(cmdarg_T *cap)
nv_operator(cap);
}
-/*
- * "s" and "S" commands.
- */
+/// "s" and "S" commands.
static void nv_subst(cmdarg_T *cap)
{
if (bt_prompt(curbuf) && !prompt_curpos_editable()) {
@@ -5777,9 +5503,7 @@ static void nv_subst(cmdarg_T *cap)
}
}
-/*
- * Abbreviated commands.
- */
+/// Abbreviated commands.
static void nv_abbrev(cmdarg_T *cap)
{
if (cap->cmdchar == K_DEL || cap->cmdchar == K_KDEL) {
@@ -5793,9 +5517,7 @@ static void nv_abbrev(cmdarg_T *cap)
}
}
-/*
- * Translate a command into another command.
- */
+/// Translate a command into another command.
static void nv_optrans(cmdarg_T *cap)
{
static const char *(ar[]) = { "dl", "dh", "d$", "c$", "cl", "cc", "yy",
@@ -5811,10 +5533,8 @@ static void nv_optrans(cmdarg_T *cap)
cap->opcount = 0;
}
-/*
- * "'" and "`" commands. Also for "g'" and "g`".
- * cap->arg is true for "'" and "g'".
- */
+/// "'" and "`" commands. Also for "g'" and "g`".
+/// cap->arg is true for "'" and "g'".
static void nv_gomark(cmdarg_T *cap)
{
pos_T *pos;
@@ -5897,9 +5617,7 @@ static void nv_pcmark(cmdarg_T *cap)
}
}
-/*
- * Handle '"' command.
- */
+/// Handle '"' command.
static void nv_regname(cmdarg_T *cap)
{
if (checkclearop(cap->oap)) {
@@ -5917,12 +5635,10 @@ static void nv_regname(cmdarg_T *cap)
}
}
-/*
- * Handle "v", "V" and "CTRL-V" commands.
- * Also for "gh", "gH" and "g^H" commands: Always start Select mode, cap->arg
- * is true.
- * Handle CTRL-Q just like CTRL-V.
- */
+/// Handle "v", "V" and "CTRL-V" commands.
+/// Also for "gh", "gH" and "g^H" commands: Always start Select mode, cap->arg
+/// is true.
+/// Handle CTRL-Q just like CTRL-V.
static void nv_visual(cmdarg_T *cap)
{
if (cap->cmdchar == Ctrl_Q) {
@@ -5963,10 +5679,8 @@ static void nv_visual(cmdarg_T *cap)
if (p_smd && msg_silent == 0) {
redraw_cmdline = true; // show visual mode later
}
- /*
- * For V and ^V, we multiply the number of lines even if there
- * was only one -- webb
- */
+ // For V and ^V, we multiply the number of lines even if there
+ // was only one -- webb
if (resel_VIsual_mode != 'v' || resel_VIsual_line_count > 1) {
curwin->w_cursor.lnum += resel_VIsual_line_count * cap->count0 - 1;
check_cursor();
@@ -6003,7 +5717,7 @@ static void nv_visual(cmdarg_T *cap)
}
n_start_visual_mode(cap->cmdchar);
if (VIsual_mode != 'V' && *p_sel == 'e') {
- ++cap->count1; // include one more char
+ cap->count1++; // include one more char
}
if (cap->count0 > 0 && --cap->count1 > 0) {
// With a count select that many characters or lines.
@@ -6017,9 +5731,7 @@ static void nv_visual(cmdarg_T *cap)
}
}
-/*
- * Start selection for Shift-movement keys.
- */
+/// Start selection for Shift-movement keys.
void start_selection(void)
{
// if 'selectmode' contains "key", start Select mode
@@ -6027,19 +5739,15 @@ void start_selection(void)
n_start_visual_mode('v');
}
-/*
- * Start Select mode, if "c" is in 'selectmode' and not in a mapping or menu.
- */
+/// Start Select mode, if "c" is in 'selectmode' and not in a mapping or menu.
+/// When "c" is 'o' (checking for "mouse") then also when mapped.
void may_start_select(int c)
{
- VIsual_select = (stuff_empty() && typebuf_typed()
- && (vim_strchr(p_slm, c) != NULL));
+ VIsual_select = (c == 'o' || (stuff_empty() && typebuf_typed())) && vim_strchr(p_slm, c) != NULL;
}
-/*
- * Start Visual mode "c".
- * Should set VIsual_select before calling this.
- */
+/// Start Visual mode "c".
+/// Should set VIsual_select before calling this.
static void n_start_visual_mode(int c)
{
VIsual_mode = c;
@@ -6073,9 +5781,7 @@ static void n_start_visual_mode(int c)
}
-/*
- * CTRL-W: Window commands
- */
+/// CTRL-W: Window commands
static void nv_window(cmdarg_T *cap)
{
if (cap->nchar == ':') {
@@ -6088,9 +5794,7 @@ static void nv_window(cmdarg_T *cap)
}
}
-/*
- * CTRL-Z: Suspend
- */
+/// CTRL-Z: Suspend
static void nv_suspend(cmdarg_T *cap)
{
clearop(cap->oap);
@@ -6100,9 +5804,7 @@ static void nv_suspend(cmdarg_T *cap)
do_cmdline_cmd("st");
}
-/*
- * Commands starting with "g".
- */
+/// Commands starting with "g".
static void nv_g_cmd(cmdarg_T *cap)
{
oparg_T *oap = cap->oap;
@@ -6138,10 +5840,8 @@ static void nv_g_cmd(cmdarg_T *cap)
do_cmdline_cmd("%s//~/&");
break;
- /*
- * "gv": Reselect the previous Visual area. If Visual already active,
- * exchange previous and current Visual area.
- */
+ // "gv": Reselect the previous Visual area. If Visual already active,
+ // exchange previous and current Visual area.
case 'v':
if (checkclearop(oap)) {
break;
@@ -6197,19 +5897,14 @@ static void nv_g_cmd(cmdarg_T *cap)
showmode();
}
break;
- /*
- * "gV": Don't reselect the previous Visual area after a Select mode
- * mapping of menu.
- */
+ // "gV": Don't reselect the previous Visual area after a Select mode mapping of menu.
case 'V':
VIsual_reselect = false;
break;
- /*
- * "gh": start Select mode.
- * "gH": start Select line mode.
- * "g^H": start Select block mode.
- */
+ // "gh": start Select mode.
+ // "gH": start Select line mode.
+ // "g^H": start Select block mode.
case K_BS:
cap->nchar = Ctrl_H;
FALLTHROUGH;
@@ -6231,10 +5926,8 @@ static void nv_g_cmd(cmdarg_T *cap)
}
break;
- /*
- * "gj" and "gk" two new funny movement keys -- up and down
- * movement based on *screen* line rather than *file* line.
- */
+ // "gj" and "gk" two new funny movement keys -- up and down
+ // movement based on *screen* line rather than *file* line.
case 'j':
case K_DOWN:
// with 'nowrap' it works just like the normal "j" command.
@@ -6263,17 +5956,13 @@ static void nv_g_cmd(cmdarg_T *cap)
}
break;
- /*
- * "gJ": join two lines without inserting a space.
- */
+ // "gJ": join two lines without inserting a space.
case 'J':
nv_join(cap);
break;
- /*
- * "g0", "g^" and "g$": Like "0", "^" and "$" but for screen lines.
- * "gm": middle of "g0" and "g$".
- */
+ // "g0", "g^" and "g$": Like "0", "^" and "$" but for screen lines.
+ // "gm": middle of "g0" and "g$".
case '^':
flag = true;
FALLTHROUGH;
@@ -6328,8 +6017,7 @@ static void nv_g_cmd(cmdarg_T *cap)
break;
case '_':
- /* "g_": to the last non-blank character in the line or <count> lines
- * downward. */
+ // "g_": to the last non-blank character in the line or <count> lines downward.
cap->oap->motion_type = kMTCharWise;
cap->oap->inclusive = true;
curwin->w_curswant = MAXCOL;
@@ -6341,13 +6029,13 @@ static void nv_g_cmd(cmdarg_T *cap)
// In Visual mode we may end up after the line.
if (curwin->w_cursor.col > 0 && ptr[curwin->w_cursor.col] == NUL) {
- --curwin->w_cursor.col;
+ curwin->w_cursor.col--;
}
// Decrease the cursor column until it's on a non-blank.
while (curwin->w_cursor.col > 0
&& ascii_iswhite(ptr[curwin->w_cursor.col])) {
- --curwin->w_cursor.col;
+ curwin->w_cursor.col--;
}
curwin->w_set_curswant = true;
adjust_for_sel(cap);
@@ -6381,13 +6069,11 @@ static void nv_g_cmd(cmdarg_T *cap)
curwin->w_curswant = curwin->w_virtcol;
curwin->w_set_curswant = false;
if (curwin->w_cursor.col > 0 && curwin->w_p_wrap) {
- /*
- * Check for landing on a character that got split at
- * the end of the line. We do not want to advance to
- * the next screen line.
- */
+ // Check for landing on a character that got split at
+ // the end of the line. We do not want to advance to
+ // the next screen line.
if (curwin->w_virtcol > (colnr_T)i) {
- --curwin->w_cursor.col;
+ curwin->w_cursor.col--;
}
}
} else if (nv_screengo(oap, FORWARD, cap->count1 - 1) == false) {
@@ -6409,9 +6095,7 @@ static void nv_g_cmd(cmdarg_T *cap)
}
break;
- /*
- * "g*" and "g#", like "*" and "#" but without using "\<" and "\>"
- */
+ // "g*" and "g#", like "*" and "#" but without using "\<" and "\>"
case '*':
case '#':
#if POUND != '#'
@@ -6422,9 +6106,7 @@ static void nv_g_cmd(cmdarg_T *cap)
nv_ident(cap);
break;
- /*
- * ge and gE: go back to end of word
- */
+ // ge and gE: go back to end of word
case 'e':
case 'E':
oap->motion_type = kMTCharWise;
@@ -6457,9 +6139,7 @@ static void nv_g_cmd(cmdarg_T *cap)
nv_edit(cap);
break;
- /*
- * "gI": Start insert in column 1.
- */
+ // "gI": Start insert in column 1.
case 'I':
beginline(0);
if (!checkclearopq(oap)) {
@@ -6467,10 +6147,8 @@ static void nv_g_cmd(cmdarg_T *cap)
}
break;
- /*
- * "gf": goto file, edit file under cursor
- * "]f" and "[f": can also be used.
- */
+ // "gf": goto file, edit file under cursor
+ // "]f" and "[f": can also be used.
case 'f':
case 'F':
nv_gotofile(cap);
@@ -6484,26 +6162,20 @@ static void nv_g_cmd(cmdarg_T *cap)
nv_gomark(cap);
break;
- /*
- * "gs": Goto sleep.
- */
+ // "gs": Goto sleep.
case 's':
do_sleep(cap->count1 * 1000L);
break;
- /*
- * "ga": Display the ascii value of the character under the
- * cursor. It is displayed in decimal, hex, and octal. -- webb
- */
+ // "ga": Display the ascii value of the character under the
+ // cursor. It is displayed in decimal, hex, and octal. -- webb
case 'a':
do_ascii(NULL);
break;
- /*
- * "g8": Display the bytes used for the UTF-8 character under the
- * cursor. It is displayed in hex.
- * "8g8" finds illegal byte sequence.
- */
+ // "g8": Display the bytes used for the UTF-8 character under the
+ // cursor. It is displayed in hex.
+ // "8g8" finds illegal byte sequence.
case '8':
if (cap->count0 == 8) {
utf_find_illegal();
@@ -6516,25 +6188,21 @@ static void nv_g_cmd(cmdarg_T *cap)
show_sb_text();
break;
- /*
- * "gg": Goto the first line in file. With a count it goes to
- * that line number like for "G". -- webb
- */
+ // "gg": Goto the first line in file. With a count it goes to
+ // that line number like for "G". -- webb
case 'g':
cap->arg = false;
nv_goto(cap);
break;
- /*
- * Two-character operators:
- * "gq" Format text
- * "gw" Format text and keep cursor position
- * "g~" Toggle the case of the text.
- * "gu" Change text to lower case.
- * "gU" Change text to upper case.
- * "g?" rot13 encoding
- * "g@" call 'operatorfunc'
- */
+ // Two-character operators:
+ // "gq" Format text
+ // "gw" Format text and keep cursor position
+ // "g~" Toggle the case of the text.
+ // "gu" Change text to lower case.
+ // "gU" Change text to upper case.
+ // "g?" rot13 encoding
+ // "g@" call 'operatorfunc'
case 'q':
case 'w':
oap->cursor_start = curwin->w_cursor;
@@ -6547,19 +6215,14 @@ static void nv_g_cmd(cmdarg_T *cap)
nv_operator(cap);
break;
- /*
- * "gd": Find first occurrence of pattern under the cursor in the
- * current function
- * "gD": idem, but in the current file.
- */
+ // "gd": Find first occurrence of pattern under the cursor in the current function
+ // "gD": idem, but in the current file.
case 'd':
case 'D':
nv_gd(oap, cap->nchar, (int)cap->count0);
break;
- /*
- * g<*Mouse> : <C-*mouse>
- */
+ // g<*Mouse> : <C-*mouse>
case K_MIDDLEMOUSE:
case K_MIDDLEDRAG:
case K_MIDDLERELEASE:
@@ -6583,9 +6246,7 @@ static void nv_g_cmd(cmdarg_T *cap)
case K_IGNORE:
break;
- /*
- * "gP" and "gp": same as "P" and "p" but leave cursor just after new text
- */
+ // "gP" and "gp": same as "P" and "p" but leave cursor just after new text
case 'p':
case 'P':
nv_put(cap);
@@ -6649,9 +6310,7 @@ static void nv_g_cmd(cmdarg_T *cap)
}
}
-/*
- * Handle "o" and "O" commands.
- */
+/// Handle "o" and "O" commands.
static void n_opencmd(cmdarg_T *cap)
{
if (!checkclearopq(cap->oap)) {
@@ -6681,17 +6340,13 @@ static void n_opencmd(cmdarg_T *cap)
}
}
-/*
- * "." command: redo last change.
- */
+/// "." command: redo last change.
static void nv_dot(cmdarg_T *cap)
{
if (!checkclearopq(cap->oap)) {
- /*
- * If "restart_edit" is true, the last but one command is repeated
- * instead of the last command (inserting text). This is used for
- * CTRL-O <.> in insert mode.
- */
+ // If "restart_edit" is true, the last but one command is repeated
+ // instead of the last command (inserting text). This is used for
+ // CTRL-O <.> in insert mode.
if (start_redo(cap->count0, restart_edit != 0 && !arrow_used) == false) {
clearopbeep(cap->oap);
}
@@ -6724,9 +6379,7 @@ static void nv_redo_or_register(cmdarg_T *cap)
}
}
-/*
- * Handle "U" command.
- */
+/// Handle "U" command.
static void nv_Undo(cmdarg_T *cap)
{
// In Visual mode and typing "gUU" triggers an operator
@@ -6742,10 +6395,8 @@ static void nv_Undo(cmdarg_T *cap)
}
}
-/*
- * '~' command: If tilde is not an operator and Visual is off: swap case of a
- * single character.
- */
+/// '~' command: If tilde is not an operator and Visual is off: swap case of a
+/// single character.
static void nv_tilde(cmdarg_T *cap)
{
if (!p_to
@@ -6761,10 +6412,8 @@ static void nv_tilde(cmdarg_T *cap)
}
}
-/*
- * Handle an operator command.
- * The actual work is done by do_pending_operator().
- */
+/// Handle an operator command.
+/// The actual work is done by do_pending_operator().
static void nv_operator(cmdarg_T *cap)
{
int op_type;
@@ -6786,9 +6435,7 @@ static void nv_operator(cmdarg_T *cap)
}
}
-/*
- * Set v:operator to the characters for "optype".
- */
+/// Set v:operator to the characters for "optype".
static void set_op_var(int optype)
{
if (optype == OP_NOP) {
@@ -6808,15 +6455,13 @@ static void set_op_var(int optype)
}
}
-/*
- * Handle linewise operator "dd", "yy", etc.
- *
- * "_" is is a strange motion command that helps make operators more logical.
- * It is actually implemented, but not documented in the real Vi. This motion
- * command actually refers to "the current line". Commands like "dd" and "yy"
- * are really an alternate form of "d_" and "y_". It does accept a count, so
- * "d3_" works to delete 3 lines.
- */
+/// Handle linewise operator "dd", "yy", etc.
+///
+/// "_" is is a strange motion command that helps make operators more logical.
+/// It is actually implemented, but not documented in the real Vi. This motion
+/// command actually refers to "the current line". Commands like "dd" and "yy"
+/// are really an alternate form of "d_" and "y_". It does accept a count, so
+/// "d3_" works to delete 3 lines.
static void nv_lineop(cmdarg_T *cap)
{
cap->oap->motion_type = kMTLineWise;
@@ -6834,9 +6479,7 @@ static void nv_lineop(cmdarg_T *cap)
}
}
-/*
- * <Home> command.
- */
+/// <Home> command.
static void nv_home(cmdarg_T *cap)
{
// CTRL-HOME is like "gg"
@@ -6850,9 +6493,7 @@ static void nv_home(cmdarg_T *cap)
// one-character line).
}
-/*
- * "|" command.
- */
+/// "|" command.
static void nv_pipe(cmdarg_T *cap)
{
cap->oap->motion_type = kMTCharWise;
@@ -6869,10 +6510,8 @@ static void nv_pipe(cmdarg_T *cap)
curwin->w_set_curswant = false;
}
-/*
- * Handle back-word command "b" and "B".
- * cap->arg is 1 for "B"
- */
+/// Handle back-word command "b" and "B".
+/// cap->arg is 1 for "B"
static void nv_bck_word(cmdarg_T *cap)
{
cap->oap->motion_type = kMTCharWise;
@@ -6885,10 +6524,8 @@ static void nv_bck_word(cmdarg_T *cap)
}
}
-/*
- * Handle word motion commands "e", "E", "w" and "W".
- * cap->arg is true for "E" and "W".
- */
+/// Handle word motion commands "e", "E", "w" and "W".
+/// cap->arg is true for "E" and "W".
static void nv_wordcmd(cmdarg_T *cap)
{
int n;
@@ -6896,9 +6533,7 @@ static void nv_wordcmd(cmdarg_T *cap)
bool flag = false;
pos_T startpos = curwin->w_cursor;
- /*
- * Set inclusive for the "E" and "e" command.
- */
+ // Set inclusive for the "E" and "e" command.
if (cap->cmdchar == 'e' || cap->cmdchar == 'E') {
word_end = true;
} else {
@@ -6906,9 +6541,7 @@ static void nv_wordcmd(cmdarg_T *cap)
}
cap->oap->inclusive = word_end;
- /*
- * "cw" and "cW" are a special case.
- */
+ // "cw" and "cW" are a special case.
if (!word_end && cap->oap->op_type == OP_CHANGE) {
n = gchar_cursor();
if (n != NUL && !ascii_iswhite(n)) {
@@ -6952,11 +6585,9 @@ static void nv_wordcmd(cmdarg_T *cap)
}
}
-/*
- * Used after a movement command: If the cursor ends up on the NUL after the
- * end of the line, may move it back to the last character and make the motion
- * inclusive.
- */
+/// Used after a movement command: If the cursor ends up on the NUL after the
+/// end of the line, may move it back to the last character and make the motion
+/// inclusive.
static void adjust_cursor(oparg_T *oap)
{
// The cursor cannot remain on the NUL when:
@@ -6974,10 +6605,8 @@ static void adjust_cursor(oparg_T *oap)
}
}
-/*
- * "0" and "^" commands.
- * cap->arg is the argument for beginline().
- */
+/// "0" and "^" commands.
+/// cap->arg is the argument for beginline().
static void nv_beginline(cmdarg_T *cap)
{
cap->oap->motion_type = kMTCharWise;
@@ -6990,9 +6619,7 @@ static void nv_beginline(cmdarg_T *cap)
// one-character line).
}
-/*
- * In exclusive Visual mode, may include the last character.
- */
+/// In exclusive Visual mode, may include the last character.
static void adjust_for_sel(cmdarg_T *cap)
{
if (VIsual_active && cap->oap->inclusive && *p_sel == 'e'
@@ -7002,11 +6629,10 @@ static void adjust_for_sel(cmdarg_T *cap)
}
}
-/*
- * Exclude last character at end of Visual area for 'selection' == "exclusive".
- * Should check VIsual_mode before calling this.
- * Returns true when backed up to the previous line.
- */
+/// Exclude last character at end of Visual area for 'selection' == "exclusive".
+/// Should check VIsual_mode before calling this.
+///
+/// @return true when backed up to the previous line.
bool unadjust_for_sel(void)
{
pos_T *pp;
@@ -7023,7 +6649,7 @@ bool unadjust_for_sel(void)
pp->col--;
mark_mb_adjustpos(curbuf, pp);
} else if (pp->lnum > 1) {
- --pp->lnum;
+ pp->lnum--;
pp->col = (colnr_T)STRLEN(ml_get(pp->lnum));
return true;
}
@@ -7031,9 +6657,7 @@ bool unadjust_for_sel(void)
return false;
}
-/*
- * SELECT key in Normal or Visual mode: end of Select mode mapping.
- */
+/// SELECT key in Normal or Visual mode: end of Select mode mapping.
static void nv_select(cmdarg_T *cap)
{
if (VIsual_active) {
@@ -7047,10 +6671,8 @@ static void nv_select(cmdarg_T *cap)
}
-/*
- * "G", "gg", CTRL-END, CTRL-HOME.
- * cap->arg is true for "G".
- */
+/// "G", "gg", CTRL-END, CTRL-HOME.
+/// cap->arg is true for "G".
static void nv_goto(cmdarg_T *cap)
{
linenr_T lnum;
@@ -7079,9 +6701,7 @@ static void nv_goto(cmdarg_T *cap)
}
}
-/*
- * CTRL-\ in Normal mode.
- */
+/// CTRL-\ in Normal mode.
static void nv_normal(cmdarg_T *cap)
{
if (cap->nchar == Ctrl_N || cap->nchar == Ctrl_G) {
@@ -7106,10 +6726,8 @@ static void nv_normal(cmdarg_T *cap)
}
}
-/*
- * ESC in Normal mode: beep, but don't flush buffers.
- * Don't even beep if we are canceling a command.
- */
+/// ESC in Normal mode: beep, but don't flush buffers.
+/// Don't even beep if we are canceling a command.
static void nv_esc(cmdarg_T *cap)
{
int no_reason;
@@ -7271,9 +6889,7 @@ static void invoke_edit(cmdarg_T *cap, int repl, int cmd, int startln)
}
}
-/*
- * "a" or "i" while an operator is pending or in Visual mode: object motion.
- */
+/// "a" or "i" while an operator is pending or in Visual mode: object motion.
static void nv_object(cmdarg_T *cap)
{
bool flag;
@@ -7349,10 +6965,8 @@ static void nv_object(cmdarg_T *cap)
curwin->w_set_curswant = true;
}
-/*
- * "q" command: Start/stop recording.
- * "q:", "q/", "q?": edit command-line in command-line window.
- */
+/// "q" command: Start/stop recording.
+/// "q:", "q/", "q?": edit command-line in command-line window.
static void nv_record(cmdarg_T *cap)
{
if (cap->oap->op_type == OP_FORMAT) {
@@ -7374,9 +6988,7 @@ static void nv_record(cmdarg_T *cap)
}
}
-/*
- * Handle the "@r" command.
- */
+/// Handle the "@r" command.
static void nv_at(cmdarg_T *cap)
{
if (checkclearop(cap->oap)) {
@@ -7396,9 +7008,7 @@ static void nv_at(cmdarg_T *cap)
}
}
-/*
- * Handle the CTRL-U and CTRL-D commands.
- */
+/// Handle the CTRL-U and CTRL-D commands.
static void nv_halfpage(cmdarg_T *cap)
{
if ((cap->cmdchar == Ctrl_U && curwin->w_cursor.lnum == 1)
@@ -7410,9 +7020,7 @@ static void nv_halfpage(cmdarg_T *cap)
}
}
-/*
- * Handle "J" or "gJ" command.
- */
+/// Handle "J" or "gJ" command.
static void nv_join(cmdarg_T *cap)
{
if (VIsual_active) { // join the visual lines
@@ -7437,9 +7045,7 @@ static void nv_join(cmdarg_T *cap)
}
}
-/*
- * "P", "gP", "p" and "gp" commands.
- */
+/// "P", "gP", "p" and "gp" commands.
static void nv_put(cmdarg_T *cap)
{
nv_put_opt(cap, false);
@@ -7586,9 +7192,7 @@ static void nv_put_opt(cmdarg_T *cap, bool fix_indent)
}
}
-/*
- * "o" and "O" commands.
- */
+/// "o" and "O" commands.
static void nv_open(cmdarg_T *cap)
{
// "do" is ":diffget"
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index badc00fb39..36c2513810 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -636,7 +636,7 @@ static void block_insert(oparg_T *oap, char_u *s, int b_insert, struct block_def
*/
void op_reindent(oparg_T *oap, Indenter how)
{
- long i;
+ long i = 0;
char_u *l;
int amount;
linenr_T first_changed = 0;
@@ -649,38 +649,41 @@ void op_reindent(oparg_T *oap, Indenter how)
return;
}
- for (i = oap->line_count - 1; i >= 0 && !got_int; i--) {
- /* it's a slow thing to do, so give feedback so there's no worry that
- * the computer's just hung. */
-
- if (i > 1
- && (i % 50 == 0 || i == oap->line_count - 1)
- && oap->line_count > p_report) {
- smsg(_("%" PRId64 " lines to indent... "), (int64_t)i);
- }
+ // Save for undo. Do this once for all lines, much faster than doing this
+ // for each line separately, especially when undoing.
+ if (u_savecommon(curbuf, start_lnum - 1, start_lnum + oap->line_count,
+ start_lnum + oap->line_count, false) == OK) {
+ for (i = oap->line_count - 1; i >= 0 && !got_int; i--) {
+ // it's a slow thing to do, so give feedback so there's no worry
+ // that the computer's just hung.
- /*
- * Be vi-compatible: For lisp indenting the first line is not
- * indented, unless there is only one line.
- */
- if (i != oap->line_count - 1 || oap->line_count == 1
- || how != get_lisp_indent) {
- l = skipwhite(get_cursor_line_ptr());
- if (*l == NUL) { // empty or blank line
- amount = 0;
- } else {
- amount = how(); // get the indent for this line
+ if (i > 1
+ && (i % 50 == 0 || i == oap->line_count - 1)
+ && oap->line_count > p_report) {
+ smsg(_("%" PRId64 " lines to indent... "), (int64_t)i);
}
- if (amount >= 0 && set_indent(amount, SIN_UNDO)) {
- // did change the indent, call changed_lines() later
- if (first_changed == 0) {
- first_changed = curwin->w_cursor.lnum;
+
+ // Be vi-compatible: For lisp indenting the first line is not
+ // indented, unless there is only one line.
+ if (i != oap->line_count - 1 || oap->line_count == 1
+ || how != get_lisp_indent) {
+ l = skipwhite(get_cursor_line_ptr());
+ if (*l == NUL) { // empty or blank line
+ amount = 0;
+ } else {
+ amount = how(); // get the indent for this line
+ }
+ if (amount >= 0 && set_indent(amount, 0)) {
+ // did change the indent, call changed_lines() later
+ if (first_changed == 0) {
+ first_changed = curwin->w_cursor.lnum;
+ }
+ last_changed = curwin->w_cursor.lnum;
}
- last_changed = curwin->w_cursor.lnum;
}
+ curwin->w_cursor.lnum++;
+ curwin->w_cursor.col = 0; // make sure it's valid
}
- ++curwin->w_cursor.lnum;
- curwin->w_cursor.col = 0; // make sure it's valid
}
// put cursor on first non-blank of indented line
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 897c12a6c4..37594340de 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -262,8 +262,8 @@ typedef struct vimoption {
#define HIGHLIGHT_INIT \
"8:SpecialKey,~:EndOfBuffer,z:TermCursor,Z:TermCursorNC,@:NonText,d:Directory,e:ErrorMsg," \
- "i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr," \
- "G:CursorLineSign,O:CursorLineFold" \
+ "i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow," \
+ "N:CursorLineNr,G:CursorLineSign,O:CursorLineFold" \
"r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg," \
"W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn," \
"-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar," \
@@ -4921,6 +4921,23 @@ bool set_tty_option(const char *name, char *value)
return false;
}
+void set_tty_background(const char *value)
+{
+ if (option_was_set("bg") || strequal((char *)p_bg, value)) {
+ // background is already set... ignore
+ return;
+ }
+ if (starting) {
+ // Wait until after startup, so OptionSet is triggered.
+ do_cmdline_cmd((value[0] == 'l')
+ ? "autocmd VimEnter * ++once ++nested set bg=light"
+ : "autocmd VimEnter * ++once ++nested set bg=dark");
+ } else {
+ set_option_value("bg", 0L, value, 0);
+ reset_option_was_set("bg");
+ }
+}
+
/// Find index for an option
///
/// @param[in] arg Option name.
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index f8d2d37a91..a12fb70388 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -2313,7 +2313,10 @@ static bool qflist_valid(win_T *wp, unsigned int qf_id)
qf_info_T *qi = &ql_info;
if (wp) {
- qi = GET_LOC_LIST(wp);
+ if (!win_valid(wp)) {
+ return false;
+ }
+ qi = GET_LOC_LIST(wp); // Location list
if (!qi) {
return false;
}
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index b61c9a2cf5..a98250f6e8 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -2222,7 +2222,6 @@ static regengine_T bt_regengine =
bt_regfree,
bt_regexec_nl,
bt_regexec_multi,
- (char_u *)""
};
static regengine_T nfa_regengine =
@@ -2231,7 +2230,6 @@ static regengine_T nfa_regengine =
nfa_regfree,
nfa_regexec_nl,
nfa_regexec_multi,
- (char_u *)""
};
// Which regexp engine to use? Needed for vim_regcomp().
diff --git a/src/nvim/regexp_defs.h b/src/nvim/regexp_defs.h
index 913cfb2074..decc832051 100644
--- a/src/nvim/regexp_defs.h
+++ b/src/nvim/regexp_defs.h
@@ -157,12 +157,15 @@ struct reg_extmatch {
};
struct regengine {
+ /// bt_regcomp or nfa_regcomp
regprog_T *(*regcomp)(char_u *, int);
+ /// bt_regfree or nfa_regfree
void (*regfree)(regprog_T *);
+ /// bt_regexec_nl or nfa_regexec_nl
int (*regexec_nl)(regmatch_T *, char_u *, colnr_T, bool);
- long (*regexec_multi)(regmmatch_T *, win_T *, buf_T *, linenr_T, colnr_T,
- proftime_T *, int *);
- char_u *expr;
+ /// bt_regexec_mult or nfa_regexec_mult
+ long (*regexec_multi)(regmmatch_T *, win_T *, buf_T *, linenr_T, colnr_T, proftime_T *, int *);
+ // char_u *expr;
};
#endif // NVIM_REGEXP_DEFS_H
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index d884ad704b..0ceb66f438 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -5802,8 +5802,8 @@ char_u *get_syntax_name(expand_T *xp, int idx)
int syn_get_id(win_T *wp, long lnum, colnr_T col, int trans, bool *spellp, int keep_state)
{
// When the position is not after the current position and in the same
- // line of the same buffer, need to restart parsing.
- if (wp->w_buffer != syn_buf || lnum != current_lnum || col < current_col) {
+ // line of the same window with the same buffer, need to restart parsing.
+ if (wp != syn_win || wp->w_buffer != syn_buf || lnum != current_lnum || col < current_col) {
syntax_start(wp, lnum);
} else if (col > current_col) {
// next_match may not be correct when moving around, e.g. with the
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 228145ec4d..13be82a71d 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -2695,9 +2695,9 @@ func Test_autocmd_closes_window()
au BufNew,BufWinLeave * e %e
file yyy
au BufNew,BufWinLeave * ball
- call assert_fails('n xxx', 'E143:')
+ n xxx
- bwipe %
+ %bwipe
au! BufNew
au! BufWinLeave
endfunc
@@ -2713,9 +2713,34 @@ func Test_autocmd_quit_psearch()
augroup aucmd_win_test
au!
augroup END
+ new
+ pclose
+endfunc
+
+" Fuzzer found some strange combination that caused a crash.
+func Test_autocmd_normal_mess()
+ " For unknown reason this hangs on MS-Windows
+ CheckNotMSWindows
+
+ augroup aucmd_normal_test
+ au BufLeave,BufWinLeave,BufHidden,BufUnload,BufDelete,BufWipeout * norm 7q/qc
+ augroup END
+ " Nvim has removed :open
+ " call assert_fails('o4', 'E1159')
+ call assert_fails('e4', 'E1159')
+ silent! H
+ call assert_fails('e xx', 'E1159')
+ normal G
+
+ augroup aucmd_normal_test
+ au!
+ augroup END
endfunc
func Test_autocmd_closing_cmdwin()
+ " For unknown reason this hangs on MS-Windows
+ CheckNotMSWindows
+
au BufWinLeave * nested q
call assert_fails("norm 7q?\n", 'E855:')
@@ -2724,6 +2749,20 @@ func Test_autocmd_closing_cmdwin()
only
endfunc
+func Test_autocmd_vimgrep()
+ augroup aucmd_vimgrep
+ au QuickfixCmdPre,BufNew,BufReadCmd * sb
+ " Nvim makes aucmd_win the last window
+ " au QuickfixCmdPre,BufNew,BufReadCmd * q9
+ au QuickfixCmdPre,BufNew,BufReadCmd * exe 'q' .. (winnr('$') - (win_gettype(winnr('$')) == 'autocmd'))
+ augroup END
+ call assert_fails('lv ?a? foo', 'E926:')
+
+ augroup aucmd_vimgrep
+ au!
+ augroup END
+endfunc
+
func Test_bufwipeout_changes_window()
" This should not crash, but we don't have any expectations about what
" happens, changing window in BufWipeout has unpredictable results.
@@ -2759,4 +2798,22 @@ func Test_v_event_readonly()
endfunc
+func Test_noname_autocmd()
+ augroup test_noname_autocmd_group
+ autocmd!
+ autocmd BufEnter * call add(s:li, ["BufEnter", expand("<afile>")])
+ autocmd BufDelete * call add(s:li, ["BufDelete", expand("<afile>")])
+ autocmd BufLeave * call add(s:li, ["BufLeave", expand("<afile>")])
+ autocmd BufUnload * call add(s:li, ["BufUnload", expand("<afile>")])
+ autocmd BufWipeout * call add(s:li, ["BufWipeout", expand("<afile>")])
+ augroup END
+
+ let s:li = []
+ edit foo
+ call assert_equal([['BufUnload', ''], ['BufDelete', ''], ['BufWipeout', ''], ['BufEnter', 'foo']], s:li)
+
+ au! test_noname_autocmd_group
+ augroup! test_noname_autocmd_group
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_bufwintabinfo.vim b/src/nvim/testdir/test_bufwintabinfo.vim
index a6eb93b4be..326aefb731 100644
--- a/src/nvim/testdir/test_bufwintabinfo.vim
+++ b/src/nvim/testdir/test_bufwintabinfo.vim
@@ -145,6 +145,13 @@ function Test_get_win_options()
endif
endfunc
+function Test_getbufinfo_lastused()
+ new Xfoo
+ let info = getbufinfo('Xfoo')[0]
+ call assert_equal(has_key(info, 'lastused'), 1)
+ call assert_equal(type(info.lastused), type(0))
+endfunc
+
func Test_getbufinfo_lines()
new Xfoo
call setline(1, ['a', 'bc', 'd'])
@@ -155,9 +162,26 @@ func Test_getbufinfo_lines()
bw!
endfunc
-function Test_getbufinfo_lastused()
- new Xfoo
- let info = getbufinfo('Xfoo')[0]
- call assert_equal(has_key(info, 'lastused'), 1)
- call assert_equal(type(info.lastused), type(0))
+func Test_getwininfo_au()
+ enew
+ call setline(1, range(1, 16))
+
+ let g:info = #{}
+ augroup T1
+ au!
+ au WinEnter * let g:info = getwininfo(win_getid())[0]
+ augroup END
+
+ 4split
+ " Check that calling getwininfo() from WinEnter returns fresh values for
+ " topline and botline.
+ call assert_equal(1, g:info.topline)
+ call assert_equal(4, g:info.botline)
+ close
+
+ unlet g:info
+ augroup! T1
+ bwipe!
endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_cursorline.vim b/src/nvim/testdir/test_cursorline.vim
index 7e97df6027..e85e9304a3 100644
--- a/src/nvim/testdir/test_cursorline.vim
+++ b/src/nvim/testdir/test_cursorline.vim
@@ -314,5 +314,41 @@ func Test_cursorline_screenline_update()
call delete('Xcul_screenline')
endfunc
+func Test_cursorline_cursorbind_horizontal_scroll()
+ CheckScreendump
+
+ let lines =<< trim END
+ call setline(1, 'aa bb cc dd ee ff gg hh ii jj kk ll mm' ..
+ \ ' nn oo pp qq rr ss tt uu vv ww xx yy zz')
+ set nowrap
+ " The following makes the cursor apparent on the screen dump
+ set sidescroll=1 cursorcolumn
+ " add empty lines, required for cursorcolumn
+ call append(1, ['','','',''])
+ 20vsp
+ windo :set cursorbind
+ END
+ call writefile(lines, 'Xhor_scroll')
+
+ let buf = RunVimInTerminal('-S Xhor_scroll', #{rows: 8})
+ call term_sendkeys(buf, "20l")
+ call VerifyScreenDump(buf, 'Test_hor_scroll_1', {})
+ call term_sendkeys(buf, "10l")
+ call VerifyScreenDump(buf, 'Test_hor_scroll_2', {})
+ call term_sendkeys(buf, ":windo :set cursorline\<cr>")
+ call term_sendkeys(buf, "0")
+ call term_sendkeys(buf, "20l")
+ call VerifyScreenDump(buf, 'Test_hor_scroll_3', {})
+ call term_sendkeys(buf, "10l")
+ call VerifyScreenDump(buf, 'Test_hor_scroll_4', {})
+ call term_sendkeys(buf, ":windo :set nocursorline nocursorcolumn\<cr>")
+ call term_sendkeys(buf, "0")
+ call term_sendkeys(buf, "40l")
+ call VerifyScreenDump(buf, 'Test_hor_scroll_5', {})
+
+ call StopVimInTerminal(buf)
+ call delete('Xhor_scroll')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_ex_mode.vim b/src/nvim/testdir/test_ex_mode.vim
index dcec5f7cc6..0ce333fa40 100644
--- a/src/nvim/testdir/test_ex_mode.vim
+++ b/src/nvim/testdir/test_ex_mode.vim
@@ -51,6 +51,13 @@ func Test_ex_mode()
call assert_equal([' foo', ' foo'], Ex(" foo\<C-d>"), e)
call assert_equal(['foo', ' foo0'], Ex(" foo0\<C-d>"), e)
call assert_equal(['foo', ' foo^'], Ex(" foo^\<C-d>"), e)
+ call assert_equal(['foo', 'foo'],
+ \ Ex("\<BS>\<C-H>\<Del>\<kDel>foo"), e)
+ " default wildchar <Tab> interferes with this test
+ set wildchar=<c-e>
+ call assert_equal(["a\tb", "a\tb"], Ex("a\t\t\<C-H>b"), e)
+ call assert_equal(["\t mn", "\tm\<C-T>n"], Ex("\tm\<C-T>n"), e)
+ set wildchar&
endfor
set sw&
diff --git a/src/nvim/testdir/test_expand_func.vim b/src/nvim/testdir/test_expand_func.vim
index 44d2c156d5..b48c2e8a19 100644
--- a/src/nvim/testdir/test_expand_func.vim
+++ b/src/nvim/testdir/test_expand_func.vim
@@ -37,15 +37,6 @@ func Test_expand_sflnum()
delcommand Flnum
endfunc
-func Test_expand()
- new
- call assert_equal("", expand('%:S'))
- call assert_equal('3', '<slnum>'->expand())
- call assert_equal(['4'], expand('<slnum>', v:false, v:true))
- " Don't add any line above this, otherwise <slnum> will change.
- quit
-endfunc
-
func Test_expand_sfile()
call assert_match('test_expand_func\.vim$', s:sfile)
call assert_match('^function .*\.\.Test_expand_sfile$', expand('<sfile>'))
@@ -77,6 +68,15 @@ func Test_expand_slnum()
delcommand Slnum
endfunc
+func Test_expand()
+ new
+ call assert_equal("", expand('%:S'))
+ call assert_equal('3', '<slnum>'->expand())
+ call assert_equal(['4'], expand('<slnum>', v:false, v:true))
+ " Don't add any line above this, otherwise <slnum> will change.
+ quit
+endfunc
+
func s:sid_test()
return 'works'
endfunc
@@ -87,4 +87,17 @@ func Test_expand_SID()
call assert_equal('works', g:sid_result)
endfunc
+
+" Test for 'wildignore' with expand()
+func Test_expand_wildignore()
+ set wildignore=*.vim
+ call assert_equal('', expand('test_expand_func.vim'))
+ call assert_equal('', expand('test_expand_func.vim', 0))
+ call assert_equal([], expand('test_expand_func.vim', 0, 1))
+ call assert_equal('test_expand_func.vim', expand('test_expand_func.vim', 1))
+ call assert_equal(['test_expand_func.vim'],
+ \ expand('test_expand_func.vim', 1, 1))
+ set wildignore&
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim
index 85d9a75824..7a52d0a044 100644
--- a/src/nvim/testdir/test_filetype.vim
+++ b/src/nvim/testdir/test_filetype.vim
@@ -113,7 +113,7 @@ let s:filename_checks = {
\ 'cobol': ['file.cbl', 'file.cob', 'file.lib'],
\ 'coco': ['file.atg'],
\ 'conaryrecipe': ['file.recipe'],
- \ 'conf': ['auto.master'],
+ \ 'conf': ['/etc/pacman.conf', 'any/etc/pacman.conf', 'auto.master'],
\ 'config': ['configure.in', 'configure.ac', '/etc/hostname.file'],
\ 'context': ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'],
\ 'cook': ['file.cook'],
@@ -152,7 +152,7 @@ let s:filename_checks = {
\ 'dnsmasq': ['/etc/dnsmasq.conf', '/etc/dnsmasq.d/file', 'any/etc/dnsmasq.conf', 'any/etc/dnsmasq.d/file'],
\ 'dockerfile': ['Containerfile', 'Dockerfile', 'file.Dockerfile', 'Dockerfile.debian', 'Containerfile.something'],
\ 'dosbatch': ['file.bat'],
- \ 'dosini': ['.editorconfig', '/etc/pacman.conf', '/etc/yum.conf', 'file.ini', 'npmrc', '.npmrc', 'php.ini', 'php.ini-5', 'php.ini-file', '/etc/yum.repos.d/file', 'any/etc/pacman.conf', 'any/etc/yum.conf', 'any/etc/yum.repos.d/file', 'file.wrap'],
+ \ 'dosini': ['.editorconfig', '/etc/yum.conf', 'file.ini', 'npmrc', '.npmrc', 'php.ini', 'php.ini-5', 'php.ini-file', '/etc/yum.repos.d/file', 'any/etc/yum.conf', 'any/etc/yum.repos.d/file', 'file.wrap'],
\ 'dot': ['file.dot', 'file.gv'],
\ 'dracula': ['file.drac', 'file.drc', 'filelvs', 'filelpe', 'drac.file', 'lpe', 'lvs', 'some-lpe', 'some-lvs'],
\ 'dtd': ['file.dtd'],
@@ -306,6 +306,7 @@ let s:filename_checks = {
\ 'libao': ['/etc/libao.conf', '/.libao', 'any/.libao', 'any/etc/libao.conf'],
\ 'lifelines': ['file.ll'],
\ 'lilo': ['lilo.conf', 'lilo.conf-file'],
+ \ 'lilypond': ['file.ly', 'file.ily'],
\ 'limits': ['/etc/limits', '/etc/anylimits.conf', '/etc/anylimits.d/file.conf', '/etc/limits.conf', '/etc/limits.d/file.conf', '/etc/some-limits.conf', '/etc/some-limits.d/file.conf', 'any/etc/limits', 'any/etc/limits.conf', 'any/etc/limits.d/file.conf', 'any/etc/some-limits.conf', 'any/etc/some-limits.d/file.conf'],
\ 'liquid': ['file.liquid'],
\ 'lisp': ['file.lsp', 'file.lisp', 'file.asd', 'file.el', 'file.cl', '.emacs', '.sawfishrc', 'sbclrc', '.sbclrc'],
@@ -336,6 +337,8 @@ let s:filename_checks = {
\ 'markdown': ['file.markdown', 'file.mdown', 'file.mkd', 'file.mkdn', 'file.mdwn', 'file.md'],
\ 'mason': ['file.mason', 'file.mhtml', 'file.comp'],
\ 'master': ['file.mas', 'file.master'],
+ \ 'maxima': ['file.demo', 'file.dmt', 'file.dm1', 'file.dm2', 'file.dm3',
+ \ 'file.wxm', 'maxima-init.mac'],
\ 'mel': ['file.mel'],
\ 'meson': ['meson.build', 'meson_options.txt'],
\ 'messages': ['/log/auth', '/log/cron', '/log/daemon', '/log/debug', '/log/kern', '/log/lpr', '/log/mail', '/log/messages', '/log/news/news', '/log/syslog', '/log/user',
@@ -383,6 +386,7 @@ let s:filename_checks = {
\ 'omnimark': ['file.xom', 'file.xin'],
\ 'opam': ['opam', 'file.opam', 'file.opam.template'],
\ 'openroad': ['file.or'],
+ \ 'openscad': ['file.scad'],
\ 'ora': ['file.ora'],
\ 'org': ['file.org', 'file.org_archive'],
\ 'pamconf': ['/etc/pam.conf', '/etc/pam.d/file', 'any/etc/pam.conf', 'any/etc/pam.d/file'],
@@ -743,7 +747,7 @@ func Test_setfiletype_completion()
endfunc
"""""""""""""""""""""""""""""""""""""""""""""""""
-" Tests for specific extentions and filetypes.
+" Tests for specific extensions and filetypes.
" Keep sorted.
"""""""""""""""""""""""""""""""""""""""""""""""""
@@ -1171,12 +1175,12 @@ func Test_hook_file()
call writefile(['[Trigger]', 'this is pacman config'], 'Xfile.hook')
split Xfile.hook
- call assert_equal('dosini', &filetype)
+ call assert_equal('conf', &filetype)
bwipe!
call writefile(['not pacman'], 'Xfile.hook')
split Xfile.hook
- call assert_notequal('dosini', &filetype)
+ call assert_notequal('conf', &filetype)
bwipe!
call delete('Xfile.hook')
@@ -1535,11 +1539,13 @@ func Test_src_file()
bwipe!
call delete('srcfile.Src')
- " KRL global def with embedded spaces, file starts with empty line(s).
- call writefile(['', 'global def srcfile()'], 'srcfile.SRC')
- split srcfile.SRC
- call assert_equal('krl', &filetype)
- bwipe!
+ " KRL global deffct with embedded spaces, file starts with empty line(s).
+ for text in ['global def srcfile()', 'global deffct srcfile()']
+ call writefile(['', text], 'srcfile.SRC')
+ split srcfile.SRC
+ call assert_equal('krl', &filetype, text)
+ bwipe!
+ endfor
" User may overrule file inspection
let g:filetype_src = 'src'
diff --git a/src/nvim/testdir/test_fold.vim b/src/nvim/testdir/test_fold.vim
index 6da1b3d4a0..9f5ad53adb 100644
--- a/src/nvim/testdir/test_fold.vim
+++ b/src/nvim/testdir/test_fold.vim
@@ -881,4 +881,24 @@ func Test_fold_relative_move()
set fdm& sw& wrap& tw&
endfunc
+" Make sure a fold containing a nested fold is split correctly when using
+" foldmethod=indent
+func Test_fold_split()
+ new
+ let lines =<< trim END
+ line 1
+ line 2
+ line 3
+ line 4
+ line 5
+ END
+ call setline(1, lines)
+ setlocal sw=2
+ setlocal foldmethod=indent foldenable
+ call assert_equal([0, 1, 1, 2, 2], range(1, 5)->map('foldlevel(v:val)'))
+ call append(2, 'line 2.5')
+ call assert_equal([0, 1, 0, 1, 2, 2], range(1, 6)->map('foldlevel(v:val)'))
+ bw!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_indent.vim b/src/nvim/testdir/test_indent.vim
new file mode 100644
index 0000000000..516b3fbdd1
--- /dev/null
+++ b/src/nvim/testdir/test_indent.vim
@@ -0,0 +1,124 @@
+" Test for various indent options
+
+func Test_preserveindent()
+ new
+ " Test for autoindent copying indent from the previous line
+ setlocal autoindent
+ call setline(1, [repeat(' ', 16) .. 'line1'])
+ call feedkeys("A\nline2", 'xt')
+ call assert_equal("\t\tline2", getline(2))
+ setlocal autoindent&
+
+ " Test for using CTRL-T with and without 'preserveindent'
+ set shiftwidth=4
+ call cursor(1, 1)
+ call setline(1, " \t ")
+ call feedkeys("Al\<C-T>", 'xt')
+ call assert_equal("\t\tl", getline(1))
+ set preserveindent
+ call setline(1, " \t ")
+ call feedkeys("Al\<C-T>", 'xt')
+ call assert_equal(" \t \tl", getline(1))
+ set pi& sw&
+
+ " Test for using CTRL-T with 'expandtab' and 'preserveindent'
+ call cursor(1, 1)
+ call setline(1, "\t \t")
+ set shiftwidth=4 expandtab preserveindent
+ call feedkeys("Al\<C-T>", 'xt')
+ call assert_equal("\t \t l", getline(1))
+ set sw& et& pi&
+
+ close!
+endfunc
+
+" Test for indent()
+func Test_indent_func()
+ call assert_equal(-1, indent(-1))
+ new
+ call setline(1, "\tabc")
+ call assert_equal(8, indent(1))
+ call setline(1, " abc")
+ call assert_equal(4, indent(1))
+ call setline(1, " \t abc")
+ call assert_equal(12, indent(1))
+ close!
+endfunc
+
+" Test for reindenting a line using the '=' operator
+func Test_reindent()
+ new
+ call setline(1, 'abc')
+ set nomodifiable
+ call assert_fails('normal ==', 'E21:')
+ set modifiable
+
+ call setline(1, ['foo', 'bar'])
+ call feedkeys('ggVG=', 'xt')
+ call assert_equal(['foo', 'bar'], getline(1, 2))
+ close!
+endfunc
+
+" Test indent operator creating one undo entry
+func Test_indent_operator_undo()
+ enew
+ call setline(1, range(12)->map('"\t" .. v:val'))
+ func FoldExpr()
+ let g:foldcount += 1
+ return '='
+ endfunc
+ set foldmethod=expr foldexpr=FoldExpr()
+ let g:foldcount = 0
+ redraw
+ call assert_equal(12, g:foldcount)
+ normal gg=G
+ call assert_equal(24, g:foldcount)
+ undo
+ call assert_equal(38, g:foldcount)
+
+ bwipe!
+ set foldmethod& foldexpr=
+ delfunc FoldExpr
+ unlet g:foldcount
+endfunc
+
+" Test for shifting a line with a preprocessor directive ('#')
+func Test_preproc_indent()
+ new
+ set sw=4
+ call setline(1, '#define FOO 1')
+ normal >>
+ call assert_equal(' #define FOO 1', getline(1))
+
+ " with 'smartindent'
+ call setline(1, '#define FOO 1')
+ set smartindent
+ normal >>
+ call assert_equal('#define FOO 1', getline(1))
+ set smartindent&
+
+ " with 'cindent'
+ set cindent
+ normal >>
+ call assert_equal('#define FOO 1', getline(1))
+ set cindent&
+
+ close!
+endfunc
+
+" Test for 'copyindent'
+func Test_copyindent()
+ new
+ set shiftwidth=4 autoindent expandtab copyindent
+ call setline(1, " \t abc")
+ call feedkeys("ol", 'xt')
+ call assert_equal(" \t l", getline(2))
+ set noexpandtab
+ call setline(1, " \t abc")
+ call feedkeys("ol", 'xt')
+ call assert_equal(" \t l", getline(2))
+ set sw& ai& et& ci&
+ close!
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_lispwords.vim b/src/nvim/testdir/test_lispwords.vim
index aa5a738bdf..ff710b2716 100644
--- a/src/nvim/testdir/test_lispwords.vim
+++ b/src/nvim/testdir/test_lispwords.vim
@@ -45,6 +45,7 @@ func Test_lisp_indent()
\ ])
call assert_equal(7, lispindent(2))
call assert_equal(5, 6->lispindent())
+ call assert_equal(-1, lispindent(-1))
set lisp
set lispwords&
@@ -83,3 +84,5 @@ func Test_lisp_indent()
let &cpoptions=save_copt
set nolisp
endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim
index a8dd0ca286..a9500f8f77 100644
--- a/src/nvim/testdir/test_mapping.vim
+++ b/src/nvim/testdir/test_mapping.vim
@@ -676,6 +676,35 @@ func Test_plug_remap()
%bw!
endfunc
+func Test_mouse_drag_mapped_start_select()
+ CheckFunction test_setmouse
+ set mouse=a
+ set selectmode=key,mouse
+ func ClickExpr()
+ call test_setmouse(1, 1)
+ return "\<LeftMouse>"
+ endfunc
+ func DragExpr()
+ call test_setmouse(1, 2)
+ return "\<LeftDrag>"
+ endfunc
+ nnoremap <expr> <F2> ClickExpr()
+ nmap <expr> <F3> DragExpr()
+
+ nnoremap <LeftDrag> <LeftDrag><Cmd><CR>
+ exe "normal \<F2>\<F3>"
+ call assert_equal('s', mode())
+ exe "normal! \<C-\>\<C-N>"
+
+ nunmap <LeftDrag>
+ nunmap <F2>
+ nunmap <F3>
+ delfunc ClickExpr
+ delfunc DragExpr
+ set selectmode&
+ set mouse&
+endfunc
+
" Test for mapping <LeftDrag> in Insert mode
func Test_mouse_drag_insert_map()
CheckFunction test_setmouse
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim
index 8154bd9c4d..d359e69f91 100644
--- a/src/nvim/testdir/test_search.vim
+++ b/src/nvim/testdir/test_search.vim
@@ -946,6 +946,51 @@ func Test_incsearch_substitute()
call Incsearch_cleanup()
endfunc
+func Test_hlsearch_cursearch()
+ CheckScreendump
+
+ let lines =<< trim END
+ set hlsearch scrolloff=0
+ call setline(1, ['one', 'foo', 'bar', 'baz', 'foo the foo and foo', 'bar'])
+ hi Search ctermbg=yellow
+ hi CurSearch ctermbg=blue
+ END
+ call writefile(lines, 'Xhlsearch_cursearch')
+ let buf = RunVimInTerminal('-S Xhlsearch_cursearch', {'rows': 9, 'cols': 60})
+
+ call term_sendkeys(buf, "gg/foo\<CR>")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_1', {})
+
+ call term_sendkeys(buf, "n")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_2', {})
+
+ call term_sendkeys(buf, "n")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_2a', {})
+
+ call term_sendkeys(buf, "n")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_2b', {})
+
+ call term_sendkeys(buf, ":call setline(5, 'foo')\<CR>")
+ call term_sendkeys(buf, "0?\<CR>")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_3', {})
+
+ call term_sendkeys(buf, "gg/foo\\nbar\<CR>")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_multiple_line_1', {})
+
+ call term_sendkeys(buf, ":call setline(1, ['---', 'abcdefg', 'hijkl', '---', 'abcdefg', 'hijkl'])\<CR>")
+ call term_sendkeys(buf, "gg/efg\\nhij\<CR>")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_multiple_line_2', {})
+ call term_sendkeys(buf, "h\<C-L>")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_multiple_line_3', {})
+ call term_sendkeys(buf, "j\<C-L>")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_multiple_line_4', {})
+ call term_sendkeys(buf, "h\<C-L>")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_multiple_line_5', {})
+
+ call StopVimInTerminal(buf)
+ call delete('Xhlsearch_cursearch')
+endfunc
+
" Similar to Test_incsearch_substitute() but with a screendump halfway.
func Test_incsearch_substitute_dump()
CheckOption incsearch
diff --git a/src/nvim/testdir/test_smartindent.vim b/src/nvim/testdir/test_smartindent.vim
index e89ad19d34..dc0f99e93f 100644
--- a/src/nvim/testdir/test_smartindent.vim
+++ b/src/nvim/testdir/test_smartindent.vim
@@ -38,4 +38,27 @@ func Test_smartindent_has_no_effect()
bwipe!
endfunc
+" Test for inserting '{' and '} with smartindent
+func Test_smartindent_braces()
+ new
+ set smartindent shiftwidth=4
+ call setline(1, [' if (a)', "\tif (b)", "\t return 1"])
+ normal 2ggO{
+ normal 3ggA {
+ normal 4ggo}
+ normal o}
+ normal 4ggO#define FOO 1
+ call assert_equal([
+ \ ' if (a)',
+ \ ' {',
+ \ "\tif (b) {",
+ \ '#define FOO 1',
+ \ "\t return 1",
+ \ "\t}",
+ \ ' }'
+ \ ], getline(1, '$'))
+ set si& sw& ai&
+ close!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_syntax.vim b/src/nvim/testdir/test_syntax.vim
index b047b53b6f..6bef61ae8f 100644
--- a/src/nvim/testdir/test_syntax.vim
+++ b/src/nvim/testdir/test_syntax.vim
@@ -794,5 +794,18 @@ func Test_syn_include_contains_TOP()
bw!
endfunc
+" This was using freed memory
+func Test_WinEnter_synstack_synID()
+ autocmd WinEnter * call synstack(line("."), col("."))
+ autocmd WinEnter * call synID(line('.'), col('.') - 1, 1)
+ call setline(1, 'aaaaa')
+ normal! $
+ new
+ close
+
+ au! WinEnter
+ bw!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_vartabs.vim b/src/nvim/testdir/test_vartabs.vim
index 017bb6675d..6af199a512 100644
--- a/src/nvim/testdir/test_vartabs.vim
+++ b/src/nvim/testdir/test_vartabs.vim
@@ -92,6 +92,18 @@ func Test_vartabs()
let expect = "l\<tab> l\<tab>l l\<tab> l\<tab> l"
call assert_equal(expect, getline(1))
+ " Test for 'retab' with vts
+ set ts=8 sts=0 vts=5,3,6,2 vsts=
+ exe "norm! S l"
+ .retab!
+ call assert_equal("\t\t\t\tl", getline(1))
+
+ " Test for 'retab' with same vlaues as vts
+ set ts=8 sts=0 vts=5,3,6,2 vsts=
+ exe "norm! S l"
+ .retab! 5,3,6,2
+ call assert_equal("\t\t\t\tl", getline(1))
+
" Check that global and local values are set.
set ts=4 vts=6 sts=8 vsts=10
call assert_equal(&ts, 4)
@@ -389,3 +401,33 @@ func Test_vartabs_reset()
set all&
call assert_equal('', &vts)
endfunc
+
+func s:SaveCol(l)
+ call add(a:l, [col('.'), virtcol('.')])
+ return ''
+endfunc
+
+" Test for 'varsofttabstop'
+func Test_varsofttabstop()
+ new
+ inoremap <expr> <F2> s:SaveCol(g:cols)
+
+ set backspace=indent,eol,start
+ set varsofttabstop=6,2,5,3
+ let g:cols = []
+ call feedkeys("a\t\<F2>\t\<F2>\t\<F2>\t\<F2> ", 'xt')
+ call assert_equal("\t\t ", getline(1))
+ call assert_equal([[7, 7], [2, 9], [7, 14], [3, 17]], g:cols)
+
+ let g:cols = []
+ call feedkeys("a\<bs>\<F2>\<bs>\<F2>\<bs>\<F2>\<bs>\<F2>\<bs>\<F2>", 'xt')
+ call assert_equal('', getline(1))
+ call assert_equal([[3, 17], [7, 14], [2, 9], [7, 7], [1, 1]], g:cols)
+
+ set varsofttabstop&
+ set backspace&
+ iunmap <F2>
+ close!
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_window_cmd.vim b/src/nvim/testdir/test_window_cmd.vim
index ef6dec580f..798122dc5d 100644
--- a/src/nvim/testdir/test_window_cmd.vim
+++ b/src/nvim/testdir/test_window_cmd.vim
@@ -513,14 +513,15 @@ func Test_window_colon_command()
endfunc
func Test_access_freed_mem()
+ call assert_equal(&columns, winwidth(0))
" This was accessing freed memory (but with what events?)
au BufEnter,BufLeave,WinEnter,WinLeave 0 vs xxx
arg 0
argadd
- all
- all
+ call assert_fails("all", "E242:")
au!
bwipe xxx
+ call assert_equal(&columns, winwidth(0))
endfunc
func Test_visual_cleared_after_window_split()
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c
index 17656c5ddc..691b2ea9da 100644
--- a/src/nvim/tui/input.c
+++ b/src/nvim/tui/input.c
@@ -442,18 +442,7 @@ static HandleState handle_bracketed_paste(TermInput *input)
static void set_bg_deferred(void **argv)
{
char *bgvalue = argv[0];
- if (!option_was_set("bg") && !strequal((char *)p_bg, bgvalue)) {
- // Value differs, apply it.
- if (starting) {
- // Wait until after startup, so OptionSet is triggered.
- do_cmdline_cmd((bgvalue[0] == 'l')
- ? "autocmd VimEnter * ++once ++nested set bg=light"
- : "autocmd VimEnter * ++once ++nested set bg=dark");
- } else {
- set_option_value("bg", 0L, bgvalue, 0);
- reset_option_was_set("bg");
- }
- }
+ set_tty_background(bgvalue);
}
// During startup, tui.c requests the background color (see `ext.get_bg`).
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index a67bcf98dc..4b5ad4cff8 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -311,8 +311,7 @@ static void terminfo_start(UI *ui)
// Enable bracketed paste
unibi_out_ext(ui, data->unibi_ext.enable_bracketed_paste);
- // Enable extended keys (also known as 'modifyOtherKeys' or CSI u). On terminals that don't
- // support this, this sequence is ignored.
+ // Enable extended keys (also known as 'modifyOtherKeys' or CSI u)
unibi_out_ext(ui, data->unibi_ext.enable_extended_keys);
int ret;
@@ -2075,13 +2074,15 @@ static void augment_terminfo(TUIData *data, const char *term, long vte_version,
"\x1b[58:2::%p1%d:%p2%d:%p3%dm");
}
- if (!kitty) {
- // Kitty does not support these sequences; it only supports it's own CSI > 1 u which enables the
- // Kitty keyboard protocol
- data->unibi_ext.enable_extended_keys = (int)unibi_add_ext_str(ut, "ext.enable_extended_keys",
- "\x1b[>4;2m");
- data->unibi_ext.disable_extended_keys = (int)unibi_add_ext_str(ut, "ext.disable_extended_keys",
- "\x1b[>4;0m");
+ data->unibi_ext.enable_extended_keys = unibi_find_ext_str(ut, "Eneks");
+ data->unibi_ext.disable_extended_keys = unibi_find_ext_str(ut, "Dseks");
+ if (data->unibi_ext.enable_extended_keys == -1) {
+ if (!kitty && (vte_version == 0 || vte_version >= 5400)) {
+ data->unibi_ext.enable_extended_keys = (int)unibi_add_ext_str(ut, "ext.enable_extended_keys",
+ "\x1b[>4;2m");
+ data->unibi_ext.disable_extended_keys = (int)unibi_add_ext_str(ut, "ext.disable_extended_keys",
+ "\x1b[>4m");
+ }
}
}
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 2ca5128445..f68cfe4c9c 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -72,8 +72,40 @@ typedef enum {
WEE_TRIGGER_LEAVE_AUTOCMDS = 0x10,
} wee_flags_T;
+static char e_cannot_split_window_when_closing_buffer[]
+ = N_("E1159: Cannot split a window when closing the buffer");
+
static char *m_onlyone = N_("Already only one window");
+/// When non-zero splitting a window is forbidden. Used to avoid that nasty
+/// autocommands mess up the window structure.
+static int split_disallowed = 0;
+
+// #define WIN_DEBUG
+#ifdef WIN_DEBUG
+/// Call this method to log the current window layout.
+static void log_frame_layout(frame_T *frame)
+{
+ DLOG("layout %s, wi: %d, he: %d, wwi: %d, whe: %d, id: %d",
+ frame->fr_layout == FR_LEAF ? "LEAF" : frame->fr_layout == FR_ROW ? "ROW" : "COL",
+ frame->fr_width,
+ frame->fr_height,
+ frame->fr_win == NULL ? -1 : frame->fr_win->w_width,
+ frame->fr_win == NULL ? -1 : frame->fr_win->w_height,
+ frame->fr_win == NULL ? -1 : frame->fr_win->w_id);
+ if (frame->fr_child != NULL) {
+ DLOG("children");
+ log_frame_layout(frame->fr_child);
+ if (frame->fr_next != NULL) {
+ DLOG("END of children");
+ }
+ }
+ if (frame->fr_next != NULL) {
+ log_frame_layout(frame->fr_next);
+ }
+}
+#endif
+
/// @return the current window, unless in the cmdline window and "prevwin" is
/// set, then return "prevwin".
win_T *prevwin_curwin(void)
@@ -909,6 +941,21 @@ void ui_ext_win_viewport(win_T *wp)
}
}
+/// If "split_disallowed" is set given an error and return FAIL.
+/// Otherwise return OK.
+static int check_split_disallowed(void)
+{
+ if (split_disallowed > 0) {
+ emsg(_("E242: Can't split a window while closing another"));
+ return FAIL;
+ }
+ if (curwin->w_buffer->b_locked_split) {
+ emsg(_(e_cannot_split_window_when_closing_buffer));
+ return FAIL;
+ }
+ return OK;
+}
+
/*
* split the current window, implements CTRL-W s and :split
*
@@ -926,6 +973,10 @@ void ui_ext_win_viewport(win_T *wp)
*/
int win_split(int size, int flags)
{
+ if (check_split_disallowed() == FAIL) {
+ return FAIL;
+ }
+
// When the ":tab" modifier was used open a new tab page instead.
if (may_open_tabpage() == OK) {
return OK;
@@ -1886,6 +1937,9 @@ static void win_totop(int size, int flags)
if (curwin == aucmd_win) {
return;
}
+ if (check_split_disallowed() == FAIL) {
+ return;
+ }
if (curwin->w_floating) {
ui_comp_remove_grid(&curwin->w_grid_alloc);
@@ -1929,6 +1983,11 @@ void win_move_after(win_T *win1, win_T *win2)
// check if there is something to do
if (win2->w_next != win1) {
+ if (win1->w_frame->fr_parent != win2->w_frame->fr_parent) {
+ iemsg("INTERNAL: trying to move a window into another frame");
+ return;
+ }
+
// may need move the status line, horizontal or vertical separator of the last window
if (win1 == lastwin) {
height = win1->w_prev->w_status_height;
@@ -2742,6 +2801,10 @@ int win_close(win_T *win, bool free_buf, bool force)
return FAIL;
}
+ // Now we are really going to close the window. Disallow any autocommand
+ // to split a window to avoid trouble.
+ split_disallowed++;
+
// let terminal buffers know that this window dimensions may be ignored
win->w_closing = true;
@@ -2809,6 +2872,8 @@ int win_close(win_T *win, bool free_buf, bool force)
}
}
+ split_disallowed--;
+
/*
* If last window has a status line now and we don't want one,
* remove the status line.
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index e6ed0f939b..04b79a7157 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -1085,6 +1085,12 @@ describe('API', function()
eq('aabbccdd', funcs.getcmdline())
expect('')
end)
+ it('mappings are disabled in Cmdline mode', function()
+ command('cnoremap a b')
+ feed(':')
+ nvim('paste', 'a', true, -1)
+ eq('a', funcs.getcmdline())
+ end)
it('pasting with empty last chunk in Cmdline mode', function()
local screen = Screen.new(20, 4)
screen:attach()
diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua
index 6111654b5e..90254b7415 100644
--- a/test/functional/autocmd/autocmd_spec.lua
+++ b/test/functional/autocmd/autocmd_spec.lua
@@ -60,6 +60,23 @@ describe('autocmd', function()
eq(expected, eval('g:evs'))
end)
+ it('first edit causes BufUnload on NoName', function()
+ local expected = {
+ {'BufUnload', ''},
+ {'BufDelete', ''},
+ {'BufWipeout', ''},
+ {'BufEnter', 'testfile1'},
+ }
+ command('let g:evs = []')
+ command('autocmd BufEnter * :call add(g:evs, ["BufEnter", expand("<afile>")])')
+ command('autocmd BufDelete * :call add(g:evs, ["BufDelete", expand("<afile>")])')
+ command('autocmd BufLeave * :call add(g:evs, ["BufLeave", expand("<afile>")])')
+ command('autocmd BufUnload * :call add(g:evs, ["BufUnload", expand("<afile>")])')
+ command('autocmd BufWipeout * :call add(g:evs, ["BufWipeout", expand("<afile>")])')
+ command('edit testfile1')
+ eq(expected, eval('g:evs'))
+ end)
+
it('WinClosed is non-recursive', function()
command('let g:triggered = 0')
command('autocmd WinClosed * :let g:triggered+=1 | :bdelete 2')
@@ -548,18 +565,6 @@ describe('autocmd', function()
neq({}, meths.get_autocmds { group = "filetypedetect" })
end)
- it('should not access freed mem', function()
- source [[
- au BufEnter,BufLeave,WinEnter,WinLeave 0 vs xxx
- arg 0
- argadd
- all
- all
- au!
- bwipe xxx
- ]]
- end)
-
it('should allow comma-separated patterns', function()
source [[
augroup TestingPatterns
diff --git a/test/functional/editor/undo_spec.lua b/test/functional/editor/undo_spec.lua
index a023ca3d90..a041428cdc 100644
--- a/test/functional/editor/undo_spec.lua
+++ b/test/functional/editor/undo_spec.lua
@@ -2,9 +2,18 @@ local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local command = helpers.command
+local eval = helpers.eval
local expect = helpers.expect
+local eq = helpers.eq
local feed = helpers.feed
+local feed_command = helpers.feed_command
local insert = helpers.insert
+local funcs = helpers.funcs
+
+local function lastmessage()
+ local messages = funcs.split(funcs.execute('messages'), '\n')
+ return messages[#messages]
+end
describe('u CTRL-R g- g+', function()
before_each(clear)
@@ -59,3 +68,61 @@ describe('u CTRL-R g- g+', function()
undo_and_redo(4, 'g-', 'g+', '1')
end)
end)
+
+describe(':undo! command', function()
+ before_each(function()
+ clear()
+ feed('i1 little bug in the code<Esc>')
+ feed('o1 little bug in the code<Esc>')
+ feed('oTake 1 down, patch it around<Esc>')
+ feed('o99 little bugs in the code<Esc>')
+ end)
+ it('works', function()
+ feed_command('undo!')
+ expect([[
+ 1 little bug in the code
+ 1 little bug in the code
+ Take 1 down, patch it around]])
+ feed('<C-r>')
+ eq('Already at newest change', lastmessage())
+ end)
+ it('works with arguments', function()
+ feed_command('undo! 2')
+ expect([[
+ 1 little bug in the code
+ 1 little bug in the code]])
+ feed('<C-r>')
+ eq('Already at newest change', lastmessage())
+ end)
+ it('correctly sets alternative redo', function()
+ feed('uo101 little bugs in the code<Esc>')
+ feed_command('undo!')
+ feed('<C-r>')
+ expect([[
+ 1 little bug in the code
+ 1 little bug in the code
+ Take 1 down, patch it around
+ 99 little bugs in the code]])
+
+ feed('uuoTake 2 down, patch them around<Esc>')
+ feed('o101 little bugs in the code<Esc>')
+ feed_command('undo! 2')
+ feed('<C-r><C-r>')
+ expect([[
+ 1 little bug in the code
+ 1 little bug in the code
+ Take 1 down, patch it around
+ 99 little bugs in the code]])
+ end)
+ it('fails when attempting to redo or move to different undo branch', function()
+ feed_command('undo! 4')
+ eq('E5767: Cannot use :undo! to redo or move to a different undo branch', eval('v:errmsg'))
+ feed('u')
+ feed_command('undo! 4')
+ eq('E5767: Cannot use :undo! to redo or move to a different undo branch', eval('v:errmsg'))
+ feed('o101 little bugs in the code<Esc>')
+ feed('o101 little bugs in the code<Esc>')
+ feed_command('undo! 4')
+ eq('E5767: Cannot use :undo! to redo or move to a different undo branch', eval('v:errmsg'))
+ end)
+end)
diff --git a/test/functional/ex_cmds/quickfix_commands_spec.lua b/test/functional/ex_cmds/quickfix_commands_spec.lua
index c956a2df2d..94b7fa1a84 100644
--- a/test/functional/ex_cmds/quickfix_commands_spec.lua
+++ b/test/functional/ex_cmds/quickfix_commands_spec.lua
@@ -109,4 +109,17 @@ describe('quickfix', function()
]])
eq({0, 6, 1, 0, 1}, funcs.getcurpos())
end)
+
+ it('BufAdd does not cause E16 when reusing quickfix buffer #18135', function()
+ local file = file_base .. '_reuse_qfbuf_BufAdd'
+ write_file(file, ('\n'):rep(100) .. 'foo')
+ source([[
+ set grepprg=internal
+ autocmd BufAdd * call and(0, 0)
+ autocmd QuickFixCmdPost grep ++nested cclose | cwindow
+ ]])
+ command('grep foo ' .. file)
+ command('grep foo ' .. file)
+ os.remove(file)
+ end)
end)
diff --git a/test/functional/legacy/ex_mode_spec.lua b/test/functional/legacy/ex_mode_spec.lua
index 44719027a6..244b6bf00f 100644
--- a/test/functional/legacy/ex_mode_spec.lua
+++ b/test/functional/legacy/ex_mode_spec.lua
@@ -32,5 +32,11 @@ describe('Ex mode', function()
test_ex_edit(' foo', ' foo<C-d>')
test_ex_edit(' foo0', ' foo0<C-d>')
test_ex_edit(' foo^', ' foo^<C-d>')
+ test_ex_edit('foo', '<BS><C-H><Del><kDel>foo')
+ -- default wildchar <Tab> interferes with this test
+ command('set wildchar=<c-e>')
+ test_ex_edit('a\tb', 'a\t\t<C-H>b')
+ test_ex_edit('\tm<C-T>n', '\tm<C-T>n')
+ command('set wildchar&')
end)
end)
diff --git a/test/functional/legacy/mapping_spec.lua b/test/functional/legacy/mapping_spec.lua
index aa29698589..0f65d5eb65 100644
--- a/test/functional/legacy/mapping_spec.lua
+++ b/test/functional/legacy/mapping_spec.lua
@@ -129,10 +129,23 @@ describe('mapping', function()
]])
end)
+ it('dragging starts Select mode even if coming from mapping vim-patch:8.2.4806', function()
+ command('set mouse=a')
+ command('set selectmode=mouse')
+
+ command('nnoremap <LeftDrag> <LeftDrag><Cmd><CR>')
+ sleep(10)
+ meths.input_mouse('left', 'press', '', 0, 0, 0)
+ sleep(10)
+ meths.input_mouse('left', 'drag', '', 0, 0, 1)
+ sleep(10)
+ eq('s', eval('mode()'))
+ end)
+
it('<LeftDrag> mapping in Insert mode works correctly vim-patch:8.2.4692', function()
command('set mouse=a')
- command([[inoremap <LeftDrag> <LeftDrag><Cmd>let g:dragged = 1<CR>]])
+ command('inoremap <LeftDrag> <LeftDrag><Cmd>let g:dragged = 1<CR>')
feed('i')
sleep(10)
meths.input_mouse('left', 'press', '', 0, 0, 0)
diff --git a/test/functional/lua/diagnostic_spec.lua b/test/functional/lua/diagnostic_spec.lua
index b58fad1cab..7f929db8bf 100644
--- a/test/functional/lua/diagnostic_spec.lua
+++ b/test/functional/lua/diagnostic_spec.lua
@@ -1939,24 +1939,31 @@ describe('vim.diagnostic', function()
end)
it('triggers the autocommand when diagnostics are set', function()
- eq(1, exec_lua [[
+ eq(true, exec_lua [[
+ -- Set a different buffer as current to test that <abuf> is being set properly in
+ -- DiagnosticChanged callbacks
+ local tmp = vim.api.nvim_create_buf(false, true)
+ vim.api.nvim_set_current_buf(tmp)
+
vim.g.diagnostic_autocmd_triggered = 0
- vim.cmd('autocmd DiagnosticChanged * let g:diagnostic_autocmd_triggered = 1')
+ vim.cmd('autocmd DiagnosticChanged * let g:diagnostic_autocmd_triggered = +expand("<abuf>")')
vim.api.nvim_buf_set_name(diagnostic_bufnr, "test | test")
vim.diagnostic.set(diagnostic_ns, diagnostic_bufnr, {
make_error('Diagnostic', 0, 0, 0, 0)
})
- return vim.g.diagnostic_autocmd_triggered
+ return vim.g.diagnostic_autocmd_triggered == diagnostic_bufnr
]])
end)
it('triggers the autocommand when diagnostics are cleared', function()
- eq(1, exec_lua [[
+ eq(true, exec_lua [[
+ local tmp = vim.api.nvim_create_buf(false, true)
+ vim.api.nvim_set_current_buf(tmp)
vim.g.diagnostic_autocmd_triggered = 0
- vim.cmd('autocmd DiagnosticChanged * let g:diagnostic_autocmd_triggered = 1')
+ vim.cmd('autocmd DiagnosticChanged * let g:diagnostic_autocmd_triggered = +expand("<abuf>")')
vim.api.nvim_buf_set_name(diagnostic_bufnr, "test | test")
vim.diagnostic.reset(diagnostic_ns, diagnostic_bufnr)
- return vim.g.diagnostic_autocmd_triggered
+ return vim.g.diagnostic_autocmd_triggered == diagnostic_bufnr
]])
end)
end)
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index 1547f3244e..ae6a1d5765 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -2755,6 +2755,39 @@ describe('vim.keymap', function()
eq('\nNo mapping found', helpers.exec_capture('nmap asdf'))
end)
+ it('works with buffer-local mappings', function()
+ eq(0, exec_lua [[
+ GlobalCount = 0
+ vim.keymap.set('n', 'asdf', function() GlobalCount = GlobalCount + 1 end, {buffer=true})
+ return GlobalCount
+ ]])
+
+ feed('asdf\n')
+
+ eq(1, exec_lua[[return GlobalCount]])
+
+ exec_lua [[
+ vim.keymap.del('n', 'asdf', {buffer=true})
+ ]]
+
+ feed('asdf\n')
+
+ eq(1, exec_lua[[return GlobalCount]])
+ eq('\nNo mapping found', helpers.exec_capture('nmap asdf'))
+ end)
+
+ it('does not mutate the opts parameter', function()
+ eq(true, exec_lua [[
+ opts = {buffer=true}
+ vim.keymap.set('n', 'asdf', function() end, opts)
+ return opts.buffer
+ ]])
+ eq(true, exec_lua [[
+ vim.keymap.del('n', 'asdf', opts)
+ return opts.buffer
+ ]])
+ end)
+
it('can do <Plug> mappings', function()
eq(0, exec_lua [[
GlobalCount = 0
diff --git a/test/functional/options/cursorbind_spec.lua b/test/functional/options/cursorbind_spec.lua
new file mode 100644
index 0000000000..f762808dd6
--- /dev/null
+++ b/test/functional/options/cursorbind_spec.lua
@@ -0,0 +1,91 @@
+local helpers = require('test.functional.helpers')(after_each)
+local Screen = require('test.functional.ui.screen')
+local clear = helpers.clear
+local command = helpers.command
+local exec = helpers.exec
+local feed = helpers.feed
+
+before_each(clear)
+
+describe("'cursorbind'", function()
+ it("behaves consistently whether 'cursorline' is set or not vim-patch:8.2.4795", function()
+ local screen = Screen.new(60, 8)
+ screen:set_default_attr_ids({
+ [1] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
+ [2] = {bold = true, reverse = true}, -- StatusLine
+ [3] = {reverse = true}, -- StatusLineNC, VertSplit
+ [4] = {background = Screen.colors.Grey90}, -- CursorLine, CursorColumn
+ })
+ screen:attach()
+ exec([[
+ call setline(1, 'aa bb cc dd ee ff gg hh ii jj kk ll mm' ..
+ \ ' nn oo pp qq rr ss tt uu vv ww xx yy zz')
+ set nowrap
+ " The following makes the cursor apparent on the screen dump
+ set sidescroll=1 cursorcolumn
+ " add empty lines, required for cursorcolumn
+ call append(1, ['','','',''])
+ 20vsp
+ windo :set cursorbind
+ ]])
+ feed('20l')
+ screen:expect([[
+ a bb cc dd ee ff gg {3:│}aa bb cc dd ee ff gg^ hh ii jj kk ll mm |
+ {4: }{3:│} {4: } |
+ {4: }{3:│} {4: } |
+ {4: }{3:│} {4: } |
+ {4: }{3:│} {4: } |
+ {1:~ }{3:│}{1:~ }|
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ |
+ ]])
+ feed('10l')
+ screen:expect([[
+ hh ii jj kk ll mm n{3:│}aa bb cc dd ee ff gg hh ii jj ^kk ll mm |
+ {4: } {3:│} {4: } |
+ {4: } {3:│} {4: } |
+ {4: } {3:│} {4: } |
+ {4: } {3:│} {4: } |
+ {1:~ }{3:│}{1:~ }|
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ |
+ ]])
+ command('windo :set cursorline')
+ feed('0')
+ feed('20l')
+ screen:expect([[
+ {4:a bb cc dd ee ff gg }{3:│}{4:aa bb cc dd ee ff gg^ hh ii jj kk ll mm }|
+ {4: }{3:│} {4: } |
+ {4: }{3:│} {4: } |
+ {4: }{3:│} {4: } |
+ {4: }{3:│} {4: } |
+ {1:~ }{3:│}{1:~ }|
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ |
+ ]])
+ feed('10l')
+ screen:expect([[
+ {4: hh ii jj kk ll mm n}{3:│}{4:aa bb cc dd ee ff gg hh ii jj ^kk ll mm }|
+ {4: } {3:│} {4: } |
+ {4: } {3:│} {4: } |
+ {4: } {3:│} {4: } |
+ {4: } {3:│} {4: } |
+ {1:~ }{3:│}{1:~ }|
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ |
+ ]])
+ command('windo :set nocursorline nocursorcolumn')
+ feed('0')
+ feed('40l')
+ screen:expect([[
+ kk ll mm nn oo pp qq{3:│} bb cc dd ee ff gg hh ii jj kk ll mm n^n|
+ {3:│} |
+ {3:│} |
+ {3:│} |
+ {3:│} |
+ {1:~ }{3:│}{1:~ }|
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ |
+ ]])
+ end)
+end)
diff --git a/test/functional/treesitter/language_spec.lua b/test/functional/treesitter/language_spec.lua
index afb17dd2cf..84e4fa5c49 100644
--- a/test/functional/treesitter/language_spec.lua
+++ b/test/functional/treesitter/language_spec.lua
@@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local eq = helpers.eq
+local command = helpers.command
local exec_lua = helpers.exec_lua
local pcall_err = helpers.pcall_err
local matches = helpers.matches
@@ -67,5 +68,15 @@ describe('treesitter API', function()
end
eq({true,true}, {has_named,has_anonymous})
end)
+
+ it('checks if vim.treesitter.get_parser tries to create a new parser on filetype change', function ()
+ command("set filetype=c")
+ -- Should not throw an error when filetype is c
+ eq('c', exec_lua("return vim.treesitter.get_parser(0):lang()"))
+ command("set filetype=borklang")
+ -- Should throw an error when filetype changes to borklang
+ eq("Error executing lua: .../language.lua:0: no parser for 'borklang' language, see :help treesitter-parsers",
+ pcall_err(exec_lua, "new_parser = vim.treesitter.get_parser(0)"))
+ end)
end)
diff --git a/test/functional/ui/cursor_spec.lua b/test/functional/ui/cursor_spec.lua
index 4c51547e2c..92300a8fa2 100644
--- a/test/functional/ui/cursor_spec.lua
+++ b/test/functional/ui/cursor_spec.lua
@@ -212,10 +212,10 @@ describe('ui/cursor', function()
if m.blinkwait then m.blinkwait = 700 end
end
if m.hl_id then
- m.hl_id = 61
+ m.hl_id = 62
m.attr = {background = Screen.colors.DarkGray}
end
- if m.id_lm then m.id_lm = 62 end
+ if m.id_lm then m.id_lm = 63 end
end
-- Assert the new expectation.
diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua
index 2f113f6ac6..82f856e4df 100644
--- a/test/functional/ui/options_spec.lua
+++ b/test/functional/ui/options_spec.lua
@@ -4,6 +4,7 @@ local clear = helpers.clear
local command = helpers.command
local eq = helpers.eq
local shallowcopy = helpers.shallowcopy
+local eval = helpers.eval
describe('UI receives option updates', function()
local screen
@@ -168,3 +169,42 @@ describe('UI receives option updates', function()
it('from startup options with --headless', function() startup_test(true) end)
it('from startup options with --embed', function() startup_test(false) end)
end)
+
+describe('UI can set terminal option', function()
+ local screen
+ before_each(function()
+ -- by default we implicity "--cmd 'set bg=light'" which ruins everything
+ clear{args_rm={'--cmd'}}
+ screen = Screen.new(20,5)
+ end)
+
+ it('term_background', function()
+ eq('dark', eval '&background')
+
+ screen:attach {term_background='light'}
+ eq('light', eval '&background')
+ end)
+
+ it("term_background but not if 'background' already set by user", function()
+ eq('dark', eval '&background')
+ command 'set background=dark'
+
+ screen:attach {term_background='light'}
+
+ eq('dark', eval '&background')
+ end)
+
+ it('term_name', function()
+ eq('nvim', eval '&term')
+
+ screen:attach {term_name='xterm'}
+ eq('xterm', eval '&term')
+ end)
+
+ it('term_colors', function()
+ eq('256', eval '&t_Co')
+
+ screen:attach {term_colors=8}
+ eq('8', eval '&t_Co')
+ end)
+end)
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua
index 2e60930127..56ff8a4101 100644
--- a/test/functional/ui/searchhl_spec.lua
+++ b/test/functional/ui/searchhl_spec.lua
@@ -109,6 +109,146 @@ describe('search highlighting', function()
]])
end)
+ describe('CurSearch highlight', function()
+ before_each(function()
+ screen:set_default_attr_ids({
+ [1] = {background = Screen.colors.Yellow}, -- Search
+ [2] = {foreground = Screen.colors.White, background = Screen.colors.Black}, -- CurSearch
+ [3] = {foreground = Screen.colors.Red}, -- WarningMsg
+ })
+ command('highlight CurSearch guibg=Black guifg=White')
+ end)
+
+ it('works for match under cursor', function()
+ insert([[
+ There is no way that a bee should be
+ able to fly. Its wings are too small
+ to get its fat little body off the
+ ground. The bee, of course, flies
+ anyway because bees don't care what
+ humans think is impossible.]])
+
+ feed('/bee<CR>')
+ screen:expect{grid=[[
+ There is no way that a {2:^bee} should be |
+ able to fly. Its wings are too small |
+ to get its fat little body off the |
+ ground. The {1:bee}, of course, flies |
+ anyway because {1:bee}s don't care what |
+ humans think is impossible. |
+ {3:search hit BOTTOM, continuing at TOP} |
+ ]]}
+
+ feed('nn')
+ screen:expect{grid=[[
+ There is no way that a {1:bee} should be |
+ able to fly. Its wings are too small |
+ to get its fat little body off the |
+ ground. The {1:bee}, of course, flies |
+ anyway because {2:^bee}s don't care what |
+ humans think is impossible. |
+ /bee |
+ ]]}
+
+ feed('N')
+ screen:expect{grid=[[
+ There is no way that a {1:bee} should be |
+ able to fly. Its wings are too small |
+ to get its fat little body off the |
+ ground. The {2:^bee}, of course, flies |
+ anyway because {1:bee}s don't care what |
+ humans think is impossible. |
+ ?bee |
+ ]]}
+ end)
+
+ it('works for multiline match', function()
+ command([[call setline(1, ['one', 'foo', 'bar', 'baz', 'foo the foo and foo', 'bar'])]])
+ feed('gg/foo<CR>')
+ screen:expect([[
+ one |
+ {2:^foo} |
+ bar |
+ baz |
+ {1:foo} the {1:foo} and {1:foo} |
+ bar |
+ /foo |
+ ]])
+ feed('n')
+ screen:expect([[
+ one |
+ {1:foo} |
+ bar |
+ baz |
+ {2:^foo} the {1:foo} and {1:foo} |
+ bar |
+ /foo |
+ ]])
+ feed('n')
+ screen:expect([[
+ one |
+ {1:foo} |
+ bar |
+ baz |
+ {1:foo} the {2:^foo} and {1:foo} |
+ bar |
+ /foo |
+ ]])
+ feed('n')
+ screen:expect([[
+ one |
+ {1:foo} |
+ bar |
+ baz |
+ {1:foo} the {1:foo} and {2:^foo} |
+ bar |
+ /foo |
+ ]])
+ command([[call setline(5, 'foo')]])
+ feed('0?<CR>')
+ screen:expect([[
+ one |
+ {2:^foo} |
+ bar |
+ baz |
+ {1:foo} |
+ bar |
+ ?foo |
+ ]])
+ feed('gg/foo\\nbar<CR>')
+ screen:expect([[
+ one |
+ {2:^foo} |
+ {2:bar} |
+ baz |
+ {1:foo} |
+ {1:bar} |
+ /foo\nbar |
+ ]])
+ command([[call setline(1, ['---', 'abcdefg', 'hijkl', '---', 'abcdefg', 'hijkl'])]])
+ feed('gg/efg\\nhij<CR>')
+ screen:expect([[
+ --- |
+ abcd{2:^efg} |
+ {2:hij}kl |
+ --- |
+ abcd{1:efg} |
+ {1:hij}kl |
+ /efg\nhij |
+ ]])
+ feed('n')
+ screen:expect([[
+ --- |
+ abcd{1:efg} |
+ {1:hij}kl |
+ --- |
+ abcd{2:^efg} |
+ {2:hij}kl |
+ /efg\nhij |
+ ]])
+ end)
+ end)
+
it('highlights after EOL', function()
insert("\n\n\n\n\n\n")