Commit Graph

21986 Commits

Author SHA1 Message Date
bfredl
e3281d992e fix(tests): check for EOF on exit of nvim properly 2022-06-13 10:15:44 +02:00
zeertzjq
e95f32a717 vim-patch:8.2.5083: autocmd test still fails on MS-Windows
Problem:    Autocmd test still fails on MS-Windows.
Solution:   Change backward to forward slashes.
db77c49401
2022-06-13 16:05:26 +08:00
zeertzjq
1c16e5bb11 vim-patch:8.2.5081: autocmd test fails on MS-Windows
Problem:    Autocmd test fails on MS-Windows.
Solution:   Set shellslash to get forward slashes.
7c0d0c3c75
2022-06-13 16:05:19 +08:00
zeertzjq
254454d0c5 vim-patch:8.2.5079: DirChanged autocommand may use freed memory
Problem:    DirChanged autocommand may use freed memory. (Shane-XB Qian)
Solution:   Free the memory later. (closes vim/vim#10555)
d8c9d32c89

Code change is N/A as Nvim gets the full current directory again before
applying the autocommand, so this just ports the tests.
2022-06-13 16:05:02 +08:00
Justin M. Keyes
dd8b6094c0
build(lint): fix lintuncrustify #18945
Problem:
lintuncrustify doesn't actually do anything.

Solution:
- Fix the parameters.
- Fail correctly on nonzero result.

followup to #18940
2022-06-12 18:49:38 -07:00
Daniel Hahler
e420cd6c67
test: dismiss quit_more from Lua #11226
Add a test for what #16537 fixed.
2022-06-12 16:45:44 -07:00
zeertzjq
c665773897
Merge pull request #18931 from zeertzjq/regexp-num-escaped
fix(substitute): subtract number of backslashes later
2022-06-13 07:18:38 +08:00
dundargoc
3c7b91da10
build: remove CMAKE_CROSSCOMPILING code #18914
This is rarely, if ever, used and certainly not tested. It's likely this
isn't functional anymore.
2022-06-12 15:11:14 -07:00
Justin M. Keyes
f90174c98c
build(lint): fix luacheck not found #18940
Problem:
Since 6d57bb89c1 #18543, luacheck is not found on some systems when
running the "lintlua" target.

Solution:
- Move the find_program() to the top-level CMakeLists.txt
- Define a def_cmd_target() function with fewer assumptions than the old
  lint() function.
- Move "lintuncrustify" to src/nvim/CMakeLists.txt so it can reuse the
  $LINT_NVIM_SOURCES already defined there.
- Make the lint targets _fatal_ by default. There is little reason for
  the "lint" umbrella target defined in Makefile to exist if it's going
  to ignore the absence of the actual linters.
- For now, keep the uncrustify call in a separate cmake script so that
  it can be silenced (too noisy).
2022-06-12 15:08:01 -07:00
zeertzjq
429c40cce3
fix(buffer): disable buffer-updates before removing from window #18933
There can be other places that access window buffer info (e.g.
`tabpagebuflist()`), so checking `w_closing` in `win_findbuf()` doesn't
solve the crash in all cases, and may also cause Nvim's behavior to
diverge from Vim.

Fix #14998
2022-06-12 15:02:00 -07:00
bfredl
feba56af7d
Merge pull request #18936 from bfredl/apioption
refactor(api): reorganize code
2022-06-12 21:01:16 +02:00
Famiu Haque
2de0d67144
fix(inccommand): skip split window if not enough room #18937
Command preview now behaves like inccommand=nosplit when there's not
enough room for the preview window to be opened instead of aborting,
which is consistent with old behavior of 'inccommand'.
2022-06-12 10:59:04 -07:00
dundargoc
f4967828f9
feat(contrib): asan debugging script #18892
Opted to use a shell script because it's simpler to manipulate
environment variables than in makefiles.
2022-06-12 10:54:14 -07:00
bfredl
612944c586 refactor(api): update vimdoc 2022-06-12 19:45:39 +02:00
bfredl
0d63fafcda refactor(api): move command related API to separate file 2022-06-12 19:45:39 +02:00
bfredl
a907d6f517 refactor(api): move extmark specific functions to api/extmark.c 2022-06-12 16:45:18 +02:00
bfredl
4a275e3291 refactor(api): move option code to own file 2022-06-12 16:09:42 +02:00
zeertzjq
8bc48273eb vim-patch:8.2.5078: substitute test has a one second delay
Problem:    Substitute test has a one second delay.
Solution:   Use ":silent!".  Add another test case. (closes vim/vim#10558)
3269efdf01
2022-06-12 20:42:30 +08:00
zeertzjq
41bb81a2df fix(substitute): subtract number of backslashes later 2022-06-12 20:42:30 +08:00
bfredl
502f03fc06
Merge pull request #18919 from bfredl/multiattr
fix(messages): add color when showing nvim_echo in :messages history
2022-06-11 23:06:05 +02:00
bfredl
f4121c52b9 fix(messages): add color when showing nvim_echo in :messages history 2022-06-11 22:29:51 +02:00
bfredl
c87a5ebbc3
Merge pull request #18428 from bfredl/do_source
feat(api): nvim__get_runtime do_source
2022-06-11 11:32:23 +02:00
bfredl
e92fcdbab2 feat(api): nvim__get_runtime do_source 2022-06-11 10:25:59 +02:00
zeertzjq
2b539d6fdf
fix(inccommand): clear cmdpreview state if preview is not shown (#18923) 2022-06-11 13:04:19 +08:00
zeertzjq
2b252430aa
vim-patch:8.2.5076: unnecessary code (#18922)
Problem:    Unnecessary code.
Solution:   Remove code and replace with function call. (closes vim/vim#10552)
2e7cba347f
2022-06-11 07:00:56 +08:00
bfredl
673b3a780e
Merge pull request #18461 from dundargoc/refactor/change-linenr-to-int32
refactor: change type of linenr_T from long to int32_t
2022-06-10 19:28:47 +02:00
Dundar Goc
a732c253b7 refactor: change type of linenr_T from long to int32_t
The size of long varies depending on architecture, in contrast to the
MAXLNUM constant which sets the maximum allowable number of lines to
2^32-1. This discrepancy may lead to hard to detect bugs, for example
https://github.com/neovim/neovim/issues/18454. Setting linenr_T to a
fix maximum size of 2^32-1 will prevent this type of errors in the
future.

Also change the variables `amount` and `amount_after` to be linenr_T
since they're referring to "the line number difference" between two
texts.
2022-06-10 16:16:41 +02:00
zeertzjq
e15d31b530
fix(input): fix macro recording with ALT and special key (#18917) 2022-06-10 17:13:57 +08:00
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