Commit Graph

2697 Commits

Author SHA1 Message Date
bfredl
4df11463b2
Merge pull request #15674 from yatli/ui_event_extmark
API/UI: ui_event_extmark
2022-05-03 16:59:24 +02:00
ii14
70e2c5d10d
feat(lsp): add logging level "OFF" (#18379) 2022-05-03 08:49:23 -06:00
Yatao Li
29a6cda3ff feat(api/ui): win_extmarks 2022-05-03 22:26:02 +08:00
dundargoc
73741e9486
feat(lua): vim.deprecate() #18320
This is primarily intended to act as documentation for the developer so
they know exactly when and what to remove. This will help prevent the
situation of deprecated code lingering for far too long as developers
don't have to worry if a function is safe to remove.
2022-05-03 06:42:41 -07:00
Justin M. Keyes
4fb48c5654
feat(server): set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009
PROBLEM
------------------------------------------------------------------------
$NVIM_LISTEN_ADDRESS has conflicting purposes as both a parameter ("the
current process should listen on this address") and a descriptor ("the
current process is a child of this address").

This contradiction means the presence of NVIM_LISTEN_ADDRESS is
ambiguous, so child Nvim always tries to listen on its _parent's_
socket. This is the cause of lots of  "Failed to start server" spam in
our test/CI logs:

    WARN  2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-4480-0
    WARN  2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-2168-0

SOLUTION
------------------------------------------------------------------------

1. Set $NVIM to the parent v:servername, *only* in child processes.
   - Now the correct way to detect a "parent" Nvim is to check for $NVIM.
2. Do NOT set $NVIM_LISTEN_ADDRESS in child processes.
3. On startup if $NVIM_LISTEN_ADDRESS exists, unset it immediately after
   server init.
4. Open a channel to parent automatically, expose it as v:parent.

Fixes #3118
Fixes #6764
Fixes #9336
Ref https://github.com/neovim/neovim/pull/8247#issuecomment-380275696
Ref #8696
2022-05-03 06:08:35 -07:00
bfredl
ad63b94b03 refactor(ui): simplify stdin handling 2022-05-02 22:19:41 +02:00
Christian Clason
65b4bf055f
docs: syntax is enabled by default (#17637)
`:syntax enable` is no longer necessary (and may even be harmful). Do not recommend it in `usr_05.txt` and `usr_06.txt`, and mention the new default in `syntax.txt`.
2022-05-01 13:31:49 +02:00
ii14
7502f1cae0
docs(api): more API attributes #18336 2022-04-30 16:16:16 -07:00
Famiu Haque
7e10b0dae6
docs: move "hl-VertSplit" to deprecated.txt #18328 2022-04-30 15:23:30 -07:00
bfredl
cc27540560
Merge pull request #18231 from famiu/feat/api/parse_cmdline
feat(api): `nvim_parse_cmd`
2022-04-30 18:41:17 +02:00
Mathias Fußenegger
88411613e2
feat(lsp): add async option to vim.lsp.buf.format (#18322)
Deprecates the existing `vim.lsp.buf.formatting` function.
With this, `vim.lsp.buf.format` will replace all three:

- vim.lsp.buf.formatting
- vim.lsp.buf.formatting_sync
- vim.lsp.buf.formatting_seq_sync
2022-04-30 17:23:50 +02:00
Famiu Haque
8dbb11ebf6 feat(api): add nvim_parse_cmdline
Adds an API function to parse a command line string and get command information from it.
2022-04-30 21:04:51 +06:00
Michael Lingelbach
5b04e46d23
feat(lsp): add vim.lsp.buf.format (#18193) 2022-04-30 15:36:40 +02:00
Michael Lingelbach
c618b314c6
chore(lsp): remove capabilities sanitization (#17814)
* feat(lsp)!: remove capabilities sanitization

Users must now access client.server_capabilities which matches the same
structure as the protocol.

https://microsoft.github.io/language-server-protocol/specification

client.resolved_capabilities is no longer used to gate capabilities, and
will be removed in a future release.

BREAKING CHANGE


Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2022-04-30 11:22:30 +02:00
Fredrik Ekre
df09e03cf7
feat(lsp): options to filter and auto-apply code actions (#18221)
Implement two new options to vim.lsp.buf.code_action():
 - filter (function): predicate taking an Action as input, and returning
   a boolean.
 - apply (boolean): when set to true, and there is just one remaining
   action (after filtering), the action is applied without user query.

These options can, for example, be used to filter out, and automatically
apply, the action indicated by the server to be preferred:

    vim.lsp.buf.code_action({
        filter = function(action)
            return action.isPreferred
        end,
        apply = true,
    })

Fix #17514.
2022-04-30 10:14:31 +02:00
zeertzjq
7ac5359143 feat(mappings): do not simplify the rhs of a mapping 2022-04-29 21:12:48 +08:00
zeertzjq
3601cef137 feat(mappings): do not replace existing mapping for simplified form 2022-04-29 15:51:04 +08:00
zeertzjq
3090648584 test: revert test and doc changes from #6724, add a test for #6716
Multi-char 'pastetoggle' now works without breaking character-find.
2022-04-29 15:51:04 +08:00
zeertzjq
d531ef6813 vim-patch:8.2.0867: using \{xxx} for encoding a modifier is not nice
Problem:    Using \{xxx} for encoding a modifier is not nice.
Solution:   Use \<*xxx> instead, since it's the same as \<xxx> but producing a
            different code.
fccd93f091

Use this notation in langmap_spec.
2022-04-29 15:51:04 +08:00
zeertzjq
abe91e1efe vim-patch:8.2.0855: GUI tests fail because the test doesn't use a modifier
Problem:    GUI tests fail because the test doesn't use a modifier.
Solution:   Add "\{xxx}" to be able to encode a modifier.
ebe9d34aa0

Change macros to enums to use them in unit tests.
2022-04-29 15:51:04 +08:00
zeertzjq
212349c100 feat(edit): insert an unsimplified key using CTRL-SHIFT-V
This marks the following Vim patches as ported:

vim-patch:8.1.2333: with modifyOtherKeys CTRL-^ doesn't work

Problem:    With modifyOtherKeys CTRL-^ doesn't work.
Solution:   Handle the exception.
828ffd5963

vim-patch:8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys

Problem:    Other text for CTRL-V in Insert mode with modifyOtherKeys.
Solution:   Convert the Escape sequence back to key as if modifyOtherKeys is
            not set, and use CTRL-SHIFT-V to get the Escape sequence itself.
            (closes vim/vim#5254)
fc4ea2a72d

vim-patch:8.2.2084: CTRL-V U doesn't work to enter a Unicode character

Problem:    CTRL-V U doesn't work to enter a Unicode character when
            modifyOtherKeys is effective. (Ken Takata)
Solution:   Add a flag to get_literal() for the shift key. (closes vim/vim#7413)
0684e36a7e

Omit getcmdkeycmd() change as it depends on Vim patch 8.2.2062, which
may introduce a potential breakage.
2022-04-29 15:51:03 +08:00
Christian Clason
521e91e1c4
vim-patch:ce001a337e28 (#18287)
Update runtime files
ce001a337e

also add `vimStdPlugin` keywords missing from previous updates
2022-04-27 17:48:35 +02:00
erw7
5f3018fa1a
refactor(terminal)!: drop winpty, require Windows 10 #18253
Problem:
winpty is only needed for Windows 8.1. Removing it reduces our build and code
complexity.

Solution:
- Remove winpty.
- Require Windows 10.

closes #18252
2022-04-26 21:17:06 -07:00
Gregory Anders
5d159a7faa
feat(tui): query terminal for CSI u support (#18181)
On startup query the terminal for CSI u support and enable it using
the escape sequence from kitty's progressive enhancement protocol [1].

[1]: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
2022-04-25 20:49:45 -06:00
zeertzjq
e6974114fb vim-patch:8.2.4760: using matchfuzzy() on a long list can take a while
Problem:    Using matchfuzzy() on a long list can take a while.
Solution:   Add a limit to the number of matches. (Yasuhiro Matsumoto,
            closes vim/vim#10189)
9029a6e993
2022-04-26 08:06:32 +08:00
Gregory Anders
2dddc86a42
fix: show autocmd output when F is in shortmess (#18251)
The default value of including F in 'shortmess' has the unfortunate side
effect of hiding output from autocommands. This is a common source of
confusion and often leads people to think their autocommands are not
working when they are. There is a small snippet in the docs for
'shortmess' indicating that the F flag suppresses autocmd output, but
it's not easy to find if you don't already know to look for it.

This commit removes that behavior of the F flag to make it only suppress
file info when opening a new file.
2022-04-25 08:44:18 -06:00
Joel Bradshaw
b7717ed450
docs: clarify enhanced modifiers, SHIFT usage #18124
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-04-24 18:46:56 -07:00
dundargoc
92f7286377
docs: make docstring consistent with parameters #18178
Closes: https://github.com/neovim/neovim/issues/12691
2022-04-23 17:01:01 -07:00
Christian Clason
6c8a3013ac
docs(lua): explain and link to lua patterns (#18206)
also correct explanation of when it's allowed to omit parens in Lua function calls
2022-04-21 21:46:07 +02:00
atusy
5ecbbba6ee docs: vim.keymap.set can specify buffer as an option 2022-04-21 10:45:39 +09:00
Christian Clason
85b13f6db4
docs(filetype): proper example for did_load_filetypes (#18191) 2022-04-20 21:41:35 +02:00
Mathias Fußenegger
a48a0a4f7b
docs(api): add example showing necessity to wrap callback function (#18179)
Some people ran into issues trying to use `callback = myluafun` because
of the event data payload.


Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2022-04-20 18:42:07 +02:00
bfredl
81f1e33d15
Merge pull request #18145 from bfredl/term_opt
feat(api): allow remote UI to set terminal options
2022-04-20 14:50:04 +02:00
bfredl
245858460f
Merge pull request #18157 from famiu/feat/undo!
feat: add `undo!`
2022-04-19 20:55:49 +02:00
Famiu Haque
1e3d9c7dbc feat: add undo!
Allows using `undo!` to undo changes and remove them from the undo-tree. Can only be used for moving backwards in the same undo branch.
2022-04-20 00:10:02 +06:00
bfredl
dbc4af7186
Merge pull request #18081 from famiu/feat/highlight/cursearch
feat(highlight): implement CurSearch highlight
2022-04-19 18:56:51 +02:00
Christian Clason
0124a7bfa9
vim-patch:75ab590f8504 (#18170)
Update runtime files
75ab590f85

omit builtin.txt change to `expand()` (depends on 8.2.4726)
2022-04-19 15:14:17 +02:00
dundargoc
e73ef5c092
docs(terminal): correct sentence on how to enter terminal mode (#18146)
`o`/`O` is not supported for terminal mode
2022-04-18 11:49:06 +02:00
Famiu Haque
b16afe4d55 feat(highlight): implement CurSearch highlight
Adds a `CurSearch` highlight group to highlight the current search result under the cursor.
2022-04-17 19:24:59 +06:00
hlpr98
d63ad42e49 feat(api): ui options relevant for remote TUI 2022-04-17 11:41:56 +02:00
dundargoc
e63e5d1dbd
docs: typo fixes (#17859)
Co-authored-by: Elias Alves Moura <eliamoura.alves@gmail.com>
Co-authored-by: venkatesh <shariharanvenkatesh@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Vikas Raj <24727447+numToStr@users.noreply.github.com>
Co-authored-by: Steve Vermeulen <sfvermeulen@gmail.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: rwxd <rwxd@pm.me>
Co-authored-by: casswedson <58050969+casswedson@users.noreply.github.com>
2022-04-15 12:35:06 +02:00
Christian Clason
8486c87e58
vim-patch:8.2.4747: no filetype override for .sys files (#18105)
Problem:    No filetype override for .sys files.
Solution:   Add g:filetype_sys. (Patrick Meiser-Knosowski, closes vim/vim#10181)
f420ff2440
2022-04-13 23:11:56 +02:00
Gregory Anders
9a35704333
Merge pull request #15491 from Diomendius/lua_docs
docs(lua): fix, clarify Lua require() docs
2022-04-13 10:50:03 -06:00
zeertzjq
b69ecacbb4 vim-patch:partial:a2baa73d1d33
Update runtime files.
a2baa73d1d

This only includes changes to docs of digraph functions.
2022-04-12 21:26:46 +08:00
zeertzjq
3b0bcb8ad0 vim-patch:8.2.3226: new digraph functions use old naming scheme
Problem:    New digraph functions use old naming scheme.
Solution:   Use the digraph_ prefix. (Hirohito Higashi, closes vim/vim#8580)
29b857150c
2022-04-12 21:26:46 +08:00
zeertzjq
cbc54cf484 vim-patch:8.2.3184: cannot add a digraph with a leading space
Problem:    Cannot add a digraph with a leading space.  It is not easy to list
            existing digraphs.
Solution:   Add setdigraph(), setdigraphlist(), getdigraph() and
            getdigraphlist(). (closes vim/vim#8580)
6106504e9e

Use GA_APPEND_VIA_PTR in registerdigraph().
Use tv_list_append_*() in getdigraphlist_appendpair().
Put the error messages in digraph.c.
E196 is N/A.
Remove mentions about 'encoding' being non-Unicode.
Nvim doesn't support setting encoding=japan, so skip a test.
2022-04-12 21:26:30 +08:00
zeertzjq
53668a5815 vim-patch:8.2.4713: plugins cannot track text scrolling
Problem:    Plugins cannot track text scrolling.
Solution:   Add the WinScrolled event. (closes vim/vim#10102)
0937182d49

Skip User event in autocmd.txt, not needed unless #10689 is reverted.
2022-04-12 05:02:05 +08:00
zeertzjq
da31e953b6
docs(term.txt): add documentation about TUI input (#18072) 2022-04-11 23:22:04 +08:00
Gregory Anders
379067d038 docs: update dev-api to include "create" 2022-04-10 20:45:17 -06:00
Gregory Anders
f94f75dc05 refactor!: rename nvim_add_user_command to nvim_create_user_command 2022-04-10 20:18:41 -06:00
Loong Wang
b2cb05b53e
feat(events): support SIGWINCH for Signal event #18029
closes #15411
2022-04-10 15:56:08 -07:00
UnkwUsr
8f3845cdb7
docs: remove mentions of removed flag '#' in 'cpoptions' (#18064) 2022-04-10 14:58:01 +02:00
zeertzjq
ff726cc569
vim-patch:8.2.4719: ">" marker sometimes not displayed in the jumplist (#18056)
Problem:    ">" marker sometimes not displayed in the jumplist.
Solution:   If the buffer no longer exists show "-invalid-". (Christian
            Brabandt, closes vim/vim#10131, closes vim/vim#10100)
a0f659c76e

Add a modeline to test_jumplist.vim
2022-04-10 07:13:22 +08:00
Christian Clason
3280dc2b60
vim-patch:8.2.4720: ABB Rapid files are not recognized properly (#18057)
Problem:    ABB Rapid files are not recognized properly.
Solution:   Add checks for ABB Rapid files. (Patrick Meiser-Knosowski,
            closes #10104)
b09c320039
2022-04-09 17:42:46 +02:00
zeertzjq
f3183a4d7c
Merge pull request #18023 from tom-anders/vim-8.2.4702
vim-patch:8.2.{4702,4703}: C++ scope labels are hard-coded
2022-04-09 22:13:34 +08:00
Tom Praschan
45f62464d3 vim-patch:8.2.4702: C++ scope labels are hard-coded
Problem:    C++ scope labels are hard-coded.
Solution:   Add 'cinscopedecls' to define the labels. (Tom Praschan,
            closes vim/vim#10109)
3506cf34c1
2022-04-09 15:39:46 +02:00
Sean Dewar
012c055804
vim-patch:partial:cbaff5e06ec5 (#18044)
Update runtime files
cbaff5e06e

Docs only.

Omit json_encode (different impl, Nvim throws E474 instead; see v8.2.4695).
Skip <MouseMove> (Nvim *kinda* has <MouseMove>, but most of this doc needs
  v8.2.4674 anyway...).
Nvim's 'hidden' doc was reworded somewhat, so manually integrate the changes
  (8331cd13c4).
Also apply "comma-separated" changes to all possible places in options.txt.
Cherry-pick *highlight-clear* tag from v8.2.3578.
2022-04-08 22:40:56 +02:00
Christian Clason
d3068d34cc
vim-patch:partial:cbaff5e06ec5 (#18042)
Update runtime files
cbaff5e06e

omit doc updates here
2022-04-08 19:53:41 +02:00
Gregory Anders
30bc02c636 feat(api)!: pass args table to autocommand callbacks 2022-04-08 15:12:54 +02:00
Christian Clason
2a46600140
docs(options): add more missing 'nofoo' tags (#17967) 2022-04-02 15:24:10 +02:00
Christian Clason
e6bd9eee15
docs(options): add missing 'nofoo' tags (#17965) 2022-04-02 14:08:04 +02:00
Lewis Russell
3cc29b7f0d fix(keymap): don't coerce false to '' 2022-04-01 09:09:30 +01:00
bfredl
dc48330b9d
Merge pull request #17842 from lewis6991/keymap
feat(keymap): return nil from an expr keymap
2022-04-01 00:48:46 +02:00
bfredl
80d4d6b486
Merge pull request #17938 from ggandor/autocmd-api-names
refactor(api)!: use singular/plural consistently in the autocmd API
2022-04-01 00:35:21 +02:00
György Andorka
9d40b2fda9 refactor(api)!: use singular/plural consistently in the autocmd API 2022-03-31 23:58:47 +02:00
dundargoc
ebab51b192
docs(extmark): fix nvim_buf_get_extmarks example (#17934) 2022-03-31 18:05:17 +02:00
TJ DeVries
b80651eda9 feat(api): nvim_clear_autocmd
Co-authored-by: Christian Clason <christian.clason@uni-due.de>
2022-03-31 14:30:42 +02:00
Andrea Cappuccio
a18c9ba2da
docs(lsp): remove outdated offset_encoding default value for apply_text_edits 2022-03-30 21:04:17 +02:00
dundargoc
ac1dd046c0
vim-patch:46eea444d (#17920)
Update runtime files
46eea444d9

Skip repeat.txt as it only has vim9-specific changes.
2022-03-30 12:12:12 +01:00
zeertzjq
b2819eec26 docs(pattern.txt): cherry-pick latests changes from Vim runtime updates
Update runtime files
53f7fccc94

Update runtime files
2286304cdb

Update runtime files
2f0936cb9a

Update runtime files.
a2baa73d1d
2022-03-30 08:35:13 +08:00
zeertzjq
1bbe8ec282 vim-patch:8.2.3110: a pattern that matches the cursor position is complicated
Problem:    A pattern that matches the cursor position is bit complicated.
Solution:   Use a dot to indicate the cursor line and column. (Christian
            Brabandt, closes vim/vim#8497, closes vim/vim#8179)
04db26b360

Also use `n = ++vcol` in regexp_bt.c as `++vcol` alone fails lint.
2022-03-30 08:35:13 +08:00
zeertzjq
d89a80fafc
docs: update hl-Whitespace documentation (#17901) 2022-03-29 07:38:29 +02:00
Justin M. Keyes
72652cbc46
feat(test): use nvim_exec in helpers.source() #16064
helpers.source() was a hack to work around the lack of anonymous
:source. Its "create tempfile" behavior is not a required part of most
tests that use it.

Some tests still need the old "create tempfile" behavior either because
they test SID behavior, or because of missing nvim_exec features: #16071
2022-03-27 10:25:55 -07:00
zeertzjq
a86d3d3780
docs: correct CursorMoved documentation (#17880)
behavior was changed in https://github.com/neovim/neovim/pull/9807
2022-03-27 11:02:44 +02:00
Javier Lopez
a490db5ba8
refactor!: rename nvim_do_autocmd to nvim_exec_autocmd (#17854)
according to established code standards (`:h dev-api`)
2022-03-26 15:34:56 +01:00
かわえもん
85821d8b6f
docs(api): fix wrong documentation of nvim_create_autocmd (#17870)
also add doc changes from typofix PR
2022-03-26 13:21:32 +01:00
dundargoc
61205c1def
chore: fix typos (#17755)
Co-authored-by: Jordan Haine <jhaine@securitycompass.com>
2022-03-25 19:57:59 +01:00
Javier Lopez
174deafcef
docs(api): improve autocommand docs (#17545)
[skip ci]
2022-03-25 19:24:53 +01:00
Michael Lingelbach
69f1de86dc
feat: add vim.tbl_get (#17831)
vim.tbl_get takes a table with subsequent string arguments (variadic) that
index into the table. If the value pointed to by the set of keys exists,
the function returns the value. If the set of keys does not exist, the
function returns nil.
2022-03-24 12:01:04 -07:00
Lewis Russell
58140a9428 feat(keymap): return nil from an expr keymap
For Lua callback expr keymaps, returning `nil` or `false` is equivalent
to an empty string
2022-03-24 13:59:20 +00:00
zeertzjq
f5a3edb0c0
refactor: remove cpo-& behavior (#17745)
cpo-& has been removed, but its behavior was accidentally made the
default behavior. That should be removed instead.
2022-03-23 19:52:50 +08:00
marvim
809dd65396 docs: regenerate [skip ci] 2022-03-20 18:00:30 +00:00
Tim Pope
af427dedf6
fix(lsp): set tabSize from 'shiftwidth', not 'softtabstop' (#17787)
The use of 'softtabstop' to set tabSize was introduced in 5d5b068,
replacing 'tabstop'.  If we look past the name tabSize and at the actual
purpose of the field, it's the indentation width used when formatting.
This corresponds to the Vim option 'shiftwidth', not 'softtabstop'.
The latter has the comparatively mundane purpose of controlling what
happens when you hit the tab key (and even this is incomplete, as it
fails to account for 'smarttab').
2022-03-20 10:41:46 -07:00
Christian Clason
75157d2572
vim-patch:47c532e2bc55 (#17780)
Update runtime files
47c532e2bc
2022-03-20 10:48:10 +01:00
Xiretza
f2e5f509d9
docs: reword description for nvim_buf_line_count() (#17766)
This adds a few more keywords to make the function easier to find.
2022-03-18 19:58:00 +01:00
bfredl
3c7e937a89
Merge pull request #17266 from famiu/feat/ui/global-statusline
feat(statusline): add global statusline
2022-03-17 20:16:39 +01:00
Famiu Haque
5ab1229174 feat: add support for global statusline
Ref: #9342

Adds the option to have a single global statusline for the current window at the bottom of the screen instead of a statusline at the bottom of every window. Enabled by setting `laststatus = 3`.

Due to the fact that statuslines at the bottom of windows are removed when global statusline is enabled, horizontal separators are used instead to separate horizontal splits. The horizontal separator character is configurable through the`horiz` item in `'fillchars'`. Separator connector characters are also used to connect the horizontal and vertical separators together, which are also configurable through the `horizup`, `horizdown`, `vertleft`, `vertright` and `verthoriz` items in `fillchars`.

The window separators are highlighted using the `WinSeparator` highlight group, which supersedes `VertSplit` and is linked to `VertSplit` by default in order to maintain backwards compatibility.
2022-03-18 00:21:41 +06:00
dundargoc
d238b8f600
chore: fix typos (#17670)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-03-17 13:21:24 +08:00
James McCoy
746a29c580
Merge pull request #17707 from tesaguri/refactor-gen_vimdoc 2022-03-16 16:13:59 -04:00
Sean Dewar
c5f190e0c2
vim-patch:8.2.1401: cannot jump to the last used tabpage
Problem:    Cannot jump to the last used tabpage.
Solution:   Add g<Tab> and tabpagnr('#'). (Yegappan Lakshmanan, closes vim/vim#6661,
            neovim #11626)
62a232506d

Nvim implemented this feature before Vim, but Vim made some useful changes (e.g:
beeping on failure). Port the changes to closer match Vim (also makes porting
future patches easier).

Also note that because CHECK_CMDWIN was added to goto_tabpage_tp, there is no
need to do the extra work with tabpage_index and goto_tabpage inside
goto_tabpage_lastused to fix cmdwin issues any more (#11692).
Note that while goto_tabpage_tp doesn't check for textlock like goto_tabpage
does, it shouldn't matter as it is already checked for earlier.

Add tags for <C-Tab> to tabpage.txt, and refer to <C-Tab> over CTRL-Tab to be
consistent with other docs like the patch.
Remove mention of "previous tabpage" (it can be confused with the tabpage to the
left, e.g: `:tabprevious`).
Similarly, don't rename old_curtab to last_tab in enter_tabpage (it might be
confused with the right-most tabpage, e.g: `:tablast`).

Cherry-pick Test_tabpage change from v8.2.0634.
92b83ccfda
2022-03-14 13:10:57 +00:00
Daiki Mizukami
ecc36c3d1c
docs: remove extra whitespaces 2022-03-14 08:16:01 +09:00
Daiki Mizukami
be2def4100
chore(gen_vimdoc): fall back to brief_desc_node when desc_node is empty 2022-03-14 07:53:42 +09:00
adrian5
9e6bc228ec
docs(api): improve section on nvim_set_hl (#17692) 2022-03-13 06:42:12 -06:00
Jan Edmund Lazo
163ec00f44 vim-patch:8.1.1015: quickfix buffer shows up in list, can't get buffer number
Problem:    Quickfix buffer shows up in list, can't get buffer number.
Solution:   Make the quickfix buffer unlisted when the quickfix window is
            closed.  get the quickfix buffer number with getqflist().
            (Yegappan Lakshmanan, closes vim/vim#4113)
647e24ba3d
2022-03-13 13:17:28 +08:00
Gregory Anders
f291a0339c
fix: use normal! <C-L> in default <C-L> mapping (#17695) 2022-03-12 17:56:53 -07:00
zeertzjq
d4982e152c
vim-patch:partial:a2baa73d1d33 (#17675)
Update runtime files.
a2baa73d1d

Cherry-pick tabpage.txt changes from patch 8.2.1413.
Skip digraph functions: included in #17440.
Skip many error codes as they haven't been ported yet.
2022-03-12 06:52:54 +08:00
dundargoc
84af45f59f
docs: remove "not in vi" notes (#17678)
[skip ci]
2022-03-11 22:25:59 +00:00
Charlie Groves
29c3632285 fix(remote): report on missing wait commands, typecheck lua results
Clean up lint errors, too
2022-03-11 11:16:46 -05:00
Charlie Groves
e095a868cb docs(remote): update remote.txt for current nvim implementation 2022-03-11 11:16:46 -05:00
Charlie Groves
fcdb1f372b docs(remote): restore remote.txt from removal in f2205b83c5 2022-03-11 11:16:46 -05:00
dundargoc
a7b1c8893c
chore: fix typos (#17331)
Co-authored-by: Hongyi Lyu <hongyi.lyu95@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: notomo <notomo.motono@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-03-10 14:34:55 +08:00
Sean Dewar
b743e415fe
vim-patch:partial 1588bc8ebee2 (#17657)
Update runtime files
1588bc8ebe

docs only

skip :argdedupe changes (need v8.2.3888)
skip sound_playfile changes (need +sound)
skip fuzzy-matching changes in *command-attributes* (need #17536)
2022-03-09 08:44:28 +01:00
zeertzjq
165cf1b48e vim-patch:8.2.0997: cannot execute a register containing line continuation
Problem:    Cannot execute a register containing line continuation.
Solution:   Concatenate lines where needed. (Yegappan Lakshmanan,
            closes vim/vim#6272)
856c1110c1

According to #2542 the "Future:" part was removed intentionally.
Use size_t in more places to reduce type casts.
2022-03-09 06:25:31 +08:00
Dhruv Manilawala
2783f4cc4a
feat(api): autocmd group can be either name or id (#17559)
* feat(api): `group` can be either string or int

This affects the following API functions:
- `vim.api.nvim_create_autocmd`
- `vim.api.nvim_get_autocmds`
- `vim.api.nvim_do_autocmd`

closes #17552

* refactor: add two maps for fast lookups

* fix: delete augroup info from id->name map

When in "stupid_legacy_mode", the value in name->id map would be updated
to `AUGROUP_DELETED`, but the entry would still remain in id->name. This
would create a problem in `augroup_name` function which would return the
name of the augroup instead of `--DELETED--`.

The id->name map is only used for fast loopup in `augroup_name` function
so there's no point in keeping the entry of deleted augroup in it.

Co-authored-by: TJ DeVries <devries.timothyj@gmail.com>
2022-03-07 23:15:43 -05:00
Gregory Anders
92349b1db0
feat(api): add 'buffer' argument to nvim_get_autocmds (#17594)
This enables retrieving autocommands defined in the given buffers. Under
the hood this simply translates the buffer numbers into '<buffer=%d>'
patterns.
2022-03-06 12:35:14 -07:00
zeertzjq
80e6f81862 docs(lua): reference runtime/lua/vim/_editor.lua 2022-03-06 22:32:22 +08:00
James McCoy
c365de1d22
Merge pull request #17589 from kchibisov/add-dashed-dotted-underline
Add support for double, dashed, and dotted underlines
2022-03-05 15:00:07 -05:00
Kirill Chibisov
4472820182
fix(docs): spelling in new underlines docs 2022-03-04 00:35:51 +03:00
Kirill Chibisov
f89fb41a7a
feat(tui): add support for CSI 4 : [2,4,5] m
This commit finishes support for colored and styled underlines adding
`CSI 4 : [2,4,5] m` support providing double, dashed, and dotted
underlines

Fixes #17362.
2022-03-03 23:35:36 +03:00
zeertzjq
e8107f0748 vim-patch:8.2.4498: using <Plug> with "noremap" does not work
Problem:    Using <Plug> with "noremap" does not work.
Solution:   Always remap <Plug>. (closes vim/vim#9879, closes vim/vim#9789)
1fc34225ac
2022-03-03 22:41:09 +08:00
David Shen
5d6006f9bf
feat(diagnostic): add "code" to the diagnostic structure (#17510) 2022-03-02 18:42:27 -07:00
zeertzjq
4b3f920477
Merge pull request #16804 from zeertzjq/ui-aucmd-docs
docs: clarify UIEnter and UILeave docs
2022-03-02 15:05:19 +08:00
bfredl
0a9b00913f
Merge pull request #15079 from shadmansaleh/feat/verbose_lua
feat(lua): add :verbose support for lua config
2022-03-01 13:13:11 +01:00
zeertzjq
0cb9a577ed docs: clarify actual behavior of <Plug> 2022-03-01 09:28:27 +08:00
TJ DeVries
0f613482b3 feat(lua): add missing changes to autocmds lost in the rebase
Note: some of these changes are breaking, like change of API signatures
2022-02-28 19:53:50 +01:00
shadmansaleh
ebfe083337 feat(lua): show proper verbose output for lua configuration
`:verbose` didn't work properly with lua configs (For example:
    options or keymaps are set from lua, just say that they were set
    from lua, doesn't say where they were set at.

This fixes that issue. Now `:verbose` will provide filename and line no
when option/keymap is set from lua.

Changes:
  - compiles lua/vim/keymap.lua as vim/keymap.lua
 - When souring a lua file current_sctx.sc_sid is set to SID_LUA
 - Moved finding scripts SID out of `do_source()` to `get_current_script_id()`.
   So it can be reused for lua files.
 - Added new function `nlua_get_sctx` that extracts current lua scripts
   name and line no with debug library. And creates a sctx for it.
     NOTE: This function ignores C functions and blacklist which
     currently contains only vim/_meta.lua so vim.o/opt wrappers aren't
     targeted.
 - Added function `nlua_set_sctx` that changes provided sctx to current
   lua scripts sctx if a lua file is being executed.
 - Added tests in tests/functional/lua/verbose_spec.lua
 - add primary support for additional types (:autocmd, :function, :syntax) to lua verbose
    Note: These can't yet be directly set from lua but once that's possible
    :verbose should work for them hopefully :D
 - add :verbose support for nvim_exec & nvim_command within lua
    Currently auto commands/commands/functions ... can only be defined
    by nvim_exec/nvim_command this adds support for them. Means if those
    Are defined within lua with vim.cmd/nvim_exec :verbose will show their
    location . Though note it'll show the line no on which nvim_exec call was made.
2022-02-28 19:18:49 +06:00
Javier Lopez
1b5767aa34
feat(lua): add <f-args> to user commands callback (#17522)
Works similar to ex <f-args>. It only splits the arguments if the
command has more than one posible argument. In cases were the command
can only have 1 argument opts.fargs = { opts.args }
2022-02-27 12:35:06 -07:00
bfredl
c65d93e60a
Merge pull request #16969 from shadmansaleh/enhance/ingore_nore_on_plug_keymaps
feat: ignore nore on <Plug> maps
2022-02-27 16:47:55 +01:00
Christian Clason
9d3370a144
vim-patch:c51cf0329809 (#17530)
Update runtime files.
c51cf03298
2022-02-27 11:56:30 +01:00
shadmansaleh
c031e038df chore: remove <Plug> detection from vim.keymap 2022-02-27 08:21:21 +06:00
shadmansaleh
0347875a5c feat: ignore nore on <Plug> maps 2022-02-27 08:21:21 +06:00
bfredl
850b3e19c9 refactor(lua): cleanup and docs for threads 2022-02-26 15:00:13 +01:00
Dundar Göc
1630ec742d docs: update explanation of Y to reflect new defaults
Closes https://github.com/neovim/neovim/issues/17435
2022-02-24 18:13:44 +08:00
Sean Dewar
c07b5b5de6
vim-patch:partial 944697ae196 (#17493)
Update runtime files
944697ae19

Doc changes:

Include remote_*() (even though +clientserver and remote.txt isn't ported yet)
Omit screenpos() (need v8.2.4389)
Other changes are N/A or cannot be directly applied
2022-02-23 12:22:18 +00:00
Gregory Anders
11f7aeed7a
feat(api): implement nvim_buf_get_text (#15181)
nvim_buf_get_text is the mirror of nvim_buf_set_text. It differs from
nvim_buf_get_lines in that it allows retrieving only portions of lines.

While this can typically be done easily enough by API clients,
implementing this function provides symmetry between the get/set
text/lines APIs, and also provides a nice convenience that saves API
clients the work of having to slice the result of nvim_buf_get_lines
themselves.
2022-02-22 20:19:21 +00:00
Christian Clason
10a46a20ce
refactor(highlight)!: optional arguments for highlight.range as table (#17462)
also update documentation

BREAKING CHANGE: signature of highlight.range is now
     vim.highlight.range(bufnr, ns, hlgroup, start, finish,
         { regtype = regtype, inclusive = inclusive, priority = priority })

Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2022-02-21 21:21:42 +01:00
Aetf
aeb390e28f
docs: clarify ftdetect scripts loading during packadd (#17465)
The old description doesn't match the current behavior anymore.
2022-02-20 15:58:31 -07:00
Sean Dewar
b149665689
vim-patch:8.2.3573: cannot decide whether to skip test that fails with 64 bit
Problem:    Cannot decide whether to skip test that fails with 64 bit ints.
            (closes vim/vim#9072)
Solution:   Add v:sizeofint, v:sizeoflong and v:sizeofpointer.  Improve the
            check for multiply overflow.
69b3072d98

Omit v:sizeof{int,long,pointer} as they're only really used for tests.
2022-02-17 14:45:22 +00:00
zeertzjq
4646ea1079
Merge pull request #17363 from zeertzjq/dirchangedpre
feat(events): add DirChangedPre
2022-02-17 06:07:19 +08:00
zeertzjq
cc81a8253b docs: minor changes related to mapping description 2022-02-16 16:58:32 +08:00
Shadman
9a74c2b04a
feat(mappings): considering map description when filtering (#17423) 2022-02-16 16:39:50 +08:00
zeertzjq
8051fa1aff
Merge pull request #17394 from zeertzjq/vim-8.2.4343
vim-patch:8.2.4343: when reloading not all properties are detected
2022-02-15 08:10:21 +08:00
zeertzjq
5220891571 vim-patch:8.2.4343: when reloading not all properties are detected
Problem:    When reloading not all properties are detected.
Solution:   Add the "edit" value to v:fcs_choice. (Rob Pilling, closes vim/vim#9579)
8196e94a8b

Cherry-pick some test changes from patch 8.1.1826.
2022-02-14 11:35:25 +08:00
marvim
45e666fb92 docs: regenerate [skip ci] 2022-02-13 13:44:51 +00:00
Chinmay Dalal
e481901748
docs: treesitter.txt - fix overflowing lines, document minimum_language_version (#17286) 2022-02-13 14:43:25 +01:00
Sean Dewar
cdb2c10011
vim-patch:8.2.0915: search() cannot skip over matches like searchpair() can
Problem:    Search() cannot skip over matches like searchpair() can.
Solution:   Add an optional "skip" argument. (Christian Brabandt, closes vim/vim#861)
adc17a5f9d

Enable skip arg usage in autoload/freebasic.vim

evalarg_T doesn't really matter because it's deleted in v8.2.0918 (and
reincarnated for Vim9 script in v8.2.1047), but I found out too late :P Anyway:

- Port evalarg_T into eval.h and use const char * and Callback fields
- Use EVALARG_INIT to initialize
- Return bool over OK/FAIL from evalarg functions
- Remove check from evalarg_clean as callback_free ignores None callbacks anyway
- Move eva_buf field into evalarg_get as a local (not sure what reason it has
  being in the struct)

N/A patches for version.c:

vim-patch:8.2.4355: unnecessary call to check_colorcolumn()

Problem:    Unnecessary call to check_colorcolumn().
Solution:   Remove the call. (Sean Dewar, closes vim/vim#9748)
0f7ff851cb
2022-02-12 12:00:36 +00:00
James McCoy
906182065b
Merge pull request #17325 from glacambre/stdioopen_doc 2022-02-11 16:21:16 -05:00
glacambre
8090753880 docs(stdioopen): add missing documentation for on_print param
This commit adds documentation for the feature introduced in #15910.
2022-02-11 19:18:47 +01:00
zeertzjq
059d36e326 feat(events): add DirChangedPre
In Nvim, like DirChanged, this also triggers when switching windows.

This marks Vim patch 8.2.4335 as ported.

vim-patch:8.2.4335: no autocommand event triggered before changing directory

Problem:    No autocommand event triggered before changing directory. (Ronnie
            Magatti)
Solution:   Add DirChangedPre. (closes vim/vim#9721)
28e8f73ae2
2022-02-11 12:55:58 +08:00
zeertzjq
aea889fc06 vim-patch:8.1.2221: cannot filter :disp output
Problem:    Cannot filter :disp output.
Solution:   Support filtereing :disp output. (Andi Massimino, closes vim/vim#5117)
8fc4296436
2022-02-10 07:28:54 +08:00
zeertzjq
9b0b4829c7
Merge pull request #17345 from zeertzjq/vim-8.2.4329
vim-patch:8.2.4329: no support for end line number and column in 'errorformat'
2022-02-09 21:02:37 +08:00
zeertzjq
196160b183 vim-patch:partial:f10911e5db16
Update runtime files
f10911e5db
2022-02-09 14:21:04 +08:00
zeertzjq
d9cb3fba92 vim-patch:8.2.4242: put in Visual mode cannot be repeated
Problem:    Put in Visual mode cannot be repeated.
Solution:   Use "P" to put without yanking the deleted text into the unnamed
            register. (Shougo Matsushita, closes vim/vim#9591)
fb55207ed1

Cherry-pick get_y_previous() and set_y_previous() from patch 8.1.1736.
Nvim has removed y_current, so code related to it is N/A.
2022-02-09 14:21:04 +08:00
zeertzjq
b9732e555b vim-patch:8.2.4329: no support for end line number and column in 'errorformat'
Problem:    No support for end line number and column in 'errorformat'.
Solution:   Add %e and %k. (closes vim/vim#9624)
e023d49937

Use "\t" to represent a Tab as it looks better.
2022-02-09 13:31:06 +08:00
Sean Dewar
46c93b4304
Merge pull request #16553 from seandewar/vim-8.2.0878
vim-patch:8.2.{0882,1051,1083}: port `reduce()` function
2022-02-08 17:05:27 +00:00
dundargoc
64116d7850
chore: fix typos (#17250)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Dani Dickstein <daniel.dickstein@gmail.com>
Co-authored-by: Axel Dahlberg <git@valleymnt.com>
2022-02-08 08:19:06 +08:00
Sean Dewar
02e7431445
docs(fuzzy-match): cherry-pick latest changes
53f7fccc94
1b884a0053
4c295027a4
3ec3217f04
2022-02-07 17:39:50 +00:00
Sean Dewar
ce797e08f5
vim-patch:8.2.2813: cannot grep using fuzzy matching
Problem:    Cannot grep using fuzzy matching.
Solution:   Add the "f" flag to :vimgrep. (Yegappan Lakshmanan, closes vim/vim#8152)
bb01a1ef3a
2022-02-07 17:20:51 +00:00
Sean Dewar
715fbcbb8c
vim-patch:8.2.2280: fuzzy matching doesn't give access to the scores
Problem:    Fuzzy matching doesn't give access to the scores.
Solution:   Return the scores with a third list. (Yegappan Lakshmanan,
            closes vim/vim#7596)
9d19e4f4ba

Remove seemingly useless NULL checks.
assert that removing the li one wasn't dumb.
2022-02-07 17:20:51 +00:00
Sean Dewar
30deb14f39
vim-patch:8.2.1893: fuzzy matching does not support multiple words
Problem:    Fuzzy matching does not support multiple words.
Solution:   Add support for matching white space separated words. (Yegappan
            Lakshmanan, closes vim/vim#7163)
8ded5b647a
2022-02-07 17:20:50 +00:00