Commit Graph

19122 Commits

Author SHA1 Message Date
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
Sean Dewar
0193b3a391
vim-patch:8.1.1336: some eval functionality is not covered by tests
Problem:    Some eval functionality is not covered by tests.
Solution:   Add a few more test cases. (Masato Nishihata, closes vim/vim#4374)
17aca707f9

Test_expand() changes are required for v8.1.1921.
Test_call() and Test_cindent_func() are already ported.
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
Björn Linse
3beea1fe1b
Merge pull request #15516 from bfredl/keyset
refactor(api): Represent option dicts as a structs in C and reduce conversion overhead from lua
2021-10-03 14:31:53 +02:00
Christian Clason
9fe704f88e
vim-patch:8.2.3464: nginx files are not recognized (#15883)
Problem:    nginx files are not recognized.
Solution:   Add several file patterns. (Chris Aumann, closes vim/vim#8922)
8b8c0ed657
2021-10-03 13:40:59 +02:00
Björn Linse
32565922ef refactor(api): handle option dicts properly
Do not copy a lot of lua strings (dict keys) to just strequal() them
Just compare them directly to a dedicated hash function.

feat(generators): HASHY McHASHFACE
2021-10-03 10:46:57 +02:00
Gregory Anders
23d13aa4cc
Merge pull request #15786 from gpanders/diagnostic-signs-unique-severity 2021-10-02 21:01:40 -06:00
Gregory Anders
0f554ef6f8 refactor(diagnostics): always make 'set' go through 'show'
Always make calls to `vim.diagnostic.set` call `vim.diagnostic.show`.
This creates an easier to reason about code path and is also less
surprising when users wish to override override `vim.diagnostic.show`
with custom behavior and `vim.diagnostic.set` is called with empty
diagnostics.

Functionally, the end result is the same: when `show` is called with an
empty diagnostics list, it just calls `hide` and then returns, which is
exactly what `reset` does right now.
2021-10-02 20:37:09 -06:00
Gregory Anders
1124439954 docs(diagnostic): add blurb on how to replace builtin handlers 2021-10-02 20:37:09 -06:00
Gregory Anders
c319c800cf test(diagnostic): add test case for signs 2021-10-02 20:37:09 -06:00
Sean Dewar
0c06da1f0a
fix(nvim_open_win): crash if autocmds delete buffer/window #15549
win_set_buf can trigger autocmds if noautocmd=false. If they close the window,
code afterwards will dereference the freed win_T* wp pointer.

This interaction became possible after commit 1def3d1542.

The reason deleting curbuf crashes, and not the buf passed to
`nvim_open_win`, is because the float initially edits curbuf (`win_init`)
until it's later set to edit buf (windows from `:new` and `:split <buf>`
behave similiarly: approx. `:split`, then `:buffer <buf>`).

`do_buffer` closes windows when their edited buffer is deleted (unless
it's the only window; N/A for floats), so the float closes when curbuf
is deleted, so we need to check `win_valid` after `win_set_buf` too.

Closes #15548
2021-10-02 19:10:59 -07:00
dundargoc
ad1c42a97d
vim-patch:8.2.3460: some type casts are not needed #15868
Problem:    Some type casts are not needed.
Solution:   Remove unnecessary type casts. (closes vim/vim#8934)
dfa5e464d4
2021-10-02 18:04:21 -07:00
zeertzjq
4449297d12
docs(lsp): clarify parameters of some util functions (#15851)
`pad_left` and `pad_right` are unused
List used keys of `opts` in `make_floating_popup_options`
2021-10-02 17:55:54 -07:00
zeertzjq
b3e815094b
fix(float)!: always anchor to corner of window including border #15832
N, W, S, E are all inclusive, i.e., always anchor to the exact corner of the
window (including border). This line may also need change in this case (change
0 to -1):

This is most consistent and easiest to reason about, especially with GUIs whose
border do not need to have width/height of 1/1 in cell units.

Fix #15789
2021-10-02 17:36:24 -07:00
Justin M. Keyes
c5e8c39102
Merge #15803 fix(lsp_spec): tests depend on previous session 2021-10-02 16:50:20 -07:00
dundargoc
8c74c895b3
refactor: format with uncrustify #15872
* refactor: format with uncrustify
* refactor: fix function parameter comments
2021-10-02 14:41:50 -07:00
kylo252
09307e64df
fix(docs): uncrustify.cfg location #15817 2021-10-02 14:32:18 -07:00
dundargoc
ac973d5532
docs: remove obsolete text on language #15875 2021-10-02 14:30:13 -07:00
erw7
c4857b695f
fix(input): resolve isolated (non-ALT/META) mappings #13109
Problem:
Since 2f06413dfb #13042, "ESC+c" sequence is treated as "ESC c"
instead of "M-c" (ALT/META+c) when not mapped, aka "fallthrough"
behavior. But "isolated" (non-ALT/META) mappings to ESC and c were not
resolved. This behavior is especially confusing for the TUI.

Solution:
Resolve isolated ESC, c mappings when there is no M-c mapping.
Change ins_char_typebuf() to escape CSI, K_SPECIAL.

fixes #13086
fixes #15869
2021-10-02 14:27:37 -07:00
Björn Linse
79fb9ed080
Merge pull request #15867 from bfredl/starpack
fix(runtime): add compressed {&packpath}/start/*/pack/*[/after] representation to &rtp

by suggestion by at-tpope

Summary:

We can add XDG_DATA_DIR/nvim/site/pack/*/start/* (et al) as an unexpanded wildchar to &rtp which keeps it both short and explicit and still supporting globpath(&rtp, ...).

ref #15101
2021-10-02 17:47:55 +02:00
Justin M. Keyes
069d1de184 fix(lsp_spec): tests depended on previous session
- fix tests which accidentally depended on previous session
2021-10-02 08:26:57 -07:00
Justin M. Keyes
c74a706869 fix(release.sh): ignore failed "rm" 2021-10-02 08:26:57 -07:00
dundargoc
9c268263b1
refactor: format with uncrustify #15842
* refactor: format with uncrustify
* refactor: convert function comments to doxygen
2021-10-02 07:59:41 -07:00
Björn Linse
9df7e022b4 fix(runtime): add packages as "/pack/*/start/*" patterns to &rtp
This makes `globpath(&rtp, ...)` work again for start packages
2021-10-02 16:45:19 +02:00
dundargoc
898f91f0f3
refactor: convert char_u to char #15824 2021-10-02 06:53:48 -07:00
zeertzjq
a3b5b4a31e
feat(vim-patch.sh): better detection of remote name #15846 2021-10-02 06:15:01 -07:00
Michael Lingelbach
724ffe7095
feat(diagnostics): add vim.diagnostic.get_namespaces (#15866)
Many vim.diagnostic functions expect the user to pass in a namespace id.

This PR allows the user to list active diagnostic namespaces:

```lua
:lua print(vim.inspect(vim.diagnostic.get_namespaces()))

{
  [7] = {
    name = "vim.lsp.client-1",
    opts = {},
    sign_group = "vim.diagnostic.vim.lsp.client-1"
  }
}
```
2021-10-01 22:50:28 -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
James McCoy
dc4670038e
Merge pull request #15864 from jamessan/gitattributes
fix: include ci/ in exported tarball
2021-10-01 19:55:01 -04:00
James McCoy
d6f03aaafd
fix: include ci/ in exported tarball
src/nvim/testdir/runnvim.sh re-uses the test suite code from ci/ to
cleanup the output of legacy tests.

Closes #15856

[skip ci]
2021-10-01 19:53:27 -04:00
James McCoy
a940952fe2
Merge pull request #15861 from dundargoc/refactor/xdiff
refactor: update path to xdiff in comments
2021-10-01 17:53:27 -04:00
James McCoy
1efbd4980f
Merge pull request #15862 from dundargoc/refactor/xdiff-pvs
refactor: remove PVS comment on top of files
2021-10-01 17:52:50 -04:00
James McCoy
d9b3e41a63
Merge pull request #15863 from dundargoc/docs/contributing/commit-message
docs: update preferred commit message style for the static analyzer PRs
2021-10-01 17:52:13 -04:00
Dundar Göc
38b0306591 docs: update preferred commit message style for the static analyzer PRs 2021-10-01 21:22:32 +02:00
Dundar Göc
3134ef3d9f refactor: remove PVS comment on top of files
The xdiff directory is excluded from the PVS report so the comment isn't
required.
2021-10-01 21:08:53 +02:00
Dundar Göc
19ab0f22cc refactor: update path to xdiff in comments 2021-10-01 21:07:02 +02:00
Björn Linse
9337fff8aa
Merge pull request #15852 from bfredl/afteragain
fix(runtime): fix ordering of "after" packages
2021-09-30 22:32:02 +02:00
Björn Linse
251ce9ddd1 fix(runtime): fix ordering of "after" packages
they must come after ordinary runtime dirs which are not "after"
2021-09-30 22:03:18 +02:00
dundargoc
7152353ade
ci: add type and scope from PR title as labels #15850
This only works if the label exists in the first place of course.
2021-09-30 08:08:36 -07:00
Jan Edmund Lazo
270cc1d70f
Merge pull request #14937 from dstein64/vim-8.1.2304
vim-patch:8.1.2304,8.1.2309,8.1.2319,8.1.2321
2021-09-29 20:59:53 -04:00
dundargoc
d90fb1c0bf
Refactor/uncrustify (#15790)
* refactor: format with uncrustify

* fixup(dundar): fix functions comments

* fixup(dundar): remove space between variable and ++/--

* fixup(dundar): better workaround for macro attributes

This is done to be able to better use uncrustify rules for macros

* fixup(justin): make preprocessors follow neovim style guide
2021-09-29 19:48:50 +02: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