docs: misc, remove some old help tags #40214

- Remove old help tags: they add noise to cmdline completion.

Co-authored-by: acehinnnqru <acehinnnqru@gmail.com>
Co-authored-by: KangaZero <samuelyongw@gmail.com>
Co-authored-by: Simone Ragusa <hi@interrato.dev>
Co-authored-by: Chinmay Dalal <~chinmay/public-inbox@lists.sr.ht>
Co-authored-by: coyaSONG <66289470+coyaSONG@users.noreply.github.com>
Co-authored-by: Olivia Kinnear <git@superatomic.dev>
This commit is contained in:
Justin M. Keyes
2026-07-18 04:29:51 -04:00
committed by GitHub
parent 1cb0bbe798
commit 446b9d8c55
23 changed files with 212 additions and 269 deletions

View File

@@ -140,8 +140,6 @@ Some can be auto-bumped by `scripts/bump_deps.lua`.
* (Deprecated) [unibilium](https://github.com/neovim/unibilium)
* The original project [was abandoned](https://github.com/neovim/neovim/issues/10302), so the [neovim/unibilium](https://github.com/neovim/unibilium) fork is considered "upstream" and is maintained on the `master` branch.
* **Note:** unibilium is NOT required. See [BUILD.md](./BUILD.md#build-without-unibilium) to build Nvim without unibilium.
* [uncrustify](https://github.com/uncrustify/uncrustify)
* Requires a PR to update the update the [Zig build files](https://github.com/neovim/neovim/tree/master/deps/uncrustify) first.
### Vendored dependencies

View File

@@ -1295,13 +1295,11 @@ nvim_open_term({buf}, {opts}) *nvim_open_term()*
• {buf} (`integer`) Buffer which displays the PTY output. The initial
buffer contents (if any) will be written to the PTY.
• {opts} (`vim.api.keyset.open_term?`) Optional parameters.
• force_crlf: (boolean, default true) Convert "\n" to "\r\n".
• on_input: Lua callback for input sent, i e keypresses in
terminal mode. Note: keypresses are sent raw as they would
be to the pty master end. For instance, a carriage return is
sent as a "\r", not as a "\n". |textlock| applies. It is
possible to call |nvim_chan_send()| directly in the callback
however. `["input", term, bufnr, data]`
• force_crlf: (boolean, default: true) Convert "\n" to "\r\n".
• on_input:
(`fun("input", chan: integer, buf: integer, data: string)`)
Function invoked when the terminal emits bytes, see above.
|textlock| applies. May call |nvim_chan_send()| directly.
Return: ~
(`integer`) Channel id, or 0 on error
@@ -1583,7 +1581,7 @@ nvim_set_hl({ns_id}, {name}, {val}) *nvim_set_hl()*
`ctermfg`.
• font: GUI font name (string). Sets |highlight-font|. Use
"NONE" to clear.
• force: boolean (default false) Update the highlight group
• force: (boolean, default: false) Update the highlight group
even if it already exists.
• italic: boolean
• link: Name of highlight group to link to. |:hi-link|
@@ -1600,8 +1598,8 @@ nvim_set_hl({ns_id}, {name}, {val}) *nvim_set_hl()*
• underdotted: boolean
• underdouble: boolean
• underline: boolean
• update: boolean (default false) Update specified attributes
only, leave others unchanged.
• update: (boolean, default: false) Update specified
attributes only, leave others unchanged.
nvim_set_hl_ns({ns_id}) *nvim_set_hl_ns()*
Set active namespace for highlights defined with |nvim_set_hl()|. This can
@@ -3129,7 +3127,7 @@ nvim_buf_del_extmark({buf}, {ns_id}, {id}) *nvim_buf_del_extmark()*
Parameters: ~
• {buf} (`integer`) Buffer id, or 0 for current buffer
• {ns_id} (`integer`) Namespace id from |nvim_create_namespace()|
• {ns_id} (`integer`) |namespace| id
• {id} (`integer`) Extmark id
Return: ~
@@ -3144,7 +3142,7 @@ nvim_buf_get_extmark_by_id({buf}, {ns_id}, {id}, {opts})
Parameters: ~
• {buf} (`integer`) Buffer id, or 0 for current buffer
• {ns_id} (`integer`) Namespace id from |nvim_create_namespace()|
• {ns_id} (`integer`) |namespace| id
• {id} (`integer`) Extmark id
• {opts} (`vim.api.keyset.get_extmark?`) Optional parameters. Keys:
• details: Whether to include the details dict
@@ -3207,8 +3205,7 @@ nvim_buf_get_extmarks({buf}, {ns_id}, {start}, {end}, {opts})
Parameters: ~
• {buf} (`integer`) Buffer id, or 0 for current buffer
• {ns_id} (`integer`) Namespace id from |nvim_create_namespace()| or -1
for all namespaces
• {ns_id} (`integer`) |namespace| id, or -1 for all namespaces
• {start} (`any`) Start of range: a 0-indexed (row, col) or valid
extmark id (whose position defines the bound). |api-indexing|
• {end} (`any`) End of range (inclusive): a 0-indexed (row, col) or
@@ -3252,7 +3249,7 @@ nvim_buf_set_extmark({buf}, {ns_id}, {line}, {col}, {opts})
Parameters: ~
• {buf} (`integer`) Buffer id, or 0 for current buffer
• {ns_id} (`integer`) Namespace id from |nvim_create_namespace()|
• {ns_id} (`integer`) |namespace| id
• {line} (`integer`) Line where to place the mark, 0-based.
|api-indexing|
• {col} (`integer`) Column where to place the mark, 0-based.
@@ -3448,7 +3445,7 @@ nvim_set_decoration_provider({ns_id}, {opts})
Since: 0.5.0
Parameters: ~
• {ns_id} (`integer`) Namespace id from |nvim_create_namespace()|
• {ns_id} (`integer`) |namespace| id
• {opts} (`vim.api.keyset.set_decoration_provider?`) Table of
callbacks:
• on_buf: called for each buffer being redrawn (once per
@@ -3926,13 +3923,13 @@ nvim_open_win({buf}, {enter}, {config}) *nvim_open_win()*
• "NE" northeast
• "SW" southwest
• "SE" southeast
• border: (`string|string[]`) (defaults to 'winborder'
option) Window border. The string form accepts the same
values as the 'winborder' option. The array form must have
a length of eight or any divisor of eight, specifying the
chars that form the border in a clockwise fashion starting
from the top-left corner. For example, the double-box
style can be specified as: >
• border: (`string|string[]`, default: 'winborder' option)
Window border. The string form accepts the same values as
the 'winborder' option. The array form must have a length
of eight or any divisor of eight, specifying the chars
that form the border in a clockwise fashion starting from
the top-left corner. For example, the double-box style can
be specified as: >
[ "╔", "═" ,"╗", "║", "╝", "═", "╚", "║" ].
<
If fewer than eight chars are given, they will be
@@ -3965,24 +3962,21 @@ nvim_open_win({buf}, {enter}, {config}) *nvim_open_win()*
configuration together with this.
• fixed: If true when anchor is NW or SW, the float window
would be kept fixed even if the window would be truncated.
• focusable: Enable focus by user actions (wincmds, mouse
events). Defaults to true. Non-focusable windows can be
entered by |nvim_set_current_win()|, or, when the `mouse`
field is set to true, by mouse events. See |focusable|.
• footer: (optional) Footer in window border, string or
list. List should consist of `[text, highlight]` tuples.
If string, or a tuple lacks a highlight, the default
• focusable: (default: true) Enable focus by user actions
(wincmds, mouse events). Non-|focusable| windows can be
entered by |nvim_set_current_win()|, or by mouse events if
`mouse=true`.
• footer: (`string|string[]?`) Footer in window border:
string or list of `[text, highlight]` tuples. Default
highlight group is `FloatFooter`.
• footer_pos: Footer position. Must be set with `footer`
option. Value can be one of "left", "center", or "right".
Default is `"left"`.
• footer_pos: (default: "left") Footer position. One of:
"left", "center", "right". The `footer` field must be set
also.
• height: Window height (in character cells). Minimum of 1.
• hide: Hides the floating window. |window-hidden|
• mouse: Specify how this window interacts with mouse
events. Defaults to `focusable` value.
• If false, mouse events pass through this window.
• If true, mouse events interact with this window
normally.
• mouse: (default: `focusable` value) If true, mouse events
interact with the window normally; if false, they pass
through to the window behind it.
• noautocmd: Block all autocommands for the duration of the
call. Cannot be changed by |nvim_win_set_config()|.
• relative: Sets the window layout to "floating", placed at
@@ -4013,9 +4007,9 @@ nvim_open_win({buf}, {enter}, {config}) *nvim_open_win()*
List should consist of `[text, highlight]` tuples. If
string, or a tuple lacks a highlight, the default
highlight group is `FloatTitle`.
• title_pos: Title position. Must be set with `title`
option. Value can be one of "left", "center", or "right".
Default is `"left"`.
• title_pos: (default: "left") Title position. One of:
"left", "center", "right". The `title` field must be set
also.
• vertical: Split vertically |:vertical|.
• width: Window width (in character cells). Minimum of 1.
• win: |window-ID| target window. Can be in a different tab

View File

@@ -178,8 +178,8 @@ DIAGNOSTICS
• Configuring |diagnostic-signs| using |:sign-define| or |sign_define()|. Use
the "signs" key of |vim.diagnostic.config()| instead.
• vim.diagnostic functions:
*vim.diagnostic.disable()* Use |vim.diagnostic.enable()|
*vim.diagnostic.is_disabled()* Use |vim.diagnostic.is_enabled()|
• vim.diagnostic.disable() Use |vim.diagnostic.enable()|
• vim.diagnostic.is_disabled() Use |vim.diagnostic.is_enabled()|
• Legacy signature: `vim.diagnostic.enable(buf:number, namespace:number)`
LSP
@@ -287,38 +287,38 @@ HIGHLIGHTS
LSP DIAGNOSTICS
For each of the functions below, use the corresponding function in
|vim.diagnostic| instead (unless otherwise noted). For example, use
|vim.diagnostic.get()| instead of |vim.lsp.diagnostic.get()|.
|vim.diagnostic.get()| instead of vim.lsp.diagnostic.get().
*vim.lsp.diagnostic.clear()* Use |vim.diagnostic.hide()| instead.
*vim.lsp.diagnostic.disable()* Use |vim.diagnostic.enable()| instead.
*vim.lsp.diagnostic.display()* Use |vim.diagnostic.show()| instead.
*vim.lsp.diagnostic.enable()*
*vim.lsp.diagnostic.get()*
*vim.lsp.diagnostic.get_all()* Use |vim.diagnostic.get()| instead.
*vim.lsp.diagnostic.get_count()* Use |vim.diagnostic.count()| instead.
*vim.lsp.diagnostic.get_line_diagnostics()* Use |vim.diagnostic.get()| instead.
*vim.lsp.diagnostic.get_next()*
*vim.lsp.diagnostic.get_next_pos()*
*vim.lsp.diagnostic.get_prev()*
*vim.lsp.diagnostic.get_prev_pos()*
*vim.lsp.diagnostic.get_virtual_text_chunks_for_line()* No replacement. Use
• vim.lsp.diagnostic.clear() Use |vim.diagnostic.hide()| instead.
• vim.lsp.diagnostic.disable() Use |vim.diagnostic.enable()| instead.
• vim.lsp.diagnostic.display() Use |vim.diagnostic.show()| instead.
• vim.lsp.diagnostic.enable()
• vim.lsp.diagnostic.get()
• vim.lsp.diagnostic.get_all() Use |vim.diagnostic.get()| instead.
• vim.lsp.diagnostic.get_count() Use |vim.diagnostic.count()| instead.
• vim.lsp.diagnostic.get_line_diagnostics() Use |vim.diagnostic.get()| instead.
• vim.lsp.diagnostic.get_next()
• vim.lsp.diagnostic.get_next_pos()
• vim.lsp.diagnostic.get_prev()
• vim.lsp.diagnostic.get_prev_pos()
• vim.lsp.diagnostic.get_virtual_text_chunks_for_line() No replacement. Use
options provided by |vim.diagnostic.config()| to customize virtual text.
*vim.lsp.diagnostic.goto_next()*
*vim.lsp.diagnostic.goto_prev()*
*vim.lsp.diagnostic.redraw()* Use |vim.diagnostic.show()| instead.
*vim.lsp.diagnostic.save()* Use |vim.diagnostic.set()| instead.
*vim.lsp.diagnostic.set_loclist()* Use |vim.diagnostic.setloclist()| instead.
*vim.lsp.diagnostic.set_qflist()* Use |vim.diagnostic.setqflist()| instead.
*vim.lsp.diagnostic.show_line_diagnostics()* Use |vim.diagnostic.open_float()| instead.
*vim.lsp.diagnostic.show_position_diagnostics()* Use |vim.diagnostic.open_float()| instead.
• vim.lsp.diagnostic.goto_next()
• vim.lsp.diagnostic.goto_prev()
• vim.lsp.diagnostic.redraw() Use |vim.diagnostic.show()| instead.
• vim.lsp.diagnostic.save() Use |vim.diagnostic.set()| instead.
• vim.lsp.diagnostic.set_loclist() Use |vim.diagnostic.setloclist()| instead.
• vim.lsp.diagnostic.set_qflist() Use |vim.diagnostic.setqflist()| instead.
• vim.lsp.diagnostic.show_line_diagnostics() Use |vim.diagnostic.open_float()| instead.
• vim.lsp.diagnostic.show_position_diagnostics() Use |vim.diagnostic.open_float()| instead.
The following are deprecated without replacement. These functions are moved
internally and are no longer exposed as part of the API. Instead, use
|vim.diagnostic.config()| and |vim.diagnostic.show()|.
*vim.lsp.diagnostic.set_signs()*
*vim.lsp.diagnostic.set_underline()*
*vim.lsp.diagnostic.set_virtual_text()*
• vim.lsp.diagnostic.set_signs()
• vim.lsp.diagnostic.set_underline()
• vim.lsp.diagnostic.set_virtual_text()
LSP FUNCTIONS
• *vim.lsp.buf.server_ready()*

View File

@@ -10,15 +10,15 @@ patches in order to avoid duplicate work. Run `vim-patch.sh` to see the status
of Vim patches: >bash
./scripts/vim-patch.sh -l
<
Everyone is welcome to |dev-vimpatch-pull-requests| for relevant Vim patches,
but some types of patches are |dev-vimpatch-not-applicable|. See
|dev-vimpatch-quickstart| to get started immediately.
Everyone is welcome to create a |dev-vimpatch-pr| for relevant Vim patches,
but some types of patches are |dev-vimpatch-na|. See |dev-vimpatch-quickstart|
to get started immediately.
Type |gO| to see the table of contents.
==============================================================================
QUICKSTART *dev-vimpatch-quickstart*
QUICKSTART *dev-vimpatch-quickstart*
1. Pull the Nvim source: >bash
git clone https://github.com/neovim/neovim.git
@@ -29,7 +29,7 @@ QUICKSTART *dev-vimpatch-quickstart*
4. Run `./scripts/vim-patch.sh -p 8.0.0123`
5. Follow the instructions given by the script.
NOTES ~
NOTES
- It's strongly recommended to work on the oldest missing patch, because
later patches might depend on the changes.
@@ -44,7 +44,7 @@ NOTES ~
./scripts/vim-patch.sh -L --grep quickfix -- src
<
==============================================================================
PULL REQUESTS *dev-vimpatch-pull-requests*
PULL REQUESTS *dev-vimpatch-pr*
Note: vim-patch.sh automates these steps for you. Use it!
@@ -64,16 +64,16 @@ Reviewers: hint for reviewing `runtime/` patches
https://github.com/neovim/neovim/pull/1744#issuecomment-68202876
==============================================================================
NA (NOT APPLICABLE) PATCHES *dev-vimpatch-not-applicable*
NA (NOT APPLICABLE) PATCHES *dev-vimpatch-na*
Many Vim patches are not applicable to Nvim. If you find NA patches, visit an
open "version.c: update" pull request
Most Vim patches are not applicable to Nvim. If you find NA patches, visit an
the latest "version.c: update" pull request
https://github.com/neovim/neovim/pulls?q=is%3Apr+author%3Aapp%2Fgithub-actions+version.c+is%3Aopen
and mention the NA patches in a comment (please edit/update one comment,
rather than adding a new comment for each patch).
If there are no open `version.c: update` pull requests, include NA patches in
a commit message in the following format:
Or if there is no open `version.c: update` pull request, include NA patches in
a commit message in this format:
>
vim-patch:<version-or-commit>
vim-patch:<version-or-commit>
@@ -82,73 +82,42 @@ a commit message in the following format:
where `<version-or-commit>` is a valid Vim version (like `8.0.0123`) or
commit-id (SHA). Each patch is on a separate line.
It is preferred to include NA patches by squashing it in applicable Vim
patches, especially if the Vim patches are related. First line of the commit
message should be from the applicable Vim patch.
>
./scripts/vim-patch -p <na-patch>
./scripts/vim-patch -p <na-patch>
...
./scripts/vim-patch -P <patch>
git rebase -i master
<
Example:
https://github.com/neovim/neovim/commit/00f60c2ce78fc1280e93d5a36bc7b2267d5f4ac6
Example: https://github.com/neovim/neovim/commit/00f60c2ce78fc1280e93d5a36bc7b2267d5f4ac6
TYPES OF "NOT APPLICABLE" VIM PATCHES ~
------------------------------------------------------------------------------
HOW TO DECIDE IF A VIM-PATCH IS WANTED
- Unwanted features:
- "modelinestrict" https://github.com/neovim/neovim/issues/38985
- "tabpanel"
Legacy Vim is becoming much less relevant to Nvim: we expect to decline the
majority of their patches. Thus this is an "allow-list" instead of
a "deny-list". Generally, only modules explicitly noted in the "OWNED BY VIM"
list below, are in-scope; everything else should be marked "N/A".
OWNED BY VIM
- quickfix
- regex
- runtime files
Everything else is owned by Nvim. Most of Vim's "bug fixes" for e.g.
buffer/window behavior, or the events/autocmds subysytem, or "getchar" (input
engine), just aren't relevant to Nvim anymore, because we've significantly
enhanced and redesigned those subsystems to make them simpler.
UNWANTED VIM-PATCHES
- "channel"
- "job"
- "modelinestrict" https://github.com/neovim/neovim/issues/38985
- "tabpanel"
- "terminal"
- Vim9script features, and anything related to `:scriptversion`. (Nvim
supports Vimscript version 1 only.) Be aware that patches labelled `Vim9:`
may still contain applicable fixes to other parts of the codebase, so these
patch need to be checked individually.
- Updates to `testdir/Makefile` are usually NA because the Makefile implicitly
finds
https://github.com/neovim/neovim/commit/8a677f8a4bff6005fa39f090c14e970c3dfdbe6e#diff-b3c6ad6680a25a1b42095879e3a87104R52
all `test_*.vim` files.
- Compiler warning fixes: Nvim strives to have no warnings at all, and has a
very different build system from Vim.
- Note: Coverity fixes in Vim are relevant to Nvim.
- `*.proto` changes: Nvim autogenerates function prototypes
- `#ifdef` tweaking: For example, Vim decided to enable `FEAT_VISUAL` for all
platforms - but Nvim already does that. Adding new `FEAT_` guards also isn't
relevant to Nvim.
- Legacy system support: Fixes for legacy systems such as Amiga, OS/2 Xenix,
Mac OS 9, Windows older than XP SP2, are not needed because they are not
supported by Nvim.
- NA files: `src/Make_*`, `src/testdir/Make__*`
- `if_*.c` changes: `if_python.c` et. al. were removed.
- Most `term.c` changes: the Nvim TUI uses `libtermkey` to read terminal sequences;
Note: `replace_termcodes()` is applicable and moved to `src/nvim/keycodes.c`.
- `job` patches: incompatible API and implementation
- NA files: `src/channel_*`, `src/job_*`, `src/testdir/test_channel_*`,
`src/testdir/test_job_*`
- `:terminal` patches that modify NA files: incompatible API and
implementation
- NA files: `src/terminal_*`, `src/testdir/test_terminal_*`
- `defaults.vim` patches
- Most GUI-related changes: Nvim GUIs are implemented external to the core C
codebase.
- NA files: `src/gui_*`, `src/gvim_*`, `src/GvimExt/*`, `src/testdir/test_gui*`
- `balloon` changes: Nvim does not support balloon feature
- NA files: `src/beval_*`, `src/testdir/test_balloon_*`
- Screendump tests from `test_popupwin.vim`, `test_popupwin_textprop.vim`:
https://github.com/neovim/neovim/pull/12741#issuecomment-704677141
- json changes: incompatible API https://github.com/neovim/neovim/pull/4131
- NA files: `src/json*`, `src/testdir/test_json.vim`
- `test_restricted.vim` restricted mode is removed in
https://github.com/neovim/neovim/pull/11996
- Many tests in `test_prompt_buffer.vim` require incompatible Vim features
such as `channel`; they should still be included, but skipped
- Non-runtime documentation: Moved to `BUILD.md`, `INSTALL.md`.
- NA files: `Filelist`, `README`, `INSTALL`,
- Anything else might be relevant; err on the side of caution, and post an
issue if you aren't sure.
supports Vimscript version 1 only.)
- Fixes for build warnings.
- GUI-related changes.
- Most new Vimscript functions or Ex commands (with rare exceptions).
==============================================================================
VERSION.C *dev-vimpatch-version.c*
VERSION.C *dev-vimpatch-version.c*
The list of Vim patches in `src/nvim/version.c` is automatically updated
https://github.com/neovim/neovim/pull/7780 based on the presence of
@@ -161,7 +130,7 @@ https://github.com/neovim/neovim/pull/7780 based on the presence of
`vim-patch:8.0.1206`, not `vim-patch:<hash>`.
==============================================================================
CODE DIFFERENCES *dev-vimpatch-code-differences*
CODE DIFFERENCES *dev-vimpatch-diff*
The following functions have been removed or deprecated in favor of newer
alternatives. See `memory.c`
@@ -254,7 +223,7 @@ replaced with an ordinary function call `utfc_ptr2len(...)`.
Nvim. (also see https://github.com/neovim/neovim/pull/16936)
==============================================================================
LIST MANAGEMENT *dev-vimpatch-list-management*
LIST MANAGEMENT *dev-vimpatch-list-impl*
Management of lists (types `list_T` and `listitem_T` from vim) was changed in
https://github.com/neovim/neovim/pull/7708/. There is a lint against the "old"
@@ -291,7 +260,7 @@ Declarations for the table
For more details and some more advanced usage, see `typval.h` and `typval.c`.
==============================================================================
DOCUMENTATION DIFFERENCES *dev-vimpatch-documentation*
DOCUMENTATION DIFFERENCES *dev-vimpatch-doc*
The following should be removed from all imported documentation, and not be
used in new documentation:
@@ -300,7 +269,7 @@ used in new documentation:
made non-optional (see https://github.com/neovim/neovim/wiki/Introduction)
==============================================================================
FILETYPE DETECTION *dev-vimpatch-filetype*
FILETYPE DETECTION *dev-vimpatch-filetype*
Nvim's filetype detection behavior matches Vim, but is implemented as part of
|vim.filetype| (see `$VIMRUNTIME/lua/vim/filetype.lua`). The logic is encoded in

View File

@@ -1161,7 +1161,7 @@ enable({name}, {enable}) *vim.lsp.enable()*
milliseconds).
foldclose({kind}, {winid}) *vim.lsp.foldclose()*
Close all {kind} of folds in the the window with {winid}.
Close all {kind} of folds in the window with {winid}.
To automatically fold imports when opening a file, you can use an autocmd: >lua
vim.api.nvim_create_autocmd('LspNotify', {

View File

@@ -2351,7 +2351,8 @@ vim.filetype.add({filetypes}) *vim.filetype.add()*
followed by the file name. If a match is not found using the filename,
then the filename is matched against the list of |lua-pattern|s (sorted by
priority) until a match is found. Lastly, if pattern matching does not
find a filetype, then the file extension is used.
find a filetype, then the file extension is used. Extension mappings match
only the text after the final dot in the filename.
The filetype can be either a string (in which case it is used as the
filetype directly) or a function. If a function, it takes the full path

View File

@@ -24,7 +24,7 @@ DIAGNOSTICS
• |diagnostic-signs| can no longer be configured with |:sign-define| or
|sign_define()| (deprecated in Nvim 0.10 |deprecated-0.10|).
• Removed |vim.diagnostic.disable()| and |vim.diagnostic.is_disabled()|
• Removed vim.diagnostic.disable() and vim.diagnostic.is_disabled()
(deprecated in Nvim 0.10 |deprecated-0.10|).
• The legacy signature of |vim.diagnostic.enable()| (deprecated in Nvim 0.10
|deprecated-0.10|) is no longer supported.

View File

@@ -37,7 +37,7 @@ LUA
Use range.mark() and range.to_mark() instead.
• pos.to_cursor() returns a (`row,` `col)` tuple
instead of returning them as separate values.
Healthchecks for |vim.ui.img| were moved to `:checkhealth vim.health`.
Renamed current_level param of vim.log.new().
DIAGNOSTICS
@@ -57,7 +57,7 @@ TREESITTER
UI
todo
Healthchecks for |vim.ui.img| were moved to `:checkhealth vim.health`.
VIMSCRIPT
@@ -231,7 +231,7 @@ EDITOR
• |v_al| and |v_il| text objects select the whole buffer and the current line
without leading or trailing white space.
• 'autoread' uses file system watchers to detect external changes in
real-time, instead of only on |FocusGained|/|:checktime|.
real-time, instead of only on |FocusGained| or |:checktime|.
• During |complete()|-triggered completion, CTRL-N and CTRL-P are now subject
to insert-mode mappings.
• Multi-byte characters, translated by 'langmap', now invoke correct
@@ -267,7 +267,7 @@ LSP
• Completon supports `CompletionList.applyKind`: a server can ask for
`commitCharacters` and `data` from `itemDefaults` to be merged with the
item's own values instead of replacing them.
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#completionItemApplyKinds
https://microsoft.github.io/language-server-protocol/specification/#completionItemApplyKinds
• `:checkhealth vim.lsp` highlights the "current buffer".
• |vim.lsp.buf.declaration()|, |vim.lsp.buf.definition()|,
|vim.lsp.buf.type_definition()|, and |vim.lsp.buf.implementation()|

View File

@@ -53,28 +53,6 @@ To disable the built-in directory browser, set this before startup: >lua
vim.g.loaded_nvim_dir_plugin = 1
<
Replacing the directory browser *dir-replace-browser*
To use another directory browser for the current session, delete the
`nvim.dir` autocommand group on or after |VimEnter| and handle |FileType| "directory":
>lua
vim.api.nvim_del_augroup_by_name('nvim.dir')
vim.api.nvim_create_autocmd('FileType', {
pattern = 'directory',
callback = function(args)
require('my_browser').open(args.buf, vim.api.nvim_buf_get_name(args.buf))
end,
})
<
This stops the built-in directory-opening autocommands. The plugin and its
mappings remain loaded.
Define replacement keymaps explicitly, for example: >lua
vim.keymap.set('n', '-', function()
require('my_browser').open_parent()
end)
<
Mappings: *dir-mappings*
>
- Open the parent directory of the current file or directory.
@@ -100,6 +78,29 @@ after use: >vim
<
Use "wipe" to discard all buffer state; see 'bufhidden'.
Replacing the directory browser *dir-disable*
To use another directory browser for the current session, delete the
`nvim.dir` autocommand group on or after |VimEnter| and handle |FileType| "directory":
>lua
vim.api.nvim_del_augroup_by_name('nvim.dir')
vim.api.nvim_create_autocmd('FileType', {
pattern = 'directory',
callback = function(args)
require('my_browser').open(args.buf, vim.api.nvim_buf_get_name(args.buf))
end,
})
<
This stops the built-in directory-opening autocommands. The plugin and its
mappings remain loaded.
Define replacement keymaps explicitly, for example: >lua
vim.keymap.set('n', '-', function()
require('my_browser').open_parent()
end)
<
==============================================================================
Builtin plugin: difftool *difftool*

View File

@@ -5392,7 +5392,7 @@ NormalFloat Normal text in floating windows.
FloatBorder Border of floating windows.
*hl-FloatShadow*
FloatShadow Blended areas when border is "shadow".
*hl-FLoatShadowThrough*
*hl-FloatShadowThrough*
FloatShadowThrough
Shadow corners when border is "shadow".
*hl-FloatTitle*

View File

@@ -790,7 +790,7 @@ Eval:
- *v:sizeofpointer*
Events:
- *SafeStateAgain*
- SafeStateAgain
- *SigUSR1* Use |Signal| to detect `SIGUSR1` signal instead.
Options:

View File

@@ -639,7 +639,7 @@ v:startreason
The reason Nvim started. Possible values:
- "normal" Normal startup, yearning for life, etc.
- "restart" Started by |:restart|.
- "restart!" Started by |:restart!| or |ZR|.
- "restart!" Started by |:restart!|.
Read-only.

View File

@@ -323,7 +323,7 @@ function vim.api.nvim_buf_create_user_command(buf, name, cmd, opts) end
--- Removes an `extmark`.
---
--- @param buf integer Buffer id, or 0 for current buffer
--- @param ns_id integer Namespace id from `nvim_create_namespace()`
--- @param ns_id integer `namespace` id
--- @param id integer Extmark id
--- @return boolean # true if the extmark was found, else false
function vim.api.nvim_buf_del_extmark(buf, ns_id, id) end
@@ -395,7 +395,7 @@ function vim.api.nvim_buf_get_commands(buf, opts) end
--- Gets the position (0-indexed) of an `extmark`.
---
--- @param buf integer Buffer id, or 0 for current buffer
--- @param ns_id integer Namespace id from `nvim_create_namespace()`
--- @param ns_id integer `namespace` id
--- @param id integer Extmark id
--- @param opts vim.api.keyset.get_extmark? Optional parameters. Keys:
--- - details: Whether to include the details dict
@@ -451,7 +451,7 @@ function vim.api.nvim_buf_get_extmark_by_id(buf, ns_id, id, opts) end
--- ```
---
--- @param buf integer Buffer id, or 0 for current buffer
--- @param ns_id integer Namespace id from `nvim_create_namespace()` or -1 for all namespaces
--- @param ns_id integer `namespace` id, or -1 for all namespaces
--- @param start any Start of range: a 0-indexed (row, col) or valid extmark id
--- (whose position defines the bound). `api-indexing`
--- @param end_ any End of range (inclusive): a 0-indexed (row, col) or valid
@@ -606,7 +606,7 @@ function vim.api.nvim_buf_line_count(buf) end
--- range (no highlighting).
---
--- @param buf integer Buffer id, or 0 for current buffer
--- @param ns_id integer Namespace id from `nvim_create_namespace()`
--- @param ns_id integer `namespace` id
--- @param line integer Line where to place the mark, 0-based. `api-indexing`
--- @param col integer Column where to place the mark, 0-based. `api-indexing`
--- @param opts vim.api.keyset.set_extmark? Optional parameters:
@@ -1712,13 +1712,10 @@ function vim.api.nvim_open_tabpage(buf, enter, config) end
--- @param buf integer Buffer which displays the PTY output. The initial buffer contents (if any) will be
--- written to the PTY.
--- @param opts vim.api.keyset.open_term? Optional parameters.
--- - force_crlf: (boolean, default true) Convert "\n" to "\r\n".
--- - on_input: Lua callback for input sent, i e keypresses in terminal
--- mode. Note: keypresses are sent raw as they would be to the pty
--- master end. For instance, a carriage return is sent
--- as a "\r", not as a "\n". `textlock` applies. It is possible
--- to call `nvim_chan_send()` directly in the callback however.
--- `["input", term, bufnr, data]`
--- - force_crlf: (boolean, default: true) Convert "\n" to "\r\n".
--- - on_input: (`fun("input", chan: integer, buf: integer, data: string)`) Function invoked
--- when the terminal emits bytes, see above. `textlock` applies. May call
--- `nvim_chan_send()` directly.
--- @return integer # Channel id, or 0 on error
function vim.api.nvim_open_term(buf, opts) end
@@ -1771,7 +1768,7 @@ function vim.api.nvim_open_term(buf, opts) end
--- - "NE" northeast
--- - "SW" southwest
--- - "SE" southeast
--- - border: (`string|string[]`) (defaults to 'winborder' option) Window border. The string form
--- - border: (`string|string[]`, default: 'winborder' option) Window border. The string form
--- accepts the same values as the 'winborder' option. The array form must have a length of
--- eight or any divisor of eight, specifying the chars that form the border in a clockwise
--- fashion starting from the top-left corner. For example, the double-box style can be
@@ -1811,26 +1808,20 @@ function vim.api.nvim_open_term(buf, opts) end
--- configuration together with this.
--- - fixed: If true when anchor is NW or SW, the float window
--- would be kept fixed even if the window would be truncated.
--- - focusable: Enable focus by user actions (wincmds, mouse events).
--- Defaults to true. Non-focusable windows can be entered by
--- `nvim_set_current_win()`, or, when the `mouse` field is set to true,
--- by mouse events. See `focusable`.
--- - footer: (optional) Footer in window border, string or list.
--- List should consist of `[text, highlight]` tuples.
--- If string, or a tuple lacks a highlight, the default highlight group is `FloatFooter`.
--- - footer_pos: Footer position. Must be set with `footer` option.
--- Value can be one of "left", "center", or "right".
--- Default is `"left"`.
--- - focusable: (default: true) Enable focus by user actions (wincmds, mouse events).
--- Non-`focusable` windows can be entered by `nvim_set_current_win()`, or by mouse events if
--- `mouse=true`.
--- - footer: (`string|string[]?`) Footer in window border: string or list of `[text, highlight]`
--- tuples. Default highlight group is `FloatFooter`.
--- - footer_pos: (default: "left") Footer position. One of: "left", "center", "right". The
--- `footer` field must be set also.
--- - height: Window height (in character cells). Minimum of 1.
--- - hide: Hides the floating window. `window-hidden`
--- - mouse: Specify how this window interacts with mouse events.
--- Defaults to `focusable` value.
--- - If false, mouse events pass through this window.
--- - If true, mouse events interact with this window normally.
--- - mouse: (default: `focusable` value) If true, mouse events interact with the window
--- normally; if false, they pass through to the window behind it.
--- - noautocmd: Block all autocommands for the duration of the call. Cannot be changed by
--- `nvim_win_set_config()`.
--- - relative: Sets the window layout to "floating", placed at (row,col)
--- coordinates relative to:
--- - relative: Sets the window layout to "floating", placed at (row,col) coordinates relative to:
--- - "cursor" Cursor position in current window.
--- - "editor" The global editor grid.
--- - "laststatus" 'laststatus' if present, or last row.
@@ -1854,9 +1845,8 @@ function vim.api.nvim_open_term(buf, opts) end
--- - title: (optional) Title in window border, string or list.
--- List should consist of `[text, highlight]` tuples.
--- If string, or a tuple lacks a highlight, the default highlight group is `FloatTitle`.
--- - title_pos: Title position. Must be set with `title` option.
--- Value can be one of "left", "center", or "right".
--- Default is `"left"`.
--- - title_pos: (default: "left") Title position. One of: "left", "center", "right". The `title`
--- field must be set also.
--- - vertical: Split vertically `:vertical`.
--- - width: Window width (in character cells). Minimum of 1.
--- - win: `window-ID` target window. Can be in a different tab page. Determines the window to
@@ -2148,7 +2138,7 @@ function vim.api.nvim_set_current_win(win) end
---
--- Note: Callbacks will not run for `window-hidden`, as they are not redrawn.
---
--- @param ns_id integer Namespace id from `nvim_create_namespace()`
--- @param ns_id integer `namespace` id
--- @param opts vim.api.keyset.set_decoration_provider? Table of callbacks:
--- - on_buf: called for each buffer being redrawn (once per edit,
--- before window callbacks)
@@ -2224,7 +2214,7 @@ function vim.api.nvim_set_decoration_provider(ns_id, opts) end
--- - fg: Color name or "#RRGGBB", see note.
--- - fg_indexed: boolean. Same as `bg_indexed`, for `fg` and `ctermfg`.
--- - font: GUI font name (string). Sets `highlight-font`. Use "NONE" to clear.
--- - force: boolean (default false) Update the highlight group even if it already exists.
--- - force: (boolean, default: false) Update the highlight group even if it already exists.
--- - italic: boolean
--- - link: Name of highlight group to link to. `:hi-link`
--- - link_global: Like "link", but always resolved in the global namespace (ns=0).
@@ -2239,7 +2229,7 @@ function vim.api.nvim_set_decoration_provider(ns_id, opts) end
--- - underdotted: boolean
--- - underdouble: boolean
--- - underline: boolean
--- - update: boolean (default false) Update specified attributes only, leave others unchanged.
--- - update: (boolean, default: false) Update specified attributes only, leave others unchanged.
function vim.api.nvim_set_hl(ns_id, name, val) end
--- Set active namespace for highlights defined with `nvim_set_hl()`. This can be set for

View File

@@ -671,7 +671,7 @@ vim.v.stacktrace = ...
--- The reason Nvim started. Possible values:
--- - "normal" Normal startup, yearning for life, etc.
--- - "restart" Started by `:restart`.
--- - "restart!" Started by `:restart!` or `ZR`.
--- - "restart!" Started by `:restart!`.
---
--- Read-only.
--- @type string

View File

@@ -2964,6 +2964,7 @@ end
--- the filename is matched against the list of |lua-pattern|s (sorted by priority)
--- until a match is found. Lastly, if pattern matching does not find a
--- filetype, then the file extension is used.
--- Extension mappings match only the text after the final dot in the filename.
---
--- The filetype can be either a string (in which case it is used as the
--- filetype directly) or a function. If a function, it takes the full path and

View File

@@ -1472,7 +1472,7 @@ function lsp.foldexpr(lnum)
return vim.lsp._folding_range.foldexpr(lnum)
end
--- Close all {kind} of folds in the the window with {winid}.
--- Close all {kind} of folds in the window with {winid}.
---
--- To automatically fold imports when opening a file, you can use an autocmd:
---

View File

@@ -245,13 +245,13 @@ local function apply_defaults(item, defaults, apply_kind)
-- Unset means Replace for every field.
apply_kind = apply_kind or {}
local merge_commit_characters = (
apply_kind.commitCharacters == protocol.ApplyKind.Merge and defaults.commitCharacters
)
-- No dedup, it ends up as a flat string anyway.
-- An empty list means no commit chars, not use the defaults.
item.commitCharacters = merge_commit_characters
local merge = apply_kind.commitCharacters == protocol.ApplyKind.Merge
and defaults.commitCharacters
item.commitCharacters = merge
-- No dedup, it ends up as a flat string anyway.
and vim.list_extend(item.commitCharacters or {}, defaults.commitCharacters)
-- An empty list means no commit chars, not use the defaults.
or (item.commitCharacters or defaults.commitCharacters)
item.insertTextFormat = item.insertTextFormat or defaults.insertTextFormat

View File

@@ -191,7 +191,7 @@ static Array extmark_to_array(MTPair extmark, bool id, bool add_dict, bool hl_na
/// Gets the position (0-indexed) of an |extmark|.
///
/// @param buf Buffer id, or 0 for current buffer
/// @param ns_id Namespace id from |nvim_create_namespace()|
/// @param ns_id |namespace| id
/// @param id Extmark id
/// @param opts Optional parameters. Keys:
/// - details: Whether to include the details dict
@@ -274,7 +274,7 @@ nvim_buf_get_extmark_by_id(Buffer buf, Integer ns_id, Integer id, Dict(get_extma
/// ```
///
/// @param buf Buffer id, or 0 for current buffer
/// @param ns_id Namespace id from |nvim_create_namespace()| or -1 for all namespaces
/// @param ns_id |namespace| id, or -1 for all namespaces
/// @param start Start of range: a 0-indexed (row, col) or valid extmark id
/// (whose position defines the bound). |api-indexing|
/// @param end End of range (inclusive): a 0-indexed (row, col) or valid
@@ -394,7 +394,7 @@ ArrayOf(DictAs(get_extmark_item)) nvim_buf_get_extmarks(Buffer buf, Integer ns_i
/// range (no highlighting).
///
/// @param buf Buffer id, or 0 for current buffer
/// @param ns_id Namespace id from |nvim_create_namespace()|
/// @param ns_id |namespace| id
/// @param line Line where to place the mark, 0-based. |api-indexing|
/// @param col Column where to place the mark, 0-based. |api-indexing|
/// @param opts Optional parameters:
@@ -937,7 +937,7 @@ error:
/// Removes an |extmark|.
///
/// @param buf Buffer id, or 0 for current buffer
/// @param ns_id Namespace id from |nvim_create_namespace()|
/// @param ns_id |namespace| id
/// @param id Extmark id
/// @param[out] err Error details, if any
/// @return true if the extmark was found, else false
@@ -1019,7 +1019,7 @@ void nvim_buf_clear_namespace(Buffer buf, Integer ns_id, Integer line_start, Int
///
/// Note: Callbacks will not run for |window-hidden|, as they are not redrawn.
///
/// @param ns_id Namespace id from |nvim_create_namespace()|
/// @param ns_id |namespace| id
/// @param opts Table of callbacks:
/// - on_buf: called for each buffer being redrawn (once per edit,
/// before window callbacks)

View File

@@ -159,7 +159,7 @@ DictAs(get_hl_info) nvim_get_hl(Integer ns_id, Dict(get_highlight) *opts, Arena
/// - fg: Color name or "#RRGGBB", see note.
/// - fg_indexed: boolean. Same as `bg_indexed`, for `fg` and `ctermfg`.
/// - font: GUI font name (string). Sets |highlight-font|. Use "NONE" to clear.
/// - force: boolean (default false) Update the highlight group even if it already exists.
/// - force: (boolean, default: false) Update the highlight group even if it already exists.
/// - italic: boolean
/// - link: Name of highlight group to link to. |:hi-link|
/// - link_global: Like "link", but always resolved in the global namespace (ns=0).
@@ -174,7 +174,7 @@ DictAs(get_hl_info) nvim_get_hl(Integer ns_id, Dict(get_highlight) *opts, Arena
/// - underdotted: boolean
/// - underdouble: boolean
/// - underline: boolean
/// - update: boolean (default false) Update specified attributes only, leave others unchanged.
/// - update: (boolean, default: false) Update specified attributes only, leave others unchanged.
/// @param[out] err Error details, if any
void nvim_set_hl(uint64_t channel_id, Integer ns_id, String name, Dict(highlight) *val, Error *err)
FUNC_API_SINCE(7)
@@ -1136,13 +1136,10 @@ Buffer nvim_create_buf(Boolean listed, Boolean scratch, Error *err)
/// @param buf Buffer which displays the PTY output. The initial buffer contents (if any) will be
/// written to the PTY.
/// @param opts Optional parameters.
/// - force_crlf: (boolean, default true) Convert "\n" to "\r\n".
/// - on_input: Lua callback for input sent, i e keypresses in terminal
/// mode. Note: keypresses are sent raw as they would be to the pty
/// master end. For instance, a carriage return is sent
/// as a "\r", not as a "\n". |textlock| applies. It is possible
/// to call |nvim_chan_send()| directly in the callback however.
/// `["input", term, bufnr, data]`
/// - force_crlf: (boolean, default: true) Convert "\n" to "\r\n".
/// - on_input: (`fun("input", chan: integer, buf: integer, data: string)`) Function invoked
/// when the terminal emits bytes, see above. |textlock| applies. May call
/// |nvim_chan_send()| directly.
/// @param[out] err Error details, if any
/// @return Channel id, or 0 on error
Integer nvim_open_term(Buffer buf, Dict(open_term) *opts, Error *err)

View File

@@ -96,7 +96,7 @@
/// - "NE" northeast
/// - "SW" southwest
/// - "SE" southeast
/// - border: (`string|string[]`) (defaults to 'winborder' option) Window border. The string form
/// - border: (`string|string[]`, default: 'winborder' option) Window border. The string form
/// accepts the same values as the 'winborder' option. The array form must have a length of
/// eight or any divisor of eight, specifying the chars that form the border in a clockwise
/// fashion starting from the top-left corner. For example, the double-box style can be
@@ -136,26 +136,20 @@
/// configuration together with this.
/// - fixed: If true when anchor is NW or SW, the float window
/// would be kept fixed even if the window would be truncated.
/// - focusable: Enable focus by user actions (wincmds, mouse events).
/// Defaults to true. Non-focusable windows can be entered by
/// |nvim_set_current_win()|, or, when the `mouse` field is set to true,
/// by mouse events. See |focusable|.
/// - footer: (optional) Footer in window border, string or list.
/// List should consist of `[text, highlight]` tuples.
/// If string, or a tuple lacks a highlight, the default highlight group is `FloatFooter`.
/// - footer_pos: Footer position. Must be set with `footer` option.
/// Value can be one of "left", "center", or "right".
/// Default is `"left"`.
/// - focusable: (default: true) Enable focus by user actions (wincmds, mouse events).
/// Non-|focusable| windows can be entered by |nvim_set_current_win()|, or by mouse events if
/// `mouse=true`.
/// - footer: (`string|string[]?`) Footer in window border: string or list of `[text, highlight]`
/// tuples. Default highlight group is `FloatFooter`.
/// - footer_pos: (default: "left") Footer position. One of: "left", "center", "right". The
/// `footer` field must be set also.
/// - height: Window height (in character cells). Minimum of 1.
/// - hide: Hides the floating window. |window-hidden|
/// - mouse: Specify how this window interacts with mouse events.
/// Defaults to `focusable` value.
/// - If false, mouse events pass through this window.
/// - If true, mouse events interact with this window normally.
/// - mouse: (default: `focusable` value) If true, mouse events interact with the window
/// normally; if false, they pass through to the window behind it.
/// - noautocmd: Block all autocommands for the duration of the call. Cannot be changed by
/// |nvim_win_set_config()|.
/// - relative: Sets the window layout to "floating", placed at (row,col)
/// coordinates relative to:
/// - relative: Sets the window layout to "floating", placed at (row,col) coordinates relative to:
/// - "cursor" Cursor position in current window.
/// - "editor" The global editor grid.
/// - "laststatus" 'laststatus' if present, or last row.
@@ -179,9 +173,8 @@
/// - title: (optional) Title in window border, string or list.
/// List should consist of `[text, highlight]` tuples.
/// If string, or a tuple lacks a highlight, the default highlight group is `FloatTitle`.
/// - title_pos: Title position. Must be set with `title` option.
/// Value can be one of "left", "center", or "right".
/// Default is `"left"`.
/// - title_pos: (default: "left") Title position. One of: "left", "center", "right". The `title`
/// field must be set also.
/// - vertical: Split vertically |:vertical|.
/// - width: Window width (in character cells). Minimum of 1.
/// - win: |window-ID| target window. Can be in a different tab page. Determines the window to

View File

@@ -2273,8 +2273,7 @@ static void patch_terminfo_bugs(TUIData *tui, const char *term, const char *colo
// rxvt-unicode has a default steady block cursor, though there's an option
// to initialize it with an underline https://cvs.schmorp.de/rxvt-unicode/src/init.C?revision=1.351&view=markup#l727
// \x1b[0 q doesn't work because it makes it a blinking block https://cvs.schmorp.de/rxvt-unicode/src/command.C?revision=1.605&view=markup#l4122
// We can't really account for that, so just set it to steady block and hope
// for the best.
// We can't really account for that, so just set it to steady block and hope for the best.
terminfo_set_str(tui, kTerm_reset_cursor_style, "\x1b[2 q");
terminfo_set_str(tui, kTerm_set_cursor_style, "\x1b[%p1%d q");
} else if (screen) {

View File

@@ -784,7 +784,7 @@ M.vars = {
The reason Nvim started. Possible values:
- "normal" Normal startup, yearning for life, etc.
- "restart" Started by |:restart|.
- "restart!" Started by |:restart!| or |ZR|.
- "restart!" Started by |:restart!|.
Read-only.
]=],

View File

@@ -26,7 +26,7 @@ describe('fnamemodify()', function()
n.rmdir('foo')
end)
it('handles the root path', function()
it('root path', function()
local root = assert(t.fix_slashes(n.pathroot()))
eq(root, fnamemodify([[/]], ':p:h'))
eq(root, fnamemodify([[/]], ':p'))
@@ -54,7 +54,7 @@ describe('fnamemodify()', function()
end
end)
it('handles an unknown user in a fast event #40707', function()
it('~user in a fast event #40707', function()
exec_lua([[
local timer = assert(vim.uv.new_timer())
timer:start(0, 0, function()
@@ -72,11 +72,11 @@ describe('fnamemodify()', function()
eq(expected, exec_lua('return _G.result'))
end)
it(':8 works', function()
it(':8 (DOS 8.3 short format)', function()
eq('Xtest-fnamemodify.txt', fnamemodify([[Xtest-fnamemodify.txt]], ':8'))
end)
it('handles examples from ":help filename-modifiers"', function()
it('examples from ":help filename-modifiers"', function()
-- src/ cannot be a symlink in this test.
n.api.nvim_set_current_dir(t.paths.test_source_path)
@@ -105,7 +105,7 @@ describe('fnamemodify()', function()
eq('src/main.c', fnamemodify(filename, ':s?version?main?'))
end)
it('handles advanced examples from ":help filename-modifiers"', function()
it('advanced examples from ":help filename-modifiers"', function()
local filename = 'src/version.c.gz'
eq('gz', fnamemodify(filename, ':e'))
@@ -121,7 +121,7 @@ describe('fnamemodify()', function()
eq('src/version', fnamemodify(filename, ':r:r:r'))
end)
it('handles :h', function()
it(':h', function()
-- generic path
eq('.', fnamemodify('hello.txt', ':h'))
-- Repeated ":h" on a bare name: the first ":h" replaces the buffer with ".", the
@@ -183,27 +183,27 @@ describe('fnamemodify()', function()
end
end)
it('handles :t', function()
it(':t', function()
eq('hello.txt', fnamemodify('hello.txt', ':t'))
eq('hello.txt', fnamemodify('path/to/hello.txt', ':t'))
end)
it('handles :r', function()
it(':r', function()
eq('hello', fnamemodify('hello.txt', ':r'))
eq('path/to/hello', fnamemodify('path/to/hello.txt', ':r'))
end)
it('handles :e', function()
it(':e', function()
eq('txt', fnamemodify('hello.txt', ':e'))
eq('txt', fnamemodify('path/to/hello.txt', ':e'))
end)
it('handles regex replacements', function()
it('regex replacements', function()
eq('content-there-here.txt', fnamemodify('content-here-here.txt', ':s/here/there/'))
eq('content-there-there.txt', fnamemodify('content-here-here.txt', ':gs/here/there/'))
end)
it('handles shell escape', function()
it('shell escape', function()
local expected
if is_os('win') then