Commit Graph

21808 Commits

Author SHA1 Message Date
Christian Clason
6eaf10502c
vim-patch:partial:63f32603789d (#18916)
Update runtime files
63f3260378

skip translations
skip user manual rewrite
2022-06-10 08:40:32 +02:00
Gregory Anders
58323b1fe2
feat(filetype): remove side effects from vim.filetype.match (#18894)
Many filetypes from filetype.vim set buffer-local variables, meaning
vim.filetype.match cannot be used without side effects. Instead of
setting these buffer-local variables in the filetype detection functions
themselves, have vim.filetype.match return an optional function value
that, when called, sets these variables. This allows vim.filetype.match
to work without side effects.
2022-06-09 13:12:36 -06:00
dundargoc
28e43881b7
refactor(ops): doxygen docstrings #17743 2022-06-09 08:12:07 -07:00
dundargoc
6d57bb89c1
build: add a cmake target for all used linters #18543
* build: move the logic for linters to cmake
Cmake is our source of truth. We should have as much of our build
process there as possible so everyone can make use of it.

* build: remove redundant check for ninja generator
The minimum cmake version as of writing this is 3.10, which has ninja
support.
2022-06-09 08:09:24 -07:00
Justin M. Keyes
9662cd7f48
fix(tests): unreliable parser_spec #18911
The "first run" has high variability. Looks like the test failures
correlate with 545dc82c1b
, which makes sense because that improves "first run" performance.

So the `1000*` factor of this test could be adjusted to e.g. `300*` or `500*`.

ref https://github.com/neovim/neovim/pull/16945
2022-06-09 08:07:54 -07:00
fkm3
bf327368d8
fix: segfault in find_tagfunc_tags #18841
fixes #15221

I tried to reproduce with a test, but failed. The below patch is able to
cause the out of bound access (I verified by adding a check to the
code), but it doesn't seg fault or trigger asan/valgrind errors.

```
diff --git a/src/nvim/testdir/test_tagfunc.vim b/src/nvim/testdir/test_tagfunc.vim
index ffc1d63b9..22828a39f 100644
--- a/src/nvim/testdir/test_tagfunc.vim
+++ b/src/nvim/testdir/test_tagfunc.vim
@@ -117,4 +117,26 @@ func Test_tagfunc_settagstack()
   delfunc Mytagfunc2
 endfunc

+func Test_tagfunc_settagstack_many()
+
+  func Mytagfunc1(pat, flags, info)
+    return [{'name' : 'mytag', 'filename' : 'Xtest', 'cmd' : '1'}]
+  endfunc
+  set tagfunc=Mytagfunc1
+  call writefile([''], 'Xtest')
+
+  for i in range(0,20)
+    let pos = [bufnr()]  + getcurpos()[1:]
+    let newtag = [{'tagname' : 'mytag' + i, 'from' : pos}]
+    call settagstack(1, {'items' : newtag}, 'a')
+    call settagstack(1, {'curidx' : 21})
+  endfor
+
+  tag
+
+  call delete('Xtest')
+  set tagfunc&
+  delfunc Mytagfunc1
+endfunc
```
2022-06-09 08:05:36 -07:00
resolritter
11e0fea8ba
fix: correct nlua_wait error message #18867
the message is wrapped in `if (timeout < 0)`, which means 0 is a valid value
2022-06-09 08:02:32 -07:00
zeertzjq
d189bfaeb2
Merge pull request #18908 from zeertzjq/vim-8.2.5066
vim-patch:8.2.{5066,5070}: lcs-leadmultispace
2022-06-09 22:01:32 +08:00
zeertzjq
b8742afb6f vim-patch:8.2.5070: unnecessary code
Problem:    Unnecessary code.
Solution:   Remove code that isn't needed. (closes vim/vim#10534)
b5f0801b1f
2022-06-09 21:26:24 +08:00
zeertzjq
d6247a575c vim-patch:8.2.5066: lcs-leadmultispace
aca12fd89b
2022-06-09 21:26:23 +08:00
kylo252
3da3cfc864
feat(autocmds): retrieve lua callback (#18642)
add a new `callback` field to `nvim_get_autocmds`
2022-06-09 07:18:56 -06:00
James McCoy
c5720c7221
Merge pull request #18904 from jamessan/no-parser-ci
ci: run tests with no treesitter parsers installed
2022-06-08 21:55:05 -04:00
James McCoy
a4e1b76f55
test: allow running CI without ts parsers installed 2022-06-08 21:10:49 -04:00
James McCoy
950ab00c2b
ci: run tests with no treesitter parsers installed 2022-06-08 21:10:34 -04:00
James McCoy
8a70c53dad
Merge pull request #18903 from jamessan/skip-test-parsers
test(ts): skip test if C parser is not available
2022-06-08 21:10:01 -04:00
Javier Lopez
916d848049
fix(terminal): scrollback delete lines immediately #18832
* on_scrollback_option_changed renamed to adjust_scrollback. The
  function name did not correspond to what it was doing. It is
  called unconditionally in every refresh of the terminal
  unrelated if the scrollback option was changed.
* new on_scrollback_option_changed function, which calls
  refresh_terminal, which then calls adjust_scrollback
* terminal_check_size is not the appropriate function to call when the
  option is changed since it only conditionally adjusts the scrollback.
  Use the new on_scrollback_option_changed

fixes #15477
fixes #11811
2022-06-08 17:46:57 -07:00
James McCoy
10291bb854
Merge pull request #18788 from dundargoc/ci/api-docs/color
ci(api-docs): show required changes with color
2022-06-08 19:55:51 -04:00
James McCoy
6b0595d7cc
test(ts): skip test if C parser is not available 2022-06-08 18:04:25 -04:00
mohsen
94181ad7dc
fix(diagnostic): check for negative column value (#18868) 2022-06-08 12:55:39 -06:00
Justin M. Keyes
4d9e2247c9
refactor(log): simplify log_path_init #18898
Problem:
Since 22b52dd462 #11501, log_path_init is called in log_init, so it is
now called at a deterministic time. So the "just in time" complexity of
log_path_init is no longer needed.

Solution:
Remove logic intended to try to "heal" partial initialization.
2022-06-08 08:47:34 -07:00
bfredl
f48aa68e08
Merge pull request #18896 from famiu/fix/nvim_create_user_command/smods
fix(nvim_create_user_command): make `smods` work with `nvim_cmd`
2022-06-08 12:41:59 +02:00
Famiu Haque
c84bd9e21f fix(nvim_create_user_command): make smods work with nvim_cmd
Closes #18876.
2022-06-08 15:24:52 +06:00
Sean Dewar
3cd22a3485
fix(eval/f_getmatches): return empty list for invalid win argument (#18893)
Slight inaccuracy in v8.1.1084's port.
Like Vim, it should return [], not 0.
Ref #18890
2022-06-07 16:55:32 +01:00
bfredl
057a280867
Merge pull request #18870 from zbirenbaum/winhl-cursor
fix(highlight): let winhighlight use cursor
2022-06-07 14:52:35 +02:00
Christian Clason
1324e7f79e
vim-patch:partial:016188fd8a30 (#18890)
Update runtime files.
016188fd8a

omit changes from doc/builtin.txt (needs 8.2.1536, 8.2.4981)
skip user manual rewrite for Vim9script
2022-06-07 14:41:53 +02:00
zbirenbaum
df70a3abcd fix(highlight): let winhighlight use cursor 2022-06-07 02:15:32 -04:00
zeertzjq
9e442c17ee
fix(input): allow Ctrl-C to interrupt a recursive mapping even if mapped (#18885) 2022-06-07 12:41:18 +08:00
zeertzjq
ab1f96e1d5
vim-patch:8.2.5064: no test for what 8.1.0052 fixes (#18881)
Problem:    No test for what 8.1.0052 fixes.
Solution:   Add a test. (closes vim/vim#10531)
3760bfddc4
2022-06-07 00:19:57 +08:00
Jonas Strittmatter
41a49dd9c8
refactor(runtime): port remaining patterns from filetype.vim to filetype.lua (#18814) 2022-06-06 09:25:33 -06:00
Javier Lopez
cf2738109a
docs: documenting struct members inline #18783
Without the proper comments, doxygen doesn't understand the comment
belongs to the struct member:

https://www.doxygen.nl/manual/docblocks.html#memberdoc

[skip ci]
2022-06-06 05:30:48 -07:00
zeertzjq
ae02c02f1f
vim-patch:8.2.5058: input() does not handle composing characters properly (#18872)
Problem:    input() does not handle composing characters properly.
Solution:   Use mb_cptr2char_adv() instead of mb_ptr2char_adv().
            (closes vim/vim#10527)
e3a529bc87

Cherry-pick all of Test_input_func() from patch 8.2.0316.
2022-06-06 05:45:59 +08:00
Mathias Fußenegger
e4df1c9b9e
fix(lsp): fix multi client handling in code action (#18869)
Fixes https://github.com/neovim/neovim/issues/18860
2022-06-05 16:43:32 +02:00
zeertzjq
214f866fe5
fix(terminfo): disable smglr for vtpcon and conemu (#18855) 2022-06-05 14:39:56 +02:00
bfredl
e13dcdf162
Merge pull request #18864 from bfredl/optcut
perf(tests): don't invoke nvim_get_all_options_info until needed
2022-06-05 00:48:43 +02:00
bfredl
545dc82c1b perf(tests): don't invoke nvim_get_all_options_info until needed
This call alone is responible of 40 000 000 out of 80 000 000
individual alloc/free calls in the test suite.
2022-06-05 00:11:57 +02:00
dundargoc
9ce720a601
docs: specify CMAKE_BUILD_TYPE=RelWithDebInfo in README (#18859)
There have been complaints about the installation instructions being
inconsistent around the build type e.g.
https://github.com/neovim/neovim/issues/18670#issuecomment-1146468741.
Use CMAKE_BUILD_TYPE for both examples in the README.
2022-06-05 03:15:06 +08:00
bfredl
79a194a278
Merge pull request #18861 from bfredl/norplugin
fix(startup): nvim with --clean should not load user rplugins
2022-06-04 19:25:52 +02:00
bfredl
aad20de5ab fix(startup): nvim with --clean should not load user rplugins
runtime rplugins such like legacy script providers are not affected
by this change.
2022-06-04 18:37:54 +02:00
Christian Clason
df4ffce543
vim-patch:partial:cfa8f9a3f285 (#18858)
Update runtime files
cfa8f9a3f2

skip syntax/vim.vim (needs 8.2.4770)
skip doc/syntax.vim (needs several colorscheme patches)
skip further rewrite of manual
2022-06-04 10:53:42 +02:00
zeertzjq
9961a9702e
fix(lsp): set buflisted before switching to buffer (#18854) 2022-06-04 10:23:43 +02:00
Christian Clason
e6fa4cca24
vim-patch:8.2.5054: no good filetype for conf files similar to dosini (#18851)
Problem:    No good filetype for conf files similar to dosini.
Solution:   Add the confini filetype. (closes vim/vim#10510)
635f48010d
2022-06-04 09:49:01 +02:00
dundargoc
ff20d40321
docs: fix typos (#18269)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Dan Sully <dan+github@sully.org>
Co-authored-by: saher <msaher.shair@gmail.com>
Co-authored-by: Stephan Seitz <stephan.seitz@fau.de>
Co-authored-by: Benedikt Müller <d12bb@posteo.de>
Co-authored-by: Andrey Mishchenko <mishchea@gmail.com>
Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
Co-authored-by: Oliver Marriott <hello@omarriott.com>
2022-06-04 11:56:36 +08:00
Gregory Anders
86cc33a464
fix(filetype): fix typo in starsetf function (#18856) 2022-06-03 21:52:59 -06:00
Mathias Fußenegger
c6d747e6a5
feat(lsp): send didChangeConfiguration after init (#18847)
Most LSP servers require the notification to correctly load the
settings and for those who don't it doesn't cause any harm.

So far this is done in lspconfig, but with the addition of vim.lsp.start
it should be part of core.
2022-06-03 18:16:11 +02:00
Oliver Marriott
9aba204335
fix(hl): set Normal hl group sg_attr value #18820
fix #18024
2022-06-03 08:29:49 -07:00
kylo252
84d8cc3ae5
ci: use python3 explicitly to fix macos warnings #18837
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020

Testing `pynvim` compatibility with python2 should not be done in core,
and there's only a provider_spec for python3 either way.
2022-06-03 08:15:45 -07:00
bfredl
64e946c50f
Merge pull request #18848 from bfredl/backevenagain
fix(log): back even again
2022-06-03 17:02:47 +02:00
bfredl
8c86feb930 fix(log): back even again 2022-06-03 16:26:50 +02:00
bfredl
dd0e9910da
Merge pull request #18846 from bfredl/unpackfix
fix(api): some robustness issues in api_parse_enter
2022-06-03 15:02:10 +02:00
Mathias Fußenegger
69774e3179
feat(lsp): add a start function (#18631)
A alternative/subset of https://github.com/neovim/neovim/pull/18506  that should be forward compatible with a potential project system.

Configuration of LSP clients (without lspconfig) now looks like this:

    vim.lsp.start({
       name = 'my-server-name',
       cmd = {'name-of-language-server-executable'},
       root_dir = vim.fs.dirname(vim.fs.find({'setup.py', 'pyproject.toml'}, { upward = true })[1]),
    })
2022-06-03 14:59:19 +02:00