Commit Graph

16048 Commits

Author SHA1 Message Date
Matthieu Coudron
b059fb5c67
Merge pull request #12654 from cbarrete/nomodifiable-hover
LSP: make the hover window nomodifiable
2020-07-21 19:50:33 +02:00
Thomas Vigouroux
be057197d3 buffer_updates: prefer using ml_add_deleted_len_buf 2020-07-21 19:18:04 +02:00
Thomas Vigouroux
2c34780c32 buffer_updates: emit valid old_byte_size
Test this using treesitter highlighting, which is based on this
old_byte_size.
2020-07-21 19:18:04 +02:00
Anmol Sethi
a6917f840d
man.vim: Simplify man#init to reduce load time (#12482)
I removed the SunOS stuff since no one uses SunOS and I've never tested
it on there.

I removed the section_flag init as we can just use -S instead of -s
and -S is used by every implementation as far as I know.

This brings man#init's time from 50-70ms to 15-20ms for me.

Closes #12318
Related #6766
Related #6815
2020-07-21 11:46:42 -04:00
Matthieu Coudron
459800db43
Merge pull request #12575 from cbarrete/vim-8.2.0935
[RFC] vim-patch:8.2.{0935,0937}
2020-07-20 22:04:30 +02:00
Cédric Barreteau
9464399c8c Fix documentation
The list parameter is an an [in,out] rather than just an [in].
2020-07-20 20:21:49 +02:00
Cédric Barreteau
fd6361278b Make the window nomodifiable when it's created 2020-07-20 20:16:46 +02:00
Cédric Barreteau
8bb2c3087a LSP: make the hover window nomodifiable 2020-07-20 20:16:46 +02:00
James McCoy
409a1dcdc6
Merge pull request #12653 from erw7/fix-build-freebsd-ci
build: Fix build failure with CI in FreeBSD
2020-07-20 07:49:10 -04:00
erw7
950ca6abcd
eval: improve ex_execute (#12445) 2020-07-20 11:01:14 +02:00
erw7
bfda389c5a build: Fix build failure with CI in FreeBSD
Co-authored-by: James McCoy <jamessan@jamessan.com>
2020-07-20 11:17:25 +09:00
TJ DeVries
398201cfab
lua: Fix crash on unprotected lua errors (#12658)
Can be reproduced with a script like this:

-- in some lua file
vim.fn.timer_start(10, function() error("uh....") end)

-- will cause neovim to crash with the following error.
PANIC: unprotected error in call to Lua API
        (nlua_CFunction_func_call failed.)

After this, it will instead print the error message
from the top of the stack, like so.

tmp/error_nvim.lua:10: uh...

Also added an example test. Previously this test
caused the embedded nvim to panic.
2020-07-19 17:16:48 -04:00
cbarrete
56f3b95180
doc: Add documentation for some vim.lsp.buf functions (#12552)
* Add documentation for some `vim.lsp.buf` functions

* Add inline Lua documentation

* Use generated documentation for LSP buffer functions

Co-authored-by: Cédric Barreteau <>
2020-07-19 17:16:12 -04:00
David Lukes
33837745bb
Fix / improve report messages (#12396) 2020-07-19 22:37:50 +02:00
Matthieu Coudron
e1d1c413f7
Merge pull request #12480 from nhooyr/mansect-trim
man.vim: Refactor verify_exists to unset $MANSECT as needed
2020-07-19 21:55:12 +02:00
Matthieu Coudron
6fcbcf72c3
Merge pull request #12448 from erw7/fix-shada-write-error-on-exit
Fix shada write error on exit, vim-patch:8.2.0920
2020-07-19 21:17:55 +02:00
Daniel Hahler
5a69eb99b7
tui.c: augment_terminfo: remove unused colorterm argument (#12602)
It is unused since 8898793ad.
2020-07-19 18:45:26 +02:00
erw7
02bbb8c45b
build: fix a problem with the static library name (#12591)
Fix the problem that the static library name was liblibnvim.a in the
environment other than Windows due to the change of bf58c00.
2020-07-19 18:42:41 +02:00
Matthieu Coudron
daa5bffd93
Merge pull request #12611 from janlazo/vim-8.0.1531
vim-patch:8.0.{1531,1544,1589,1591,1712,1745,1747},8.1.{819},8.2.{420,539,893,894,895,899,1114,1118,1169,1170,1171,1172,1173,1177,1179,1180,1181,1187,1188,1196,1198,1211,1214,1215,1222}
2020-07-19 18:41:40 +02:00
erw7
8e350c1c69
startup: fix stall issue with -D options (#12652)
fixes #12647.
2020-07-19 17:44:22 +02:00
Jan Edmund Lazo
140a372017
vim-patch:8.2.1222: using valgrind in Vim command started by test doesn't work
Problem:    When using valgrind a Vim command started by a test uses the same
            log file name which gets overwritten.
Solution:   Fix regexp to rename the log file.
657a826c07
2020-07-19 11:40:35 -04:00
Jan Edmund Lazo
bb1f06fa82
vim-patch:8.2.1211: removed more than dead code
Problem:    Removed more than dead code.
Solution:   Put back the decrement.
8455c5ed31

N/A patch for version.c:

vim-patch:8.2.1118: condition can never be true, dead code

Problem:    Condition can never be true, dead code.
Solution:   Remove the dead code.
810af5ea46

vim-patch:8.2.1214: MS-Windows: default _vimrc not correct in silent install mode

Problem:    MS-Windows: default _vimrc not correct in silent install mode.
Solution:   Add the LoadDefaultVimrc macro. (Ken Takata, closes vim/vim#6451)
ceb56ddbaf

vim-patch:8.2.1215: Atari MiNT support is outdated

Problem:    Atari MiNT support is outdated.
Solution:   Nobody responded this code is still useful, so let's delete it.
e3f915d12c
2020-07-19 11:40:35 -04:00
Jan Edmund Lazo
e16f2cbd12
vim-patch:8.2.0539: comparing two NULL list fails
Problem:    Comparing two NULL list fails.
Solution:   Change the order of comparing two lists.
7b293c730b

N/A patches for version.c:

vim-patch:8.2.1187: terminal2 test sometimes hangs in the GUI on Travis

Problem:    Terminal2 test sometimes hangs in the GUI on Travis.
Solution:   Disable Test_zz2_terminal_guioptions_bang() for now.
c85156bb89

vim-patch:8.2.1188: memory leak with invalid json input

Problem:    Memory leak with invalid json input.
Solution:   Free all keys at the end. (Dominique Pellé, closes vim/vim#6443,
            closes vim/vim#6442)
6d3a7213f5

vim-patch:8.2.1196: build failure with normal features

Problem:    Build failure with normal features.
Solution:   Add #ifdef.
83e7450053

vim-patch:8.2.1198: terminal2 test sometimes hangs in the GUI on Travis

Problem:    Terminal2 test sometimes hangs in the GUI on Travis.
Solution:   Move test function to terminal3 to see if the problem moves too.
a4b442614c
2020-07-19 11:40:34 -04:00
Jan Edmund Lazo
bf88228180
vim-patch:8.2.0899: assert_equalfile() does not give a hint about the difference
Problem:    Assert_equalfile() does not give a hint about the difference.
Solution:   Display the last seen text.
30cc44a97f
2020-07-19 11:40:34 -04:00
Jan Edmund Lazo
93f2dc0d03
vim-patch:8.2.0893: assert_equalfile() does not take a third argument
Problem:    Assert_equalfile() does not take a third argument.
Solution:   Implement the third argument. (Gary Johnson)
fb517bac23
2020-07-19 11:40:34 -04:00
Jan Edmund Lazo
ab69ea26dc
vim-patch:8.1.0819: a failed assert with a long string is hard to read
Problem:    A failed assert with a long string is hard to read.
Solution:   Shorten the assert message.
865767126e
2020-07-19 11:40:34 -04:00
Jan Edmund Lazo
65793a90d7
vim-patch:8.2.0895: :mkspell output does not mention the tree type
Problem:    :mkspell output does not mention the tree type.
Solution:   Back out increasing the limits, it has no effect.  Mention the
            tree being compressed.  Only give a message once per second.
408c23b079
2020-07-19 11:40:33 -04:00
Jan Edmund Lazo
420aff590a
vim-patch:8.2.0894: :mkspell can take very long if the word count is high
Problem:    :mkspell can take very long if the word count is high.
Solution:   Use long to avoid negative numbers.  Increase the limits by 20% if
            the compression did not have effect.
59f88fbf24
2020-07-19 11:40:33 -04:00
Jan Edmund Lazo
db8682b94e
vim-patch:8.2.0420: Vim9: cannot interrupt a loop with CTRL-C
Problem:    Vim9: cannot interrupt a loop with CTRL-C.
Solution:   Check for CTRL-C once in a while.  Doesn't fully work yet.
f1ec378b01

Vim9 test, commented out in this patch, is restored in patch 8.2.0421.
Vim9 tests were not ported over so skip the temporary change.

Vim should stop pushing broken commits on master.
2020-07-19 11:38:35 -04:00
Jan Edmund Lazo
be9de61012
vim-patch:8.2.1170: cursor off by one with block paste while 'virtualedit' "all"
Problem:    Cursor off by one with block paste while 'virtualedit' is "all".
Solution:   Adjust condition. (Hugo Gualandi, closes vim/vim#6430)
ef85a9b2d9

N/A patches for version.c:

vim-patch:8.2.1114: terminal test sometimes times out

Problem:    Terminal test sometimes times out.
Solution:   Split the test in two parts.
1112c0febb

vim-patch:8.2.1171: possible crash when out of memory

Problem:    Possible crash when out of memory.
Solution:   Check for NULL pointer. (Dominique Pellé, closes vim/vim#6432)
58bb61cf5e

vim-patch:8.2.1172: error messages when doing "make clean" in doc or tee

Problem:    Error messages when doing "make clean" in the runtime/doc or
            src/tee directories.
Solution:   Use "rm -f".
08fc48492a

vim-patch:8.2.1173: tee doesn't build on some systems

Problem:    Tee doesn't build on some systems.
Solution:   Include header files. (Dominique Pelle, closes vim/vim#6431)
4004315292

vim-patch:8.2.1177: terminal2 test sometimes hangs in the GUI

Problem:    Terminal2 test sometimes hangs in the GUI.
Solution:   Move some tests to other files to further locate the problem.
            Set the GUI to a fixed screen size.
18aa13d13b

vim-patch:8.2.1179: Test_termwinscroll() sometimes hangs in the GUI

Problem:    Test_termwinscroll() sometimes hangs in the GUI.
Solution:   Skip the test in the GUI.
f65927fc8d

vim-patch:8.2.1180: build failure in small version

Problem:    Build failure in small version.
Solution:   Add #ifdef.
1e624c912d

vim-patch:8.2.1181: json code not fully tested

Problem:    Json code not fully tested.
Solution:   Add more test coverage. (Dominique Pellé, closes vim/vim#6433)
21e5bdd271
2020-07-19 11:38:35 -04:00
Jan Edmund Lazo
0c498200f4
vim-patch:8.2.1169: write NUL past allocated space using corrupted spell file
Problem:    Write NUL past allocated space using corrupted spell file.
            (Markus Vervier)
Solution:   Init "c" every time.
97d2f34c87

N/A patches for version.c:

vim-patch:8.0.1531: cannot use 24 bit colors in MS-Windows console

Problem:    Cannot use 24 bit colors in MS-Windows console.
Solution:   Add support for vcon. (Nobuhiro Takasaki, Ken Takasaki,
            fixes vim/vim#1270, fixes vim/vim#2060)
cafafb381a

vim-patch:8.0.1544: when using 'termguicolors' SpellBad doesn't show

Problem:    When using 'termguicolors' SpellBad doesn't show.
Solution:   When the GUI colors are not set fall back to the cterm colors.
d4fc577e60

vim-patch:8.0.1589: error for setting 'modifiable' when resetting it

Problem:    Error for setting 'modifiable' when resetting it.
Solution:   Check if 'modifiable' was actually set.
d7db27bafd

vim-patch:8.0.1591: MS-Windows: when reparsing the arguments 'wildignore' matters

Problem:    MS-Windows: when reparsing the arguments 'wildignore' matters.
Solution:   Save and reset 'wildignore'. (Yasuhiro Matsumoto, closes vim/vim#2702)
20586cb4f4

vim-patch:8.0.1712: terminal scrollback is not limited

Problem:    Terminal scrollback is not limited.
Solution:   Add the 'terminalscroll' option.
8c041b6b95

Neovim has 'scrollback' option, not 'terminalscroll',
to limit scrollback in terminal buffers.

vim-patch:8.0.1745: build failure on MS-Windows

Problem:    Build failure on MS-Windows.
Solution:   Build job arguments for MS-Windows. Fix allocating job twice.
2060892028

vim-patch:8.0.1747: MS-Windows: term_start() does not set job_info() cmd

Problem:    MS-Windows: term_start() does not set job_info() cmd.
Solution:   Share the code from job_start() to set jv_argv.
ebe74b7367
2020-07-19 11:38:34 -04:00
cbarrete
08efa7037e
lsp: Add support for call hierarchies (#12556)
* LSP: Add support for call hierarchies

* LSP: Add support for call hierarchies

* LSP: Add support for call hierarchies

* LSP: Jump to call location

Jump to the call site instead of jumping to the definition of the
caller/callee.

* LSP: add tests for the call hierarchy callbacks

* Fix linting error

Co-authored-by: Cédric Barreteau <>
2020-07-18 15:10:09 -04:00
Cédric Barreteau
9f7f42ea0a Prevent flatten from taking a null list 2020-07-15 20:32:20 +02:00
Cédric Barreteau
fd57d69970 vim-patch:8.2.0937: asan failure in the flatten() test
Problem:    Asan failure in the flatten() test.
Solution:   Free the flattened list.
dcf59c37d0
2020-07-15 20:27:20 +02:00
Cédric Barreteau
6420615e3f vim-patch:8.2.0935: flattening a list with existing code is slow
Problem:    Flattening a list with existing code is slow.
Solution:   Add flatten(). (Mopp, closes vim/vim#3676)
077a1e670a
2020-07-15 20:27:20 +02:00
Ville Hakulinen
a02a267f8a
Reuse inccommand preview window (fix #11529) (#12612)
* Reuse inccommand preview window

Currently, show_sub (inside ex_substitute) creates a new split on each
run for its existing buffer, and ex_substitute calls close_windows for
it. This functionality seems to relay in delayed operations on window
structures where the close event on the newest window is "cancelled" by
win_grid_alloc. But for multigrid, there is optimization in place in
win_grid_alloc which causes any (unnecessary?) allocations to be
skipped, and thus inccommand preview window is not preserved but closed
immediately. Alternative fix would be to remove said optimization, but
the whole "lets create a new split each time and trash the earlier
window" seems too wasteful.

Fix #11529

* Update failing test

The failing test sets inccommand=split and does `:%s/.`, but isn't
expecting to get any contents for the preview window, other than the
windows status line. Update the test to include the preview window
contents too.
2020-07-15 08:46:47 -04:00
TJ DeVries
1ca67a73c0
Merge pull request #12507 from tjdevries/tjdevries/viml_lua_callbacks
[RFC] Allow passing lua functions and closures into vim functions.
2020-07-11 17:40:31 -04:00
TJ DeVries
6360cf7ce8 lua: Add ability to pass tables with __call
vim-patch:8.2.1054: not so easy to pass a lua function to Vim
vim-patch:8.2.1084: Lua: registering function has useless code

I think I have also opened up the possibility for people to use these
callbacks elsewhere, since I've added a new struct that we should be
able to use.

Also, this should allow us to determine what the state of a list is in
Lua or a dictionary in Lua, since we now can track the luaref as we go.
2020-07-10 20:23:12 -04:00
TJ DeVries
971a191c4d lua: Add ability to pass lua functions directly to vimL 2020-07-10 16:17:33 -04:00
TJ DeVries
a695da7d3f
Merge pull request #12590 from nvim-treesitter/ts-fix-highlight
[RDY] Treesitter: fix highlight, attempt 2
2020-07-10 12:58:44 -04:00
Thomas Vigouroux
341e139992 treesitter: add parser on_lines callbacks 2020-07-10 17:16:24 +02:00
Thomas Vigouroux
0f7eaa3555 treesitter: cache the capture hl relation 2020-07-10 17:16:24 +02:00
Thomas Vigouroux
d19132ffd1 treesitter: update test to show overlapping works 2020-07-10 17:16:24 +02:00
Thomas Vigouroux
c5119dbad6 treesitter: use change calbacks on redraw 2020-07-10 17:16:23 +02:00
Thomas Vigouroux
529251d5e4
treesitter: call bufload before parsing (#12603) 2020-07-10 09:33:27 -04:00
TJ DeVries
b39edb5b60
doc: Add information about lua function calls (#12574) 2020-07-08 10:42:34 -04:00
Christian Clason
91572ddad1
doc: mention that defer_fn applies schedule_wrap (#12601) 2020-07-07 10:55:40 +02:00
Matthieu Coudron
e49fc4ba1f
Merge pull request #12538 from janlazo/vim-8.2.1055
vim-patch:8.1.{93,1372},8.2.{1055,1060,1089,1095,1104}
2020-07-06 23:31:24 +02:00
Christian Clason
4ab7bbf3ea
lua: add options to highlight.on_yank (#12549)
NOTE: Configuration options have  changed for highlight.on_yank.

Check help for |:help highlight.on_yank()|
2020-07-05 21:30:12 -04:00
Christian Clason
f9579d473e
lsp: add optional vertical padding, maximal size to floats (#12444)
* add vertical padding to floats

* add max_width, max_height option to float methods

* lint

* lintlint

* guard against nil wrap_at
2020-07-05 21:09:52 -04:00