Commit Graph

2419 Commits

Author SHA1 Message Date
zeertzjq
34cfe74568 vim-patch:8.2.0876: :pwd does not give a hint about the scope of the directory
Problem:    :pwd does not give a hint about the scope of the directory
Solution:   Make ":verbose pwd" show the scope. (Takuya Fujiwara, closes vim/vim#5469)
950587242c
2021-10-17 22:04:53 +08:00
zeertzjq
8727d38012 vim-patch:8.1.1291: not easy to change directory and restore
Problem:    Not easy to change directory and restore.
Solution:   Add the chdir() function. (Yegappan Lakshmanan, closes vim/vim#4358)
1063f3d200

Also includes some documentation changes from patch 8.1.1218.
2021-10-17 22:04:53 +08:00
zeertzjq
920473d2f2 vim-patch:8.0.1459: cannot handle change of directory
Problem:    Cannot handle change of directory.
Solution:   Add the DirChanged autocommand event. (Andy Massimino,
            closes vim/vim#888)  Avoid changing directory for 'autochdir' too often.
b7407d3fc9

Only add "auto" pattern. "window" and "global" are already implemented.
Skip `Test_dirchanged_auto` using `CheckFunction test_autochdir`.
Part of PR #15952. More information can be found there.

N/A patches for version.c:

vim-patch:8.0.1460: missing file in patch

Problem:    Missing file in patch.
Solution:   Add changes to missing file.
b5cb65ba2b

vim-patch:8.0.1461: missing another file in patch

Problem:    Missing another file in patch.
Solution:   Add changes to missing file.
15833239a4
2021-10-17 22:04:53 +08:00
Christian Clason
0ba77f2f31 vim-patch:2286304cdbba
Update runtime files
2286304cdb
2021-10-16 18:03:51 +02:00
Jan Edmund Lazo
b3e0d6708e
Merge pull request #15502 from seandewar/vim-8.1.1921
Add method call support for more built-ins: vim-patch:8.1.{1336,1952,1961,1984}
2021-10-10 16:48:24 -04:00
zeertzjq
f4359b5dbd
vim-patch:8.2.3461: distinguish Normal and Terminal-Normal mode #15878
Problem:    Cannot distinguish Normal and Terminal-Normal mode.
Solution:   Make mode() return "nt" for Terminal-Normal mode. (issue vim/vim#8856)
72406a4bd2
2021-10-09 18:15:46 -07:00
Yorick Peterse
c61a3865ee
fix: set cursorlineopt=number in terminal mode (#15493)
When entering terminal mode, cursorlineopt is no longer entirely
disabled. Instead, it's set to `number`. Doing so ensures that users
using `set cursorline` combined with `set cursorlineopt=number` have
consistent highlighting of the line numbers, instead of this being
disabled when entering terminal mode.

Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2021-10-06 16:31:14 -06:00
dundargoc
1034f7d7b1
vim-patch:8.2.0017: OS/2 and MS-DOS are still mentioned #15928
Problem:    OS/2 and MS-DOS are still mentioned, even though support was
            removed long ago.
Solution:   Update documentation. (Yegappan Lakshmanan, closes vim/vim#5368)
6f345a1458
2021-10-06 06:14:56 -07:00
Javier Lopez
acd5e831b6
fix(checkhealth): mitigate issues with duplicate healthchecks #15919
* fix(runtime/health): mitigate issues with duplicate healthchecks
  Previously if a healthcheck was found as Lua and Vim it was executed
  both times.
  This new implementations prefers Lua, therefore if two are found It only
  runs the Lua one, this way a plugin can mantain both implementations the
  Lua one with the method `check()` and the autoload function `#check()`
  (for none HEAD nvim versions).
  **Note: This will require plugins to use `check()` as the function name,
  since the autoload function that wraps the lua implementation won't be
  called**
* docs(health): use spaces and don't overuse backtics

followup to #15259
2021-10-05 15:37:39 -07:00
github-actions[bot]
59edd377d3
docs: regenerate #15545 2021-10-05 10:48:48 -07:00
Javier Lopez
49fdc62114
feat(api): named marks set, get, delete #15346
Adds the following API functions.

- nvim_buf_set_mark(buf, name, line, col)
  * Set marks in a buffer.
- nvim_buf_del_mark(buf, name)
  * Delete a mark that belongs to buffer.
- nvim_del_mark(name)
  * Delete a global mark.
- nvim_get_mark(name)
  * Get a global mark.

Tests:

- Adds test to all the new api functions, and adds more for the existing
  nvim_buf_get_mark.
    * Tests include failure cases.

Documentation:

- Adds documentation for all the new functions, and improves the
  existing fucntion docs.
2021-10-05 08:49:20 -07:00
Christian Clason
f6a9f0bfca
fix(vim-patch): add missing nginx runtime files (#15916)
Followup to incomplete runtime update https://github.com/neovim/neovim/pull/15911
2021-10-05 15:19:16 +02:00
zeertzjq
17f7c83f29
docs(intro.txt): change vimhelp.appspot.com to vimhelp.org (#15915)
Ref 6c1e1570b1 (diff-644ad027e3580bc940a6b7b4aaf1869bae267f7ff30e359e523d5de70e317106)
2021-10-05 06:49:15 -06:00
Christian Clason
0c2a7aa5f7
vim-patch:6e649224926b (#15911)
Update runtime files
6e64922492
2021-10-05 14:12:16 +02:00
Matthieu Coudron
93a7571fab
Merge pull request #15259 from muniter/muniter/checkhealth-from-lua
feat(checkhealth): support Lua healthchecks
2021-10-05 11:27:07 +02:00
zeertzjq
655e489e90
docs(develop.txt): nvim_open_win is now in win_config.c (#15909) 2021-10-04 20:10:07 -06:00
Javier López
8f2a8b50da docs(runtime/health): update with new lua support
- describe how the lua support works
- explain new behavior of :checkhealth *
- fixed formatting to use tab instead of spaces
2021-10-04 14:28:54 -05:00
Aditya Kurdunkar
83fa8956c3
docs: fix typo 2021-10-04 13:09:32 -06:00
Gregory Anders
c7a63f35db
feat(startup): load builtin plugins with --clean #15893
Closes #15605
2021-10-04 07:01:49 -07:00
Justin M. Keyes
8a9f292991
Merge #15218 from gpanders/split-trimempty
feat(lua): add "noempty" param to vim.split()
2021-10-03 17:33:12 -07:00
Sean Dewar
a8504638cd
feat(eval/method): partially port v8.1.1987
Cannot be fully ported as the remote_*() functions from +clientserver
are not yet ported. Include the test changes anyway.

line()'s optional winid argument was already ported. (Wasn't added in
this patch; this just adds documentation)
2021-10-03 20:12:20 +01:00
Sean Dewar
c5583df3c0
vim-patch:8.1.1984: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
3f4f3d8e7e

test_prompt_buffer.vim already had all the changes, except
Test_prompt_garbage_collect().
2021-10-03 20:12:20 +01:00
Sean Dewar
d23d37b212
vim-patch:8.1.1961: more functions can be used as a method
Problem:    More functions can be used as a method.
Solution:   Allow more functions to be used as a method.  Add a test for
            mapcheck().
a144983633

mzeval() (if_mzscheme) is N/A.
2021-10-03 20:12:20 +01:00
Sean Dewar
86593beaa4
feat(eval/method): partially port v8.1.1954
Does not include listener_*() functions.

js_*() functions are N/A.

json_encode() and json_decode() didn't include tests; add some anyway
(to json_functions_spec.lua).

test_lua.vim isn't included yet, so add tests to luaeval_spec.lua.
2021-10-03 20:06:33 +01:00
Sean Dewar
59c8a1fd51
feat(eval/method): partially port v8.1.1953
Adds method call support for all functions in the patch, but it cannot
be fully ported due to missing tests for:

- index(): requires Blobs from v8.1.0735.
           Note that index() was already added as a method in v8.1.1803;
           this patch only adds a test.

- iconv(): requires v8.1.1136 for test_termcodes.vim.

Nvim deprecated inputdialog(), so it no longer has an eval.txt entry.

Keep the test for hlexists() commented-out, just like previously. (Nvim
always defines the Number group, so it always returns 1 instead)

Cannot include both changes to test_syn_attr.vim as Nvim doesn't support
":hi term=..."; however, both test the same ->hlID() syntax anyway.
2021-10-03 20:06:32 +01:00
Sean Dewar
8b7615c735
vim-patch:8.1.1952: more functions can be used as a method
Problem:    More functions can be used as a method.
Solution:   Allow more functions to be used as a method.
5d69fdb7c4
2021-10-03 20:06:32 +01:00
Sean Dewar
3137c7d635
feat(eval/method): partially port v8.1.1925
Adds method call support for all functions in the patch, but it cannot
be fully ported due to missing tests for:

- getcwd(): requires chdir() and Test_chdir_func() from v8.1.1291.

Note that the method call tests for getreg() and getregtype() were
removed in v8.2.1547, which has already been ported, but doesn't seem to
have been replaced with a new test...

This patch also makes getchangelist()'s argument optional (defaults to
the current buffer).

eval.txt includes a typo for gettabwinvar(), which is fixed in
v8.1.1952.
2021-10-03 20:06:32 +01:00
Sean Dewar
6110480c29
feat(eval/method): partially port v8.1.1921
Adds method call support for all functions in the patch, but it cannot
be fully ported due to missing tests for:

- filereadable(): requires v8.1.1378 for Test_delete_rf(), but there
                  appears to have been some trouble porting it. (#12784)

- confirm(): requires v8.1.0832 for Test_confirm() and v8.1.0815 for
             feedkeys()'s "L" flag.

             (I did attempt to port the test using nvim_input() instead,
             but seems that input handling for confirm() doesn't work in
             --headless mode?)

             Note that confirm() was actually added as a method in
             v8.1.1915.

Uncomment use of method call syntax in Test_Executable() previously
included instead from v8.2.2259.
2021-10-03 20:06:31 +01:00
zeertzjq
7ba11e06c0
vim-patch:8.2.3466: completion submode not indicated for virtual replace (#15886)
Problem:    Completion submode not indicated for virtual replace.
Solution:   Add submode to "Rv". (closes vim/vim#8945)
cc8cd44533
2021-10-03 15:04:51 -04:00
zeertzjq
04b59ebd85
vim-patch:8.2.3465: cannot detect insert scroll mode (#15885)
Problem:    Cannot detect insert scroll mode.
Solution:   Add "scroll" to complete_info(). (closes vim/vim#8943)
27fef59dd1
2021-10-03 14:53:58 -04:00
Gregory Anders
23d13aa4cc
Merge pull request #15786 from gpanders/diagnostic-signs-unique-severity 2021-10-02 21:01:40 -06:00
Gregory Anders
1124439954 docs(diagnostic): add blurb on how to replace builtin handlers 2021-10-02 20:37:09 -06:00
dundargoc
ac973d5532
docs: remove obsolete text on language #15875 2021-10-02 14:30:13 -07:00
Gregory Anders
36408146ad
docs(diagnostics): add "priority" option to signs table (#15860)
This feature was added in #15785, but the docs for
vim.diagnostic.config() weren't updated.
2021-10-01 19:07:55 -06:00
Daniel Steinberg
88442c2fa6 docs: add 'plus one' to correct getmousepos docs
This change was applied to Vim as part of 90df4b9.
90df4b9d42
2021-09-29 11:13:49 -04:00
Daniel Steinberg
096309037b chore: remove empty line
This update was part of vim-patch:4c29502.
4c295027a4
The other parts of that patch were applied to Neovim in ad6bb38.
2021-09-29 11:13:49 -04:00
Daniel Steinberg
3b9e75b366 vim-patch:8.1.2304: cannot get the mouse position when getting a mouse click
Problem:    Cannot get the mouse position when getting a mouse click.
Solution:   Add getmousepos().
db3a205147
2021-09-29 11:13:49 -04:00
Mathias Fußenegger
63fde086d9
feat(ui): add vim.ui.select and use in code actions (#15771)
Continuation of https://github.com/neovim/neovim/pull/15202

A plugin like telescope could override it with a fancy implementation
and then users would get the telescope-ui within each plugin that
utilizes the vim.ui.select function.

There are some plugins which override the `textDocument/codeAction`
handler solely to provide a different UI. With custom client commands and
soon codeAction resolve support, it becomes more difficult to implement
the handler right - so having a dedicated way to override the picking
function will be useful.
2021-09-27 21:57:28 +02:00
Gregory Anders
187e3a3b7e
refactor(diagnostic): use sign priority for severity_sort #15785
Rather than relying on the order in which signs are placed to dictate
the order in which they are displayed, explicitly set the priority of
the sign according to the severity of the diagnostic and the value of
severity_sort. If severity_sort is false or unset then all signs use the
same priority.
2021-09-26 16:02:18 -07:00
Mathias Fußenegger
73280a7987
feat(lsp): allow subset of CodeActionContext as arg to code_action methods (#15793)
This makes it easier to filter the code actions. For example:

    vim.lsp.buf.code_action { only = 'refactor' }
2021-09-26 23:40:28 +02:00
Gregory Anders
84f66909e4 refactor: use kwargs parameter in vim.split 2021-09-25 20:11:32 -06:00
Gregory Anders
5fa26e2c2f feat: add trimempty optional parameter to vim.split
The `split()` VimL function trims empty items from the returned list by
default, so that, e.g.

  split("\nhello\nworld\n\n", "\n")

returns

  ["hello", "world"]

The Lua implementation of vim.split does not do this. For example,

  vim.split("\nhello\nworld\n\n", "\n")

returns

  {'', 'hello', 'world', '', ''}

Add an optional parameter to the vim.split function that, when true,
trims these empty elements from the front and back of the returned
table. This is only possible for vim.split and not vim.gsplit; because
vim.gsplit is an iterator, there is no way for it to know if the current
item is the last non-empty item.

Note that in order to preserve backward compatibility, the parameter for
the Lua vim.split function is `trimempty`, while the VimL function uses
`keepempty` (i.e. they are opposites). This means there is a disconnect
between these two functions that may surprise users.
2021-09-25 20:11:30 -06:00
Justin M. Keyes
55d1e630b4
Merge #15731 vim-patch:7.4.725,8.2.{0597,0598,0924,1035}
fixes #14581
2021-09-24 05:11:19 -07:00
Justin M. Keyes
c05b10748c doc(dev_style.txt): misc updates 2021-09-23 06:59:30 -07:00
Dundar Göc
5f49d0efee doc: convert neovim style guide to vim doc. 2021-09-23 06:59:30 -07:00
Sean Dewar
f9779facca
vim-patch:8.2.0924: cannot save and restore a register properly
Problem:    Cannot save and restore a register properly.
Solution:   Add getreginfo() and make setreg() accept a dictionary. (Andy
            Massimino, closes vim/vim#3370)
bb861e293e

Cherry-pick eval.txt changes for getreginfo() from:
6aa57295cf
207f009326
2021-09-23 02:04:11 +01:00
Gregory Anders
d999c96cf3
feat(diagnostic): allow customized diagnostic messages (#15742)
Provide a 'format' option for virtual text and floating window previews
that allows the displayed text of a diagnostic to be customized.
2021-09-22 12:20:15 -07:00
Michael Lingelbach
248974a4c6
Merge pull request #14115 from mfussenegger/lsp-commands
lsp: Add a registry for client side code action commands
2021-09-22 11:42:56 -07:00
Christian Clason
fb6f27e86f
vim-patch:34cc7d8c034f #15753
Update runtime files
34cc7d8c03
2021-09-22 06:12:06 -07:00
Gregory Anders
bc652f148f refactor(diagnostic): remove get_virt_text_chunks()
This function isn't compatible with including diagnostic sources when
"source" is "if_many" since it only has access to diagnostics for a
single line. Rather than having an inconsistent or incomplete interface,
make this function private. It is still exported as part of the module
for backward compatibility with vim.lsp.diagnostics, but it can
eventually be made into a local function.
2021-09-21 18:54:28 -06:00
Gregory Anders
d43151ea0b feat(diagnostic): add option to include diagnostic source
Add an option to virtual text display and floating window previews to
include diagnostic source in the diagnostic message.
2021-09-21 18:54:26 -06:00
Mathias Fussenegger
187579fe19 feat(lsp): include original request params in handler ctx
This is mostly motivated by https://github.com/neovim/neovim/issues/12326

Client side commands might need to access the original request
parameters.

Currently this is already possible by using closures with
`vim.lsp.buf_request`, but the global handlers so far couldn't access
the request parameters.
2021-09-20 22:06:54 +02:00
Gregory Anders
e61ea7772e
feat(diagnostic): match(), tolist(), fromlist() #15704
* feat(diagnostic): add vim.diagnostic.match()
  Provide vim.diagnostic.match() to generate a diagnostic from a string and
  a Lua pattern.
* feat(diagnostic): add tolist() and fromlist()
2021-09-19 15:13:23 -07:00
zeertzjq
51567db4b6 vim-patch:8.2.3424: a sequence of spaces is hard to see in list mode
Problem:    A sequence of spaces is hard to see in list mode.
Solution:   Add the "multispace" option to 'listchars'. (closes vim/vim#8834)
f14b8ba137
2021-09-19 13:13:44 +08:00
zeertzjq
963474321b vim-patch:8.1.1071: cannot get composing characters from the screen
Problem:    Cannot get composing characters from the screen.
Solution:   Add screenchars() and screenstring(). (partly by Ozaki Kiichi,
            closes vim/vim#4059)
2912abb3a2
2021-09-19 13:13:44 +08:00
Björn Linse
396280d303 refactor(runtime): always use DIP_START when searching for runtime files
Now remove the addition of "start/*" packages in 'packpath' as
explicit items in 'runtimepath'. This avoids 'runtimepath' from becoming
very long when using a lot of plugins as packages.

To get the effective search path as a list, use |nvim_list_runtime_paths()|
2021-09-18 13:53:50 +02:00
Gregory Anders
938ed458e2 fix(diagnostic): change default severity_sort order
When severity_sort is true, higher severities should be displayed before
lower severities (e.g. ERROR is displayed over WARN).

Also improved the test case for this.
2021-09-17 14:59:30 -06:00
Michael Lingelbach
ede5695eb1
Merge pull request #15696 from gpanders/diagnostic-sign-fix
Diagnostic hot fixes
2021-09-17 11:31:56 -07:00
Oliver Marriott
d9f93e5642
fix(typo): overriden -> overridden (RE: PR #14159) (#15360) 2021-09-17 13:07:00 -04:00
Gregory Anders
32c0631183 fix(diagnostic): support severity_sort 2021-09-17 10:50:25 -06:00
Gregory Anders
15fbc9b69e docs(diagnostics): fix typos 2021-09-17 08:57:51 -06:00
Jan Edmund Lazo
1ec3d37192
Merge pull request #15580 from seandewar/vim-8.2.3378
vim-patch:8.2.{3378,3379,3384,3386,3398,3400}
2021-09-17 09:39:36 -04:00
Justin M. Keyes
2e8103475e
Merge #15585 refactor: move vim.lsp.diagnostic to vim.diagnostic
## Overview

- Move vim.lsp.diagnostic to vim.diagnostic
- Refactor client ids to diagnostic namespaces
- Update tests
- Write/update documentation and function signatures

Currently, non-LSP diagnostics in Neovim must hook into the LSP subsystem. This
is what e.g. null-ls and nvim-lint do. This is necessary because none of the
diagnostic API is exposed separately from the LSP subsystem.

This commit addresses this by generalizing the diagnostic subsystem beyond the
scope of LSP. The `vim.lsp.diagnostic` module is now simply a specific
diagnostic producer and primarily maintains the interface between LSP clients
and the broader diagnostic API.

The current diagnostic API uses "client ids" which only makes sense in the
context of LSP. We replace "client ids" with standard API namespaces generated
from `nvim_create_namespace`.

This PR is *mostly* backward compatible (so long as plugins are only using the
publicly documented API): LSP diagnostics will continue to work as usual, as
will pseudo-LSP clients like null-ls and nvim-lint. However, the latter can now
use the new interface, which looks something like this:

```lua
-- The namespace *must* be given a name. Anonymous namespaces will not work with diagnostics
local ns = vim.api.nvim_create_namespace("foo")

-- Generate diagnostics
local diagnostics = generate_diagnostics()

-- Set diagnostics for the current buffer
vim.diagnostic.set(ns, diagnostics, bufnr)
```

Some public facing API utility methods were removed and internalized directly in `vim.diagnostic`:

* `vim.lsp.util.diagnostics_to_items`

## API Design

`vim.diagnostic` contains most of the same API as `vim.lsp.diagnostic` with
`client_id` simply replaced with `namespace`, with some differences:

* Generally speaking, functions that modify or add diagnostics require a namespace as their first argument, e.g.

  ```lua
  vim.diagnostic.set({namespace}, {bufnr}, {diagnostics}[, {opts}])
  ```

   while functions that read or query diagnostics do not (although in many cases one may be supplied optionally):

   ```lua
   vim.diagnostic.get({bufnr}[, {namespace}])
   ```

* We use our own severity levels to decouple `vim.diagnostic` from LSP. These
  are designed similarly to `vim.log.levels` and currently include:

  ```lua
  vim.diagnostic.severity.ERROR
  vim.diagnostic.severity.WARN
  vim.diagnostic.severity.INFO
  vim.diagnostic.severity.HINT
  ```

  In practice, these match the LSP diagnostic severity levels exactly, but we
  should treat this as an interface and not assume that they are the same. The
  "translation" between the two severity types is handled transparently in
  `vim.lsp.diagnostic`.

* The actual "diagnostic" data structure is: (**EDIT:** Updated 2021-09-09):

  ```lua
  {
    lnum = <number>,
    col = <number>,
    end_lnum = <number>,
    end_col = <number>,
    severity = <vim.diagnostic.severity>,
    message = <string>
  }
  ```

This differs from the LSP definition of a diagnostic, so we transform them in
the handler functions in vim.lsp.diagnostic.

## Configuration

The `vim.lsp.with` paradigm still works for configuring how LSP diagnostics are
displayed, but this is a specific use-case for the `publishDiagnostics` handler.
Configuration with `vim.diagnostic` is instead done with the
`vim.diagnostic.config` function:

```lua
vim.diagnostic.config({
    virtual_text = true,
    signs = false,
    underline = true,
    update_in_insert = true,
    severity_sort = false,
}[, namespace])
```

(or alternatively passed directly to `set()` or `show()`.)

When the `namespace` argument is `nil`, settings are set globally (i.e. for
*all* diagnostic namespaces). This is what user's will typically use for their
local configuration. Diagnostic producers can also set configuration options for
their specific namespace, although this is generally discouraged in order to
respect the user's global settings. All of the values in the table passed to
`vim.diagnostic.config()` are resolved in the same way that they are in
`on_publish_diagnostics`; that is, the value can be a boolean, a table, or
a function:

```lua
vim.diagnostic.config({
    virtual_text = function(namespace, bufnr)
        -- Only enable virtual text in buffer 3
        return bufnr == 3
    end,
})
```

## Misc Notes

* `vim.diagnostic` currently depends on `vim.lsp.util` for floating window
  previews. I think this is okay for now, although ideally we'd want to decouple
  these completely.
2021-09-16 14:23:42 -07:00
Sean Dewar
10283915d6
doc(eval): include latest relevant Blob changes
Also includes some small relevant nearby non-Blob changes and typo
fixes.

Changes are included from:
- v8.1.0815
- v8.1.0846
- v8.1.1084
- v8.1.2326
- v8.2.1969
- d89682477c
- d09091d495
- 53f7fccc94
2021-09-16 00:14:48 +01:00
Sean Dewar
e53b71627f
feat(f_msgpackparse): support parsing from Blob
Note that it is not possible for msgpack_unpack_next() and
msgpack_unpacker_next() to return MSGPACK_UNPACK_EXTRA_BYTES, so it
should be fine to abort() on that.

Lua 5.1 doesn't support string hex escapes (\xXX) like VimL does (though
LuaJIT does), so convert them to decimal escapes (\DDD) in tests.
2021-09-16 00:14:47 +01:00
Sean Dewar
5fdf741f77
feat(f_msgpackdump): support dumping to Blob 2021-09-16 00:14:47 +01:00
Sean Dewar
7e9ea08321
feat(f_chansend): support Blob data argument 2021-09-16 00:14:47 +01:00
Sean Dewar
e88961943b
fix(eval): partially port v8.2.3284
These were issues that I found while porting that I fixed upstream. :^)

Very little of the patch can be exactly ported as we're a bit behind on
dependant patches (we also can't use the exact :for emsg, as we don't
support iterating over Strings yet), so just translate the fixes as best
as we can for now.

Include latest relevant doc changes from:
- v8.1.0815
- v8.2.2658
2021-09-16 00:14:46 +01:00
Sean Dewar
9e38c4a79f
vim-patch:8.2.1473: items in a list given to :const can still be modified
Problem:    Items in a list given to :const can still be modified.
Solution:   Work like ":lockvar! name" but don't lock referenced items.
            Make locking a blob work.
021bda5671
2021-09-16 00:13:41 +01:00
Sean Dewar
e140eec441
vim-patch:8.1.0797: error E898 is used twice
Problem:    Error E898 is used twice.
Solution:   Rename the Blob error to E899. (closes vim/vim#3853)
bf821bccf1
2021-09-15 22:30:31 +01:00
Sean Dewar
c57132ec2a
vim-patch:8.1.0793: incorrect error messages for functions that take a Blob
Problem:    Incorrect error messages for functions that now take a Blob
            argument.
Solution:   Adjust the error messages. (Dominique Pelle, closes vim/vim#3846)
0d17f0d1c0
2021-09-15 22:30:31 +01:00
Sean Dewar
0eadd7e5fd
vim-patch:8.1.0757: not enough documentation for Blobs
Problem:    Not enough documentation for Blobs.
Solution:   Add a section about Blobs.
d89682477c

Include doc changes for empty() from v7.4.1274.
Include some minor typo fixes.
2021-09-15 22:30:20 +01:00
Sean Dewar
de9df825d5
feat(decode_string): decode binary string with NULs to Blob
Strings that previously decoded into a msgpack special for representing
BINs with NULs now convert to Blobs. It shouldn't be possible to decode
into this special anymore after this change?

Notably, Lua strings with NULs now convert to Blobs when passed to VimL.
2021-09-15 21:19:30 +01:00
Sean Dewar
af6f454f5c
feat(msgpack): convert Blobs to BIN strings 2021-09-15 21:19:30 +01:00
Sean Dewar
ab82369c8e
feat(json): convert Blobs to array of byte values
Similiar to how Vim does it, but to be consistent with how Nvim encodes
lists, add a space after every comma.
2021-09-15 21:19:29 +01:00
Sean Dewar
9095101743
vim-patch:8.1.0735: cannot handle binary data
Problem:    Cannot handle binary data.
Solution:   Add the Blob type. (Yasuhiro Matsumoto, closes vim/vim#3638)
6e5ea8d2a9

Nvim-specific Blob conversions are implemented in future commits.

Refactor write_blob() to use a FileDescriptor, as f_writefile() was
refactored to use one (does not apply to read_blob()).

Use var_check_lock() in f_add() for Blobs from v8.1.0897.

Add a modeline to test_blob.vim and fix some doc typos.

Include if_perl.txt's VIM::Blob() documentation. Interestingly, this
function already worked before this port, as it just returns a Blob
string literal, not an actual Blob object.

N/A patches for version.c:

vim-patch:8.1.0741: viminfo with Blob is not tested

Problem:    Viminfo with Blob is not tested.
Solution:   Extend the viminfo test.  Fix reading a blob.  Fixed storing a
            special variable value.
8c8b8bb56c

vim-patch:8.1.1022: may use NULL pointer when out of memory

Problem:    May use NULL pointer when out of memory. (Coverity)
Solution:   Check for blob_alloc() returning NULL.
e142a9467a
2021-09-15 21:19:22 +01:00
Gregory Anders
a5bbb932f9 refactor: move vim.lsp.diagnostic to vim.diagnostic
This generalizes diagnostic handling outside of just the scope of LSP.
LSP clients are now a specific case of a diagnostic producer, but the
diagnostic subsystem is decoupled from the LSP subsystem (or will be,
eventually).

More discussion at [1].

[1]: https://github.com/neovim/neovim/pull/15585
2021-09-15 14:09:47 -06:00
Justin M. Keyes
b63b4777ec
docs: third-party licenses, TEST_COLORS, system() #15665 2021-09-14 10:20:33 -07:00
Christian Clason
5fd21b8d3e
vim-patch:6c391a74fe90 (#15654)
Update runtime files
6c391a74fe

omit autoload/getscript.vim

skip doc/eval.txt (needs 8.2.2468)
skip doc/various.txt (needs 8.2.3400)

(typofixes courtesy of @dundargoc)
2021-09-13 16:33:41 +02:00
Christian Clason
1a9d2a4040
vim-patch:89a9c159f23f #15641
Update runtime files
89a9c159f2

Omit:
nsis/lang/turkish.nsi
pixmaps/gen-inline-pixbufs.sh
doc/popup.txt
doc/terminal.txt
tutor/tutor*
src/[g]vimtutor
CONTRIBUTING.md

Skip:
doc/eval.txt (needs 8.1.2342)
doc/testing.txt (needs 8.2.0299)
2021-09-13 06:05:27 -07:00
Sean Dewar
643cb8a6ec
doc(options): remove vim9script reference (#15645)
[skip ci]
2021-09-12 13:51:00 +02:00
Christian Clason
229effac9f
vim-patch:partial 6aa57295cfbe (#15633)
* vim-patch:partial 6aa57295cfbe

Update runtime files
6aa57295cf

omit doc/popup.txt
omit plugin/manpager.vim

partial skip runtime/doc/eval.txt (needs 8.2.{0258,0924,1544,2324,2468,2606})

skip ftplugin/julia.vim, indent/julia.vim, syntax/julia.vim (already
        ported in
        65f32f0f19)
skip syntax/scala.vim (already ported in
        a92e83ac14)
2021-09-12 11:02:33 +02:00
Christian Clason
4a7a99ff31
Merge pull request #15550 from jasonccox/vim-8.2.3385
vim-patch:8.2.3385,8.2.3393
2021-09-12 10:55:35 +02:00
Justin M. Keyes
413e86869e
Merge #14611 from seandewar/vim-8.1.1116
vim-patch:8.1.{1116,1188,1190,1355,1722,2035,2036,2038,2043},8.2.{0886,2309}
2021-09-11 12:12:59 -07:00
Christian Clason
e31652879e
vim-patch:partial 53f7fccc9413 (#15631)
* vim-patch:partial 53f7fccc9413

Update runtime files
53f7fccc94

omit macros/hanoi/hanoi.vim
omit spell/tet/main.aap
omit tools/shtags.1
omit tools/xcmdsrv_client.c

skip doc/pattern.txt (requires 8.2.3110; 8.2.{1665,1872})
skip doc/map.txt (requires 8.2.3228)
2021-09-11 16:47:45 +02:00
Sean Dewar
90a4cf92d2
vim-patch:8.2.0886: cannot use octal numbers in scriptversion 4
Problem:    Cannot use octal numbers in scriptversion 4.
Solution:   Add the "0o" notation. (Ken Takata, closes vim/vim#5304)
c17e66c5c0

:scriptversion is N/A.

Cherry-pick latest str2nr() doc changes from v8.1.2035.
Cherry-pick various mentions of the 0o prefix from:
 - v8.2.2324
 - 2346a63784
 - 11e3c5ba82
 - 82be4849ee

Patch used ascii_isbdigit() by mistake, which was fixed in v8.2.2309.

Make STR2NR_OOCT work the same as STR2NR_OCT when forcing.
In Vim, STR2NR_FORCE | STR2NR_OOCT isn't handled, and doesn't actually
force anything. Rather than abort(), make it work as STR2NR_OCT.

This means STR2NR_FORCE | STR2NR_OCT works the same as
STR2NR_FORCE | STR2NR_OOCT and STR2NR_FORCE | STR2NR_OCT | STR2NR_OOCT.
2021-09-11 15:36:03 +01:00
Sean Dewar
6617629ad6
vim-patch:8.1.2035: recognizing octal numbers is confusing
Problem:    Recognizing octal numbers is confusing.
Solution:   Introduce scriptversion 4: do not use octal and allow for single
            quote inside numbers.
60a8de28d1

:scriptversion is N/A.

Cherry-pick Test_readfile_binary() from v8.1.0742.

Note that this patch was missing vim_str2nr() changes, and so fails the
tests; this was fixed in v8.1.2036.
2021-09-11 15:33:20 +01:00
Sean Dewar
cd18fe17a8
vim-patch:8.1.1116: cannot enforce a Vim script style
Problem:    Cannot enforce a Vim script style.
Solution:   Add the :scriptversion command. (closes vim/vim#3857)
558ca4ae55

:scriptversion is N/A, but ":let ..=" is relevant.

N/A patches for version.c

vim-patch:8.1.1188: not all Vim variables require the v: prefix

Problem:    Not all Vim variables require the v: prefix.
Solution:   When scriptversion is 3 all Vim variables can only be used with
            the v: prefix.  (Ken Takata, closes vim/vim#4274)
d2e716e6df

vim-patch:8.1.1190: has('vimscript-3') does not work

Problem:    has('vimscript-3') does not work.
Solution:   Add "vimscript-3" to the list of features.
93a4879c20

vim-patch:8.1.2038: has('vimscript-4') is always 0

Problem:    has('vimscript-4') is always 0.
Solution:   Add "vimscript-4" to the feature table. (Naruhiko Nishino,
            closes vim/vim#4941)
af91438338
2021-09-11 15:33:06 +01:00
Christian Clason
521817ee76
Merge pull request #15619 from clason/vim-90df4b9d4234
vim-patch:90df4b9d4234

chore(vim-patch): add doc/vim9.txt to unwanted files
2021-09-11 12:59:30 +02:00
Justin M. Keyes
915703f2d8 docs: extmarks indexing #15311
ref #11456
2021-09-10 19:10:09 -07:00
Javier López
f8e406ed30 docs: extmarks indexing #15311
fix #11456
2021-09-10 18:31:11 -07:00
Patrice Peterson
9b553ad28d docs: extmark indexing #12742
Extmarks mostly use api-indexing, except for nvim_buf_get_extmarks(),
which uses api-indexing with inclusive ranges.

ref #11456
2021-09-10 17:59:28 -07:00
zeertzjq
9697023a0b
vim-patch:8.2.3389: cannot stop insert mode completion without side effects #15538
Problem:    Cannot stop insert mode completion without side effects.
Solution:   Add CTRL-X CTRL-Z. (closes vim/vim#8821)
dca29d9cf4
2021-09-10 17:14:32 -07:00
Justin M. Keyes
7525052270
Merge #15626 vim-patch:8.1.{2281,2283},8.2.{2903,3391,3397} 2021-09-10 08:43:45 -07:00
Sean Dewar
fd1dbb103b
vim-patch:8.1.2281: 'showbreak' cannot be set for one window
Problem:    'showbreak' cannot be set for one window.
Solution:   Make 'showbreak' global-local.
ee85702c10

Change in oneleft() is N/A as the relevant condition was removed
(has_mbyte is always true for Nvim, so the condition was always false;
see commit 73dc9e9).

Use wp over curwin for curs_columns().

Required for v8.2.2903 (otherwise test fails as it'll leave the global
option set).

N/A patches for version.c:

vim-patch:8.1.2283: missed on use of p_sbr

Problem:    Missed on use of p_sbr.
Solution:   Add missing p_sbr change.
91e22eb6e0

Already ported in commit 43a874a.
2021-09-10 15:50:43 +01:00
Sean Dewar
f46341fa43
vim-patch:8.2.3400: ":z!" is not supported
Problem:    ":z!" is not supported.
Solution:   Make ":z!" work and add tests. (Dominique Pellé, closes vim/vim#8836)
            Use display height instead of current window height.
7f2dd1e90c
2021-09-10 15:35:19 +01:00
Sean Dewar
b3a97c56b6
vim-patch:8.2.3384: cannot disable modeline for an individual file
Problem:    Cannot disable modeline for an individual file.
Solution:   Recognize "nomodeline" in a modeline. (Hu Jialun, closes vim/vim#8798)
9dcd349ca8

Cherry-pick missing modeline for test_modeline.vim (heh) from v8.2.1432.
2021-09-10 15:35:18 +01:00
Gregory Anders
c58ee4ef7f
docs: clarify :runtime START, OPT behavior #15342
By default, the :runtime command searches "pack/*/start" in 'packpath'
along with 'runtimepath'. Update the documentation to reflect this
behavior.
2021-09-10 07:11:50 -07:00
Justin M. Keyes
329047b3db
docs #15625
fix #12261
fix #15536
fix #15623
fix #15572
ref #14244
ref #15034

close #15555
close #14957
2021-09-10 06:59:17 -07:00
zeertzjq
af6948d271
docs(terminal): clarify CTRL-\ behavior #15171 2021-09-10 06:24:08 -07:00
Javier Lopez
4b452d4efb
perf(lua): optimize vim.deep_equal #15236
By remembering the keys already compared in repeating a comparison is
avoided. Thanks: https://stackoverflow.com/a/32660766
2021-09-10 06:22:40 -07:00
Christian Clason
aab3583e74
vim-patch:8.2.3399: Octave files are not recognized (#15622)
Problem:    Octave files are not recognized.
Solution:   Detect Octave files. (Doug Kearns)
deba5eb195
2021-09-10 14:01:13 +02:00
Christian Clason
be557dddf4 vim-patch:90df4b9d4234
Update runtime files
90df4b9d42

omit .github/CODEOWNERS
omit doc/vim9.txt
omit po/it.po

skip ftplugin/jsonc.vim
skip indent/jsonc.vim
skip syntax/jsonc.vim
(already ported in dce50312e1)

partial skip doc/eval.txt (needs 8.1.{2304,2321})
2021-09-10 09:14:56 +02:00
Christian Clason
8f0c843c13
vim-patch:4d8f476176ea (#15612)
* vim-patch:4d8f476176ea

Update runtime files
4d8f476176

skip nsis/README.txt
skip doc/vim9.txt
skip src/nvim/po/it.po
2021-09-10 08:48:27 +02:00
Gregory Anders
a422f2136a
docs(gen_vimdoc.py): ignore health.lua files #15614 2021-09-09 18:28:12 -07:00
Christian Clason
2fe95cb1ad
vim-patch:partial 2346a6378483 (#15599)
Update runtime files
2346a63784

omit doc/vim.man
omit doc/vim9.txt
omit doc/vimdiff.txt
omit doc/vimdiff.man

skip doc/eval.txt (missing patch 8.2.2324)
skip doc/help.txt (missing patch 8.2.2344)
2021-09-09 18:59:11 +02:00
Björn Linse
0f596665cc feat(lua): make vim.mpack support vim.NIL and vim.empty_dict() 2021-09-09 16:06:43 +02:00
Justin M. Keyes
9f3679cbfd docs: naming conventions 2021-09-09 06:28:11 -07:00
Justin M. Keyes
69fe427df4 feat(lua)!: register_keystroke_callback => on_key
Analogous to nodejs's `on('data', …)` interface, here on_key is the "add
listener" interface.

ref 3ccdbc570d #12536

BREAKING_CHANGE: vim.register_keystroke_callback() is now an error.
2021-09-09 06:09:33 -07:00
Sean Dewar
4eb1ebbcf7
fix(doc): various fixes #15604
In particular:
- jobwait: omitting {timeout} arg is the same as -1.
- sockconnect: omitting {opts} arg is the same as {}.
- jobsend: obsoleted by chansend; don't mention it in job_control.txt.
- menu_get: add to |functions| table.

[skip ci]
2021-09-09 00:37:59 -07:00
Christian Clason
79cbbd5179
vim-patch:d2ea7cf10a4d #15571
Update runtime files
d2ea7cf10a

omit `runtime/doc/if_tcl.txt`
omit `runtime/doc/textprop.txt`
omit `runtime/tutor/*`
omit `runtime/syntax/vim.vim` (cherry-picked in 2dd7828511)

manual merge of `runtime/pack/dist/opt/termdebug/plugin/termdebug.vim`
2021-09-08 07:24:12 -07:00
Michael Lingelbach
23fe6dba13
Merge pull request #15504 from mjlbach/feat/change-handler-signature
feat(lsp)!: change handler signature
2021-09-05 10:27:52 -07:00
Michael Lingelbach
f7dabbc115 docs: regenerate 2021-09-05 10:05:38 -07:00
Michael Lingelbach
df17d7844e feat(lsp)!: change handler signature
Previously, the handler signature was:

  function(err, method, params, client_id, bufnr, config)

In order to better support external plugins that wish to extend the
protocol, there is other information which would be advantageous to
forward to the client, such as the original params of the request that
generated the callback.

In order to do this, we would need to break symmetry of the handlers, to
add an additional "params" as the 7th argument.

Instead, this PR changes the signature of the handlers to:

  function(err, result, ctx, config)

where ctx (the context) includes params, client_id, and bufnr. This also leaves
flexibility for future use-cases.

BREAKING_CHANGE: changes the signature of the built-in client handlers, requiring
updating handler calls
2021-09-05 10:04:30 -07:00
Jason Cox
85ba41a4b3 vim-patch:8.2.3385: escaping for fish shell does not work properly
Problem:    Escaping for fish shell does not work properly.
Solution:   Insert a backslash before a backslash. (Jason Cox, closes vim/vim#8810)
6e82351130
2021-09-02 13:07:29 -06:00
Justin M. Keyes
5f8518b3f0
fix(defaults): "syntax sync maxlines=1" on CmdwinEnter #15552
I mistakenly suggested maxlines=&cmdwinheight, forgetting that it is
calculated from topline, not cursor. maxlines=1 makes the most sense in
cmdwin.

ref #15401 622a36b1f1
2021-09-02 10:29:59 -07:00
Gregory Anders
622a36b1f1
feat(defaults): limit syntax cost on CmdwinEnter #15401
Add a new default autocommand to limit syntax highlighting
synchronization in the command window. This refactors the nvim_terminal
autocommand out of main() and into a new init_default_autocmds()
function, which is now part of the startup process and can be further
extended with more default autocommands down the road.

ref #6289 #6399
2021-09-02 04:17:04 -07:00
Mathias Fußenegger
5c643dee7b
docs(lsp): remove private lsp.diagnostic functions from docs (#15541)
Both `apply_to_diagnostic_items` and `show_diagnostics` are local
functions and cannot be called by users.
2021-09-01 14:28:15 +02:00
Mathias Fußenegger
684550ff38
docs(lsp): document codelens.get bufnr parameter (#15540)
Alternative to https://github.com/neovim/neovim/pull/15224
2021-09-01 13:29:11 +02:00
Gregory Anders
3c081d0280 fix(jobwait): always drain process event queues #15402
Problem:
jobwait() returns early if the job was stopped, but the job might have
pending callbacks on its event queue which are required to complete its
teardown. State such as term->closed might not be updated yet (by the
pending callbacks), so codepaths such as :bdelete think the job is still
running.

Solution:
Always flush the job's event queue before returning from jobwait().

ref #15349
2021-08-31 06:53:06 -07:00
marvim
119b4daced docs: regenerate 2021-08-29 15:34:51 +00:00
Gregory Anders
e5d464d8e0 docs: update 'backupdir' and 'undodir' descriptions 2021-08-27 10:45:25 -06:00
Gregory Anders
460019366e feat: defaults: auto-create backup dir
Copy the behavior of 'undodir' and create the last specified directory
in the 'backupdir' option if it doesn't exist.

Use trailing slashes for 'backupdir' as well as 'viewdir' and 'undodir'
by default. Note that 'undodir' always behaves as though it has the
trailing slashes, regardless of whether or not they are present. They
are added to the default option value to minimize surprise.

The '.' value in 'backupdir' is kept because the default behavior for
backups is solely to have a backup if the save of the main file to disk
fails. As soon as that save is completed the backup file is removed, so
generally there is no need to put them in a central location.

Co-authored by: murphy66 <murphy66@gmail.com>
2021-08-27 10:34:44 -06:00
zeertzjq
32024787b6
vim-patch:8.1.2229: color number column above/below cursor #15409
Problem:    Cannot color number column above/below cursor differently.
Solution:   Add LineNrAbove and LineNrBelow. (Shaun Brady, closes vim/vim#624)
efae76ab1a
2021-08-27 05:50:37 -07:00
Justin M. Keyes
4c499899b2
Merge #15293 Vimscript "method" syntax
Port VimL's method call syntax - vim-patch:8.1.{1638,1800,1803,1807,1809,1816,1820,1821,1828,1834,1835,1861,1863,1878,1879,1888,1909,1911,1912}
2021-08-26 04:26:32 -07:00
Lewis Russell
c5d76c5b9b
fix(doc): example for vim.diff() (#15464) 2021-08-23 13:47:54 +02:00
Thomas Vigouroux
34b60ec894
Merge pull request #15434 from Dkendal/feature-lua-treesitter-sibling
feat(treesitter): add next, prev sibling method
2021-08-23 09:14:40 +02:00
Gregory Anders
c2a211b8e3
docs: make Lua docstrings consistent #15255
The official developer documentation in in :h dev-lua-doc specifies to
use "--@" for special/magic tokens. However, this format is not
consistent with EmmyLua notation (used by some Lua language servers) nor
with the C version of the magic docstring tokens which use three comment
characters.

Further, the code base is currently split between usage of "--@",
"---@", and "--- @". In an effort to remain consistent, change all Lua
magic tokens to use "---@" and update the developer documentation
accordingly.
2021-08-22 13:55:28 -07:00
Lewis Russell
783140c670
fix(doc): move vim.diff doc (#15456)
... to prevent bots from overwriting it
2021-08-22 13:52:56 +02:00
Lewis Russell
3d3c0c669d
feat(api): add lua C bindings for xdiff (#14536)
* feat(api): add lua C bindings for xdiff

* chore: opt.hunk_lines -> opt.result_type

opt.on_hunk now takes precedence over opt.result_type

* chore: fix indents

Fix indents

* chore: change how priv is managed

Assign priv NULL and unconditionally apply XFREE_CLEAR to it when
finished.
2021-08-22 12:22:04 +02:00
Justin M. Keyes
8331cd13c4
docs #15447
- update ":help 'hidden'" #15410
- update ":help K" #15398
- try to capture some of the debug steps from #12036 (bpftrace, USDT probes)
2021-08-21 18:26:33 -07:00
Gregory Anders
50b30de200
feat(terminal): TermClose: set exit code in v:event.status #15406
Closes #4713
2021-08-20 10:45:28 -07:00
Dylan Kendal
140084180e
feat(treesitter): add next, prev sibling method
Add tsnode methods to change to the next, previous, named or unnamed
nodes.
2021-08-20 11:58:15 -04:00
github-actions[bot]
2ae9ff1285
docs: regenerate (#15431)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-08-19 20:28:18 +02:00
Björn Linse
d088066fa1
Merge pull request #15422 from bfredl/syn_name2id_go_brr
feat(highlights): some improvements and perf fixes
2021-08-19 15:48:22 +02:00
Björn Linse
fca52f5f32 feat(match): allow hl group to be defined after :match command 2021-08-19 15:08:50 +02:00
Gregory Anders
d417e67e59 feat(defaults): set nojoinspaces 2021-08-17 16:39:04 -06:00
Gregory Anders
f6c72b745c feat(defaults): set hidden 2021-08-17 16:38:39 -06:00
Gregory Anders
2cb8db34e3
feat: defaults: set undo points in <C-U> and <C-W> (#15400) 2021-08-16 18:28:52 -07:00
Gregory Anders
3954537b9e
feat(defaults): remove 'options' from viewoptions #15397
ref #6289
2021-08-16 13:05:24 -07:00
Mathias Fussenegger
c1e17866c8 docs(lsp): prevent internal comments from showing as vim.lsp.init docs 2021-08-16 20:27:51 +02:00
Gregory Anders
4ba74953b5
feat(defaults): switchbuf=uselast #15394 2021-08-16 11:20:46 -07:00
Gregory Anders
7215d35694
feat: defaults: inccommand=nosplit #15395 2021-08-16 10:39:17 -07:00
Gregory Anders
0aa8128aaa
feat(defaults): map CTRL-L to search highlights, update diffs #15385 2021-08-16 08:31:14 -07:00
Justin M. Keyes
54726e8bb9
fix(defaults): do not map Y in visual-mode #15387
Y in visual-mode is unrelated to the normal-mode behavior.

reverts part of #13268
2021-08-16 00:13:25 -07:00
Matthieu Coudron
5a111c1b02
feat(defaults): map Y to y$ #13268
rationale:
- consistent with D and Y
- long recommended by Vim's own ":help Y"

close #13268
close #416
ref #6289
2021-08-15 21:24:59 -07:00
Sean Dewar
b2994e35c9
feat(v:lua): support calling v:lua as a method 2021-08-13 01:11:36 +01:00
Sean Dewar
5d88349817
feat(eval): partially port v8.1.1915
Cannot be fully ported as chdir() hasn't been ported yet.
2021-08-12 22:35:25 +01:00
Sean Dewar
56b56a76e8
vim-patch:8.1.1911: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make a few more functions usable as a method.
64b4d73524

Note that the old-style version of Test_byteidx() was already translated
to a Lua test in 069_multibyte_formatting_spec.lua. Keep both versions,
using Test_byteidx() to mainly test the method call syntax for byteidx()
and byteidxcomp().
2021-08-12 22:35:24 +01:00
Sean Dewar
7925f0b633
vim-patch:8.1.1909: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make a few more functions usable as a method.
e49fbff384
2021-08-12 22:35:24 +01:00
Sean Dewar
5fbc1a49c7
vim-patch:8.1.1888: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
073e4b92e6

test_popup.vim already has the changes from this patch (they're N/A
anyway).
2021-08-12 22:35:24 +01:00
Sean Dewar
41dbd3a2e0
vim-patch:8.1.1879: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make float functions usable as a method.
93cf85f9ef

Fix atan2() doc typo (patch referred to it as atan()).
Adjust Test_fmod() method test to expect "str2float('nan')".
2021-08-12 22:35:23 +01:00
Sean Dewar
287a77ef51
vim-patch:8.1.1861: only some assert functions can be used as a method
Problem:    Only some assert functions can be used as a method.
Solution:   Allow using most assert functions as a method.
24278d2407

Port tests to assert_spec.lua.
2021-08-12 22:35:22 +01:00
Sean Dewar
f03dd22f0d
vim-patch:8.1.1835: cannot use printf() as a method
Problem:    Cannot use printf() as a method.
Solution:   Pass the base as the second argument to printf().
fd8ca21b3f
2021-08-12 22:35:22 +01:00
Sean Dewar
5811390f82
vim-patch:8.1.1834: cannot use a lambda as a method
Problem:    Cannot use a lambda as a method.
Solution:   Implement ->{lambda}(). (closes vim/vim#4768)
22a0c0c4ec

Add an additional lua_funcname argument to call_func_rettv() to maintain
support for v:lua.

A memory leak was introduced with this patch that was fixed in
v8.1.2107.
2021-08-12 22:35:22 +01:00
Sean Dewar
32589341a4
vim-patch:8.1.1828: not strict enough checking syntax of method invocation
Problem:    Not strict enough checking syntax of method invocation.
Solution:   Check there is no white space inside ->method(.
5184132ec0
2021-08-12 22:35:21 +01:00
Sean Dewar
aa2dc8b7b4
vim-patch:8.1.1809: more functions can be used as a method
Problem:    More functions can be used as a method.
Solution:   Add has_key(), split(), str2list(), etc.
a74e4946de
2021-08-12 22:35:20 +01:00
Sean Dewar
003c8acc8a
vim-patch:8.1.1807: more functions can be used as a method
Problem:    More functions can be used as a method.
Solution:   Add append(), appendbufline(), assert_equal(), etc.
            Also add the :eval command.
25e42231d3

:eval is already ported.
2021-08-12 22:35:20 +01:00
Sean Dewar
e6be6c307a
vim-patch:8.1.1803: all builtin functions are global
Problem:    All builtin functions are global.
Solution:   Add the method call operator ->.  Implemented for a limited number
            of functions.
ac92e25a33

- Note that to *exactly* port hunk @@ -7376,18 +7444,19 from
  handle_subscript(), we need the :scriptversion patches (I have an open
  PR for those, but this patch works fine without them anyway).
- Port call_internal_func() from v7.4.2058.
- Adjust some error messages in tests, as they rely on the Blob patches.
- Add a modeline to test_method.vim.

Ignore the global_functions and base_method tables and prefer the
current GPerf implementation. Instead, add an extra base_arg field to
VimLFuncDef that holds the number of the argument to use as the base
(1-indexed, so that 0 may be used to refer to functions that cannot be
used as methods).

This also means we support using any argument as a base from the get-go,
rather than just the first (Vim includes this ability in future patches,
however).

To mark a function as usable as a method, use the "base" key as
described in eval.lua.
2021-08-12 22:35:19 +01:00
Cezary Drożak
33b4513b89
doc: Document -complete=lua option (#15102) 2021-08-09 21:21:14 +02:00
github-actions[bot]
3cacd108d0
docs: regenerate (#15324)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-08-09 20:54:28 +02:00
Matthieu Coudron
0e9d97896a
Merge pull request #15307 from muniter/update-help.txt
docs(help.txt): Add a tag to the neovim api.
2021-08-09 19:51:47 +02:00
Javier Lopez
109a417e21 docs(help.txt): add treesitter to the main help file 2021-08-09 09:17:02 -05:00
Javier Lopez
4667bfb732 docs(help.txt): add a tag to the neovim api 2021-08-09 09:16:56 -05:00
Jan Edmund Lazo
43a874ab74
vim-patch:8.2.3198: cannot use 'formatlistpat' for breakindent
Problem:    Cannot use 'formatlistpat' for breakindent.
Solution:   Use a negative list indent. (Maxim Kim, closes vim/vim#8594)
f674b358fc

Port get_showbreak_value() from patch v8.1.2281
to avoid breaking changes when porting older patches.
2021-08-08 22:22:34 -04:00
Jan Edmund Lazo
f89a275e32
vim-patch:8.2.3160: 'breakindent' does not work well for bulleted lists
Problem:    'breakindent' does not work well for bulleted and numbered lists.
Solution:   Add the "list" entry to 'breakindentopt'. (Christian Brabandt,
            closes vim/vim#8564, closes vim/vim#1661)
4a0b85ad01
2021-08-08 22:22:34 -04:00
dundargoc
c9131ef9b5
docs: fix paragraph for BufEnter in the documentation (#15301) 2021-08-07 12:18:40 +02:00
Gregory Anders
2093b12b82 refactor: remove remaining references to nvim_buf_set_virtual_text 2021-08-03 11:39:46 -06:00
Jan Edmund Lazo
8baf7bce2b
Merge pull request #15226 from zeertzjq/vim-8.1.2029
vim-patch:8.1.2029,8.1.2117,8.1.2214,8.2.3204
2021-08-02 19:23:57 -04:00
zeertzjq
1666fe9dfe vim-patch:8.1.2029: cannot control 'cursorline' highlighting well
Problem:    Cannot control 'cursorline' highlighting well.
Solution:   Add "screenline". (Christian Brabandt, closes vim/vim#4933)
017ba07fa2
2021-08-02 05:41:17 +08:00
Bastian Ahrens
4c605ec78a doc(treesitter): Fix typos 2021-08-01 17:09:19 +02:00
Thomas Vigouroux
51251e1dc7
Merge pull request #15217 from neovim/marvim/api-doc-update/master
docs: regenerate
2021-08-01 11:26:00 +02:00
marvim
0c93525340 docs: regenerate 2021-07-31 20:26:57 +00:00
Jan Edmund Lazo
e4fedf5156
vim-patch:8.2.3254: win_gettype() does not recognize a quickfix window
Problem:    win_gettype() does not recognize a quickfix window.
Solution:   Add "quickfix" and "loclist". (Yegappan Lakshmanan, closes vim/vim#8676)
28d8421bfb
2021-07-31 15:10:51 -04:00
Jan Edmund Lazo
59e96717d2
vim-patch:8.2.3019: location list only has the start position.
Problem:    Location list only has the start position.
Solution:   Make it possible to add an end position. (Shane-XB-Qian,
            closes vim/vim#8393)
6864efa596

N/A patches for version.c:

vim-patch:8.2.3002: Vim doesn't abort on a fatal Tcl error

Problem:    Vim doesn't abort on a fatal Tcl error.
Solution:   Change emsg() to iemsg(). (Dominique Pellé, closes vim/vim#8383)
affd0bc626

vim-patch:8.2.3030: Coverity reports a memory leak

Problem:    Coverity reports a memory leak.
Solution:   Fix the leak and a few typos. (Dominique Pellé, closes vim/vim#8418)
cb54bc6562

Patch v8.2.3022 is mostly N/A but cannot be included here
because of new feature check for "has()".

vim-patch:8.2.3032: build problems with MSVC, other crypt issues with libsodium

Problem:    Build problems with MSVC, other crypt issues with libsodium.
Solution:   Adjust MSVC makefile. Disable swap file only when 'key' is set.
            Adjust error message used when key is wrong.  Fix Coverity issues.
            (Christian Brabandt, closes vim/vim#8420, closes vim/vim#8411)
226b28b961

vim-patch:8.2.3044: Amiga MorphOS and AROS: process ID is not valid

Problem:    Amiga MorphOS and AROS: process ID is not valid.
Solution:   Use FindTask to return something which is unique to all processes.
            (Ola Söder, closes vim/vim#8444)
3a62b14077

vim-patch:8.2.3046: Amiga MorphOS: Term mode is set using DOS packets

Problem:    Amiga MorphOS: Term mode is set using DOS packets.
Solution:   Use the same way of setting term mdoe on all next gen Amiga-like
            systems.  (Ola Söder, closes vim/vim#8445)
b420ac9d20
2021-07-31 15:10:23 -04:00
zeertzjq
5f01714b25
vim-patch:8.1.2019: 'cursorline' always highlights the whole line (#15161)
Problem:    'cursorline' always highlights the whole line.
Solution:   Add 'cursorlineopt' to specify what is highlighted.
            (closes vim/vim#4693)
410e98a70b
2021-07-30 21:51:26 -04:00
Jan Edmund Lazo
3865b43205
vim-patch:8.2.2957: using getchar() in Vim9 script is problematic
Problem:    Using getchar() in Vim9 script is problematic.
Solution:   Add getcharstr(). (closes vim/vim#8343)
3a7503c34c

Cherry-pick Test_getchar() changes from patch v8.1.2304
to sync with upstream.

Port f_getcharstr() to src/nvim/eval/funcs.c, not src/nvim/getchar.c.
Patch v8.1.2042 is not ported yet.
2021-07-29 21:51:39 -04:00
Björn Linse
d628e4250f
Merge pull request #15207 from gpanders/bye-syncolor
fix(highlight): remove syncolor.vim
2021-07-29 23:31:57 +02:00
Gregory Anders
3521bf7672
feat(lsp): implement vim.lsp.diagnostic.redraw() (#15203)
Add a new function to redraw diagnostics from the current diagnostic
cache, without receiving a "publishDiagnostics" message from the server.
This is already being done in two places in the Lua stdlib, so this
function unifies that functionality in addition to providing it to third
party plugins.

An example use case for this could be a command or key-binding for
toggling diagnostics virtual text. The virtual text configuration option
can be toggled using `vim.lsp.with` followed by
`vim.lsp.diagnostic.redraw()` to immediately redraw the diagnostics
with the updated setting.
2021-07-29 09:02:17 -07:00
zeertzjq
04ba81ddba vim-patch:8.2.3236: mode() does not indicate using CTRL-O in Select mode
Problem:    mode() does not indicate using CTRL-O in Select mode.
Solution:   Use "vs" and similar. (closes vim/vim#8640)
eaf3f36168
2021-07-29 07:47:17 +08:00
Gregory Anders
d3bc61b31d fixup! fix(highlight): remove syncolor.vim 2021-07-27 14:14:42 -06:00
Gregory Anders
9afa0d25a6 fix(highlight): remove syncolor.vim
Remove syncolor.vim in favor of defining the default highlight groups
directly in `init_highlight`. This approach provides a number of
advantages:

1. The highlights are always defined, regardless of whether or not the
   syntax regex engine is enabled.
2. Redundant sourcing of syntax files is eliminated (syncolor.vim was
   often sourced multiple times based on how the user's colorscheme file
   was written).
3. The syntax highlighting regex engine and the highlight groups
   themselves are more fully decoupled.
4. Removal of the confusing `:syntax on` / `:syntax enable` dichotomy
   (they now both do the same thing).

This approach also correctly solves a number of bugs related to
highlighting (#15176, #12573, #15205).
2021-07-27 14:14:30 -06:00
marvim
86baf582b8 docs: regenerate 2021-07-26 18:48:46 +00:00
Gregory Anders
3e00d4f01c
feat(lsp): make list handlers configurable (#15199)
The handlers for textDocument/references, textDocument/documentSymbol,
and workspace/symbol open their results in the quickfix list by default
and are not configurable. They are also incompatible with `vim.lsp.with`
as they do not accept a configuration parameter.

Add a `config` parameter to the handler for these three messages which
allows them to be configured with `vim.lsp.with`. Additionally, add a
new configuration option 'loclist' that, when true, causes these
handlers to open their results in the location list rather than the
quickfix list.
2021-07-26 11:39:50 -07:00
Thomas Vigouroux
b8813bacfe
Merge pull request #15090 from kraftwerk28/master
docs: fix typo in treesitter.txt
2021-07-26 20:38:11 +02:00
Thomas Vigouroux
5c42e2a87f
docs(ts): add documentation for listing fns 2021-07-25 20:52:05 +02:00
Björn Linse
192adfe99f
Merge pull request #14311 from matveyt/nomode_ce
refactor(state): Remove EXMODE_NORMAL
2021-07-25 19:35:23 +02:00
Stephan Seitz
289c153d1f doc: group documentation of predicates and directives 2021-07-24 20:57:45 +02:00
Stephan Seitz
b2a9afef6d treesitter: add query.list_directives 2021-07-24 20:57:45 +02:00
matveyt
8ce0929418 Remove EXMODE_NORMAL 2021-07-23 18:08:40 +02:00
Stephan Seitz
5ea6cc1d75 docs(tree-sitter): document highlight priority 2021-07-22 21:38:57 +02:00
Marc Jakobi
a8c3d50fad
lsp: add vim.lsp.diagnostic.set_qflist() function (#14831)
* Add vim.lsp.diagnostic.set_qflist() function
* replaces opts.open_loclist with unified opts.open
2021-07-22 08:48:28 -07:00
marvim
823412eda9 docs: regenerate 2021-07-19 21:24:46 +00:00
Ido Ariel
d8f5f4d090
doc(lsp): various small fixes (#15113)
- remove incorrect usage of docstrings
- fix make_formatting_params return type documentation to 'DocumentFormattingParams'
- make progress_handler private
- fix links
2021-07-17 11:15:57 +02:00
kraftwerk28
ceaef6bf3f docs: fix typo in treesitter.txt 2021-07-14 21:41:53 +03:00
Gregory Anders
eb7f24b4ae feat(job): add parameter to close stdin
Some programs behave differently when they detect that stdin is being
piped. This can be problematic when these programs are used with the job
control API where stdin is attached, but not typically used. It is
possible to run the job using a PTY which circumvents this problem, but
that includes a lot of overhead when simply closing the stdin pipe would
suffice.

To enable this behavior, add a new parameter to the jobstart options
dict called "stdin" with two valid values: "pipe" (the default)
implements the existing behavior of opening a channel for stdin and
"null" which disconnects stdin (or, if you prefer, connects it to
/dev/null). This is extensible so that other modes can be added in the
future.
2021-07-12 15:17:10 +02:00
Mathias Fußenegger
7c61d9c3bf
fix(lsp): Add separator between codelens in virttext (#15049)
Before:

  Lens1Lens2

After:

  Lens1 | Lens2

Fixes https://github.com/neovim/neovim/issues/15048
2021-07-10 21:35:38 +02:00
marvim
832e1708c2 docs: regenerate 2021-07-09 10:39:24 +00:00
marvim
6b313d68d0 docs: regenerate 2021-07-08 15:42:31 +00:00
Folke Lemaitre
af263711a3
feat(lsp): highlight active parameter in signature help (#15018) 2021-07-07 23:04:35 -07:00