Commit Graph

9160 Commits

Author SHA1 Message Date
Justin M. Keyes
975be7e5dc build/win: fix warnings
../src/nvim/os/fs.c: In function 'os_can_exe':
  ../src/nvim/os/fs.c:247:27: warning: passing argument 1 of 'is_executable_ext' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    247 |     if (is_executable_ext(name, abspath)) {
        |                           ^~~~
  In file included from ../src/nvim/os/fs.c:36:
  src/nvim/auto/os/fs.c.generated.h:7:38: note: expected 'char *' but argument is of type 'const char *'
      7 | static _Bool is_executable_ext(char *name, char **abspath) FUNC_ATTR_NONNULL_ARG(1);
        |                                ~~~~~~^~~~
  ../src/nvim/os/fs.c: In function 'os_resolve_shortcut':
  ../src/nvim/os/fs.c:1183:56: warning: conversion from 'size_t' {aka 'const long long unsigned int'} to 'int' may change value [-Wconversion]
   1183 |     const int conversion_result = utf8_to_utf16(fname, len, &p);
        |                                                        ^~~
  ../src/nvim/os/fs.c:1211:19: warning: declaration of 'conversion_result' shadows a previous local [-Wshadow]
   1211 |         const int conversion_result = utf16_to_utf8(wsz, -1, &rfname);
        |                   ^~~~~~~~~~~~~~~~~
  ../src/nvim/os/fs.c:1183:15: note: shadowed declaration is here
   1183 |     const int conversion_result = utf8_to_utf16(fname, len, &p);
        |               ^~~~~~~~~~~~~~~~~
2019-08-15 00:28:41 +02:00
Justin M. Keyes
c9a0875ea8 os/: remove redundant define 2019-08-15 00:28:41 +02:00
Justin M. Keyes
07cc72ad5d utf16_to_utf8: align with libuv
- take a size parameter
- return libuv error code
- handle error in caller only (avoid redundant messages)

53995a3825
4c945f4936
2019-08-15 00:28:41 +02:00
Justin M. Keyes
8727f7a6a4 utf8_to_utf16: align with libuv
- take a size parameter
- always NUL-terminate the result
- return libuv error code
- handle error in caller only (avoid redundant messages)

53995a3825
4c945f4936
2019-08-15 00:28:41 +02:00
Björn Linse
7d92c391a1
Merge pull request #10774 from bfredl/miminal_fdc
api: nvim_win_open() style="minimal" should disable 'foldcolumn'
2019-08-14 23:54:08 +02:00
Daniel Hahler
9bf3fab60b
Merge pull request #10779 from blueyed/ci-homebrew-no-update
ci: fix Travis
2019-08-14 23:21:41 +02:00
Daniel Hahler
ae31de32ee build: TSan: add src/.tsan-suppressions
Uses runtime suppressions instead of a blacklist, which can only ignore
whole files/functions.

Ref: https://github.com/google/sanitizers/wiki/ThreadSanitizerSuppressions
Ref: https://github.com/neovim/neovim/pull/10591#issuecomment-521248233
2019-08-14 23:17:53 +02:00
Björn Linse
48b43352b0 pyxversion: fix logic error #10759
Do not incorrectly prefer python2 if python3 is working.
fixes #10758
2019-08-14 22:36:43 +02:00
Ihor Antonov
ebcb9adcc4 clang/"null pointer dereference" #10776
assert(curbuf) in ins_compl_get_exp
2019-08-14 20:50:30 +02:00
Daniel Hahler
5cc45bb419
ci: Travis: check logs for TSan also (#10775)
Uses `cat -A` with early "*San" check:
This prints terminal escape sequences as-is (for debugging), and does
not cause (display) issues with the Travis log.

Ref: https://github.com/neovim/neovim/pull/10591#issuecomment-521248233
2019-08-14 18:27:08 +02:00
Björn Linse
f9f238b21a api: nvim_win_open() style="minimal" should disable 'foldcolumn' 2019-08-14 14:49:27 +02:00
Björn Linse
ba0aaf012a compositor: handle invalid screen positions after resize gracefully
The screen resize logic needs to be refactored to be simpler and more
deterministic. Until then, we need to handle attempts to draw outside of the
screen size gracefully, just like the old vim code did.

fixes #9989
2019-08-14 13:11:20 +02:00
Justin M. Keyes
5ad67af3c1
Merge #10763 from justinmk/startup-guicursor
startup: handle 'guicursor' after user config
2019-08-14 11:28:39 +02:00
Daniel Hahler
7668f04392 tests: include timer_start in duration #10772
This should not make much of a difference, but increases the timeout
when `load_factor` is used slightly.
2019-08-14 08:59:06 +02:00
mg979
a690bf8116 mksession: use exists(':tcd'), not has('nvim') #10770
Since recent vim versions also support :tcd, check for the actual
availability of the command, rather than has('nvim').
2019-08-14 08:45:54 +02:00
Daniel Hahler
c285ebfa73
vim-patch:8.1.0456: running test hangs when the input file is being edited (#10764)
Problem:    Running test hangs when the input file is being edited.
Solution:   Use a SwapExists autocommand to ignore editing the test script.
d8f27b30d6
2019-08-14 01:56:59 +02:00
Justin M. Keyes
02c52a18f5 style 2019-08-13 22:22:47 +02:00
Justin M. Keyes
cbfd18c85a startup: handle 'guicursor' after user config
If parse_shape_opt() is done before user config, the TUI may cause
unwanted changes to the terminal cursor which cannot later be undone
(see #4396).

fix #10750
2019-08-13 22:19:00 +02:00
Daniel Hahler
db41d02e48 vim-patch:8.1.1842: test listed as flaky should no longer be flaky
Problem:    Test listed as flaky should no longer be flaky.
Solution:   Remove Test_popup_and_window_resize from the list of flaky tests.
            (Daniel Hahler, close vim/vim#4807)
9570aacdb8
2019-08-13 22:15:54 +02:00
Daniel Hahler
4e6c596431 vim-patch:8.0.1179: Test_popup_and_window_resize() does not always pass
Problem:    Test_popup_and_window_resize() does not always pass.
Solution:   Do not use $VIMPROG, pass the Vim executable in the vimcmd file.
            (Ozaki Kiichi, closes vim/vim#2186)
631820536e

vim-patch:8.0.1526: no test using a screen dump yet

Problem:    No test using a screen dump yet.
Solution:   Add a test for C syntax highlighting.  Add helper functions.
da65058a9c

NOTE: uses modified `GetVimProg()` (which is used with skipped tests only
(mostly because of `!has('terminal')`)).

Vim uses a 'vimcmd' file, while Nvim uses `$NVIM_TEST_ARGX` environment
variables.

Ref: https://github.com/vim/vim/pull/4806
2019-08-13 22:15:54 +02:00
Ihor Antonov
947bd293c9 clang/"null pointer dereference" #10755 2019-08-13 20:52:25 +02:00
Jan Edmund Lazo
5e1acd412b vim-patch:8.1.1843: might be freeing memory that was not allocated (#10756)
Problem:    Might be freeing memory that was not allocated.
Solution:   Have next_fenc() set the fenc_alloced flag. (closes vim/vim#4804)
f077db2423
2019-08-13 16:46:26 +02:00
Daniel Hahler
90e44ecf11
build: link libraries by full path (for luv.so) (#10661)
Use "luv" as imported library to work around "-lluv" being used due to
missing SONAME.

Fixes https://github.com/neovim/neovim/issues/10407.
Ref: https://gitlab.kitware.com/cmake/cmake/issues/19578
Ref: https://github.com/NixOS/nixpkgs/issues/64400#issuecomment-516557253
2019-08-12 18:22:02 +02:00
Daniel Hahler
a336a05e7e
testdir/test_popup.vim: sync/align with Vim (#10751) 2019-08-12 17:10:48 +02:00
Ghjuvan Lacambre
2037028b50 ex_getln.c: fix compute_cmdrow() not resetting lines_left (#10749)
Before this commit, when `inccomand` was set to `nosplit`, multi-line
substitutions collapsed the command-line.

This happened because when ex_getln.c:cursorcmd() computed a msg_row, it
was given a cmdline_row one line too high. This happened because
message.c:msg_puts_display() was supposed to decrement cmdline_row but
didn't, because of the `msg_no_more && lines_left == 0` check placed
just before the decrementation part in msg_puts_display's while loop.

Every time msg_puts_display writes a line, it decreases `lines_left` (a
variable used to know how many lines are left for prompts). Since
redrawcommandline() did not reset `lines_left` between calls to
msg_puts_display, every time a character was pressed, `lines_left` was
decremented. This meant that once the user pressed COLUMNS+ROWS numbers
of characters, `lines_left` would reach 0 and prevent msg_row from being
decremented.

It makes sense to fix setting `lines_left` to `cmdline_row` in
`compute_cmdrow` ; after all, computing where the command line row
should be placed is equivalent to computing how many `lines_left` of
output there are left.

Closes #8254.
2019-08-12 14:21:15 +02:00
Justin M. Keyes
ad4eb18e43 Merge #10098 'win: fix msg_puts_printf()' 2019-08-12 02:42:13 +02:00
Justin M. Keyes
71378a4030 free_buffer: rework b:changedtick handling #9163
- Re-enable Test_BufLeave_Wipe. 66f5e5c7d7

This is my (probably-wrong) application of Zyx's suggestion in #9163:

> free_buffer_stuff() already removes changedtick. It is better to
> make `free_options` a flag variable and avoid calling
> buf_init_changedtick() based on some flag there: current workflow
> looks weird as it first removes `b:changedtick`, then re-adds it
> by calling buf_init_changedtick(), then remove again.

> Also based on my understanding it looks logical to not remove
> `b:changedtick`, but to *replace* it with something allocated if
> needed based on examining reference count before calling
> `unref_var_dict`. Because now you have key disappearing from
> dictionary for no good reason.

Patch-By: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
2019-08-12 02:17:49 +02:00
Justin M. Keyes
feee862064 vim-patch:8.0.1193: crash when wiping buffer after getbufinfo()
Problem:    Crash when wiping out a buffer after using getbufinfo().
            (Yegappan Lakshmanan)
Solution:   Remove b:changedtick from the buffer variables.

(Note: The test changes in vim-patch:8.0.1193 were already included.)
2019-08-12 02:17:49 +02:00
Daniel Hahler
48dc6344d6
Merge pull request #10745 from blueyed/vim-8.1.1461
vim-patch:8.1.1461 / vim-patch:8.1.1462
2019-08-11 20:35:31 +02:00
erw7
6616d1d3e5 win/env: Vim-compat: Empty string deletes env var #10743
- Windows: `set FOO=` deletes environment variable FOO, and there is no
  way to set empty string expect by calling the API.
- Vim-compatible: `:let $FOO=""` deletes the environment variable.
- See also Test_WindowsHome().

ref: https://github.com/neovim/neovim/pull/10657#issuecomment-516368089
2019-08-11 15:32:07 +02:00
Daniel Hahler
2193e68837 vim-patch:8.1.1462: MS-Windows: using special character requires quoting
Problem:    MS-Windows: using special character requires quoting.
Solution:   Add quotes. (Ken Takata)
c974022c31
2019-08-11 13:24:17 +02:00
Daniel Hahler
143b02c573 vim-patch:8.1.1461: tests do not run or are not reliable on some systems
Problem:    Tests do not run or are not reliable on some systems.
Solution:   Use "findstr" instead of "grep" on MS-Windows. Clear
            PROMPT_COMMAND in the terminal test. Delete temp file. Wait for
            output after executing a debug command. (Yegappan Lakshmanan,
            closes vim/vim#4479)
ddd3308782

Ignored changes to testdir/test_terminal.vim.
2019-08-11 13:23:30 +02:00
Daniel Hahler
0a98765b44 test_source.vim: move Test_source_sandbox 2019-08-11 13:23:30 +02:00
erw7
7d664837e1 win: expand nested env var #10662
Vim-compatible behavior for a Windows edge case.
2019-08-11 09:51:00 +02:00
Ihor Antonov
e5d388f23a clang/"Argument with 'nonnull' attribute passed null" #10739
Problem:  In screen.c grid_char_needs_redraw clang warns
          that grid->chars could be NULL

Solution: Suggested by bfredl. Add explicit check
          grid->chars != NULL in grid_put_linebuf
          similar to grid_puts_len
2019-08-11 09:47:49 +02:00
Björn Linse
c190415dc2
Merge pull request #10738 from bfredl/cmdwinclose
api/window: disallow closing non-current window in cmdwin state
2019-08-10 21:21:13 +02:00
Björn Linse
67664c74f8 api/window: disallow closing non-current window in cmdwin state 2019-08-10 17:41:31 +02:00
Daniel Hahler
ac395411cd testdir/test_taglist.vim: move Test_tagsfile_without_trailing_newline
Align with Vim.  Added in a79c0c8f7.
2019-08-10 17:21:47 +02:00
Daniel Hahler
4109ee8ef4 vim-patch:8.1.0911: tag line with Ex command cannot have extra fields
Problem:    Tag line with Ex command cannot have extra fields.
Solution:   Recognize |;" as the end of the command. (closes vim/vim#2402)
943e9639a9
2019-08-10 17:21:18 +02:00
R. Simon
5f243fc68a API: nvim_win_close: Fix closing cmdline-window #10087 2019-08-10 13:41:35 +02:00
Justin M. Keyes
278c5d452c
win/os_env_exists(): workaround libuv bug #10734
os_env_exists() fails on MSVC build:
    os_env_exists:104: uv_os_getenv(EMPTY_VAR) failed: -4094 UNKNOWN

- Revert 396a3945c4
- HACK: Windows: return TRUE if uv_os_getenv() returns UV_UNKNOWN, until
  libuv bug is fixed: https://github.com/libuv/libuv/issues/2413

ref 396a3945c4 (r34642361)
2019-08-10 11:48:36 +02:00
Jan Edmund Lazo
43a8242cd5 vim-patch:8.1.1458: crash when using gtags #10704
Problem:    Crash when using gtags. (issue vim/vim#4102)
Solution:   Check for negative row or col in screen_puts_len(). (Christian
            Brabandt)
0b4c9eddb5
2019-08-10 00:21:52 +02:00
Daniel Hahler
06d9cc734b exists(): return false for empty env var #10657
Fixes https://github.com/neovim/neovim/issues/3266
close #10657
2019-08-09 23:42:03 +02:00
Justin M. Keyes
5aa97937e7
Merge #10706 from janlazo/vim-8.1.1465
vim-patch:8.1.{1465,1467}
2019-08-09 23:32:23 +02:00
Daniel Hahler
e2d6e67bbc
Merge pull request #10171 from blueyed/vim-8.1.1318
vim-patch:8.1.1318: code for text changes is in a "misc" file
2019-08-09 19:25:56 +02:00
Daniel Hahler
939d9053bd
channels: reflect exit due to signals in exit status code (#10573)
Uses `128 + term_signal` in case of exit due to a signal.

Fixes https://github.com/neovim/neovim/issues/10571.
2019-08-09 15:34:06 +02:00
Justin M. Keyes
642e7daed5
Merge #9782 from janlazo/vim-8.1.0199
vim-patch:8.1.{199,200}
2019-08-09 12:00:47 +02:00
Ihor Antonov
3c0d637592 clang/"Null passed as a nonnull parameter" #10718 2019-08-09 11:24:30 +02:00
Justin M. Keyes
8a56bd944a Merge #10708 'remove DYNAMIC_ICONV'
closes #3457
2019-08-09 11:19:37 +02:00
Adrien Fabre
47b7b471fa :terminal : update buffer when switching tabpage #10700
fix #10696
2019-08-09 10:37:08 +02:00
Jan Edmund Lazo
a48896c6e7 vim-patch:8.1.1540: cannot build without +eval #10729
Problem:    Cannot build without the +eval feature.
Solution:   Define ex_const if needed.
0abb4273f6
2019-08-09 10:28:15 +02:00
Daniel Hahler
480794146f f_spellbadword: set len=0 for non-found word
`len` is used with `list_append_string` later, and should reflect the
length of `word` (i.e. 0 when not setting word / breaking above).

Ref: neovim/neovim#9782 (comment)
2019-08-08 21:40:29 -04:00
Jan Edmund Lazo
d1ce15f696 vim-patch:8.1.0200: spellbadword() not tested
Problem:    spellbadword() not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3235)
872e451e8c
2019-08-08 21:31:20 -04:00
Jan Edmund Lazo
18888c15fc vim-patch:8.1.0199: spellbadword() does not check for caps error
Problem:    spellbadword() does not check for caps error. (Dominique Pelle)
Solution:   Adjust capcol when advancing.
66ab916935
2019-08-08 21:31:20 -04:00
Björn Linse
1f54f68732 lua: minimal UTF-16 support needed for LSP 2019-08-08 20:10:14 +02:00
Jan Edmund Lazo
ce628e1187 vim-patch:8.1.1824: crash when correctly spelled word is very long (#10725)
Problem:    Crash when correctly spelled word is very long. (Ben Kraft)
Solution:   Check word length before copying. (closes vim/vim#4778)
5bcc5a1ff9
2019-08-08 17:23:25 +02:00
Daniel Hahler
564838159e lint 2019-08-07 14:21:23 +02:00
Daniel Hahler
e269c1028b remove !has_mbyte branches
Ref: https://github.com/neovim/neovim/pull/10171#discussion_r292437832
2019-08-07 14:21:23 +02:00
Daniel Hahler
0e3b9ea74d includes 2019-08-07 14:21:23 +02:00
Daniel Hahler
aa6aa732e9 move ins_char 2019-08-07 14:21:23 +02:00
Daniel Hahler
dfe8cab0c1 lint 2019-08-07 14:21:23 +02:00
Daniel Hahler
f7fac33a1f move del_lines 2019-08-07 14:21:23 +02:00
Daniel Hahler
41fa6079b2 lint/sync: truncate_line 2019-08-07 14:21:23 +02:00
Daniel Hahler
be08d52e11 move truncate_line 2019-08-07 14:21:23 +02:00
Daniel Hahler
33e6cffb9b lint/sync: open_line 2019-08-07 14:21:23 +02:00
Daniel Hahler
2f225886b0 move open_line 2019-08-07 14:21:23 +02:00
Daniel Hahler
b706b1f049 move copy_indent (from nvim's indent.c) 2019-08-07 14:21:23 +02:00
Daniel Hahler
e454dce5e4 move del_bytes 2019-08-07 14:21:23 +02:00
Daniel Hahler
0b3ee2e8ac move del_char, del_chars 2019-08-07 14:21:23 +02:00
Daniel Hahler
75598927f2 move ins_str 2019-08-07 14:21:23 +02:00
Daniel Hahler
c0f71ef826 move ins_char_bytes 2019-08-07 14:21:23 +02:00
Daniel Hahler
664b6adebe move ins_bytes, ins_bytes_len 2019-08-07 14:21:23 +02:00
Daniel Hahler
1117592f64 move unchanged 2019-08-07 14:21:23 +02:00
Daniel Hahler
f717deea06 move changed_lines 2019-08-07 14:21:23 +02:00
Daniel Hahler
b353d8599b move deleted_lines, deleted_lines_mark, changed_lines_buf 2019-08-07 14:21:23 +02:00
Daniel Hahler
83d35e62f2 move appended_lines_mark 2019-08-07 14:21:23 +02:00
Daniel Hahler
d9f2d53239 move appended_lines 2019-08-07 14:21:23 +02:00
Daniel Hahler
c2cd9178ca remove inserted_bytes (comes via text properties, v8.1.0678) 2019-08-07 14:21:23 +02:00
Daniel Hahler
ac6671946a move changedOneline, changed_bytes 2019-08-07 14:21:23 +02:00
Daniel Hahler
53210c16d1 move changed_common 2019-08-07 14:21:23 +02:00
Daniel Hahler
0e5314f56e move changed_int/changed_internal 2019-08-07 14:21:23 +02:00
Daniel Hahler
a822b3e547 move changed 2019-08-07 14:21:23 +02:00
Daniel Hahler
2a421e52e4 move change_warning 2019-08-07 14:21:23 +02:00
Daniel Hahler
e8cd2bcf37 header 2019-08-07 14:21:23 +02:00
Daniel Hahler
4a8a87c3a9 orig src/nvim/change.c 2019-08-07 14:21:23 +02:00
Björn Linse
d75fc87dec
Merge pull request #10703 from ngortheone/clang_dead2
clang/"dead assignment": suppessed getchar.c

Possibly invalid, read on line 1972:
if (keylen >= 0 && keylen <= typebuf.tb_len) {
2019-08-07 10:27:07 +02:00
Björn Linse
6fb0020df4
Merge pull request #10513 from bfredl/bytecount
api/lua: add {byte_count} parameter to line region change event
2019-08-06 20:25:46 +02:00
Björn Linse
c0993ed343 lua: support getting UTF-32 and UTF-16 sizes of replaced text 2019-08-06 20:24:36 +02:00
Daniel Hahler
dc1359bf8e
Fix list_features to include space after first feature (#10711)
Regressed in e134cc9d4a: the use of list_in_columns was not adding a
space after the first features, because we do not start on a new line:

> Features: -acl+iconv +tui

This moves all the related code to `list_features`, and just joins them
with spaces.
2019-08-06 18:55:14 +02:00
Björn Linse
b0e26199ec lua: add {old_byte_size} to on_lines buffer change event 2019-08-06 17:01:47 +02:00
erw7
d6f15ccc3c remove DYNAMIC_ICONV 2019-08-06 12:44:22 +09:00
Jan Edmund Lazo
11a6dac8c9 vim-patch:8.1.1467: cscope test fails
Problem:    Cscope test fails.
Solution:   Update expected text.
d6ec1730ba
2019-08-05 22:41:51 -04:00
Jan Edmund Lazo
ce7bcdec23 vim-patch:8.1.1465: allocating wrong amount of memory
Problem:    Allocating wrong amount of memory. (Yegappan Lakshmanan)
Solution:   Use sizeof() for right type of struct.
a37833dbd7
2019-08-05 22:40:48 -04:00
Daniel Hahler
d55b12ea50 f_environ: cleanup/refactor
- use os_getenvname_at_index / os_getenv
- f_getenv: empty (*p == NUL) is not null (undefined)
2019-08-06 01:23:11 +02:00
Daniel Hahler
fd66ad2262 vim-patch:8.1.1305: there is no easy way to manipulate environment variables
Problem:    There is no easy way to manipulate environment variables.
Solution:   Add environ(), getenv() and setenv(). (Yasuhiro Matsumoto,
            closes vim/vim#2875)
691ddeefb5
2019-08-06 01:17:32 +02:00
Ihor Antonov
b09e03c64d clang/"dead assignment": screen.c #10702
Suppress the warning.

mb_c and mb_l describe a char together, they are not independent variables. The
coupled assignments are good practice to avoid future confusion, even if the
current code doesn't use an assigned value.
2019-08-06 00:53:54 +02:00
Ihor Antonov
512f24f71d clang/"dead assignment": suppessed
To ensure consistency and avoid possible errors in the code
the assigment is considered to be legit.
2019-08-05 18:40:31 -04:00
Jan Edmund Lazo
7086751c5e vim-patch:8.1.1439: ga_grow(): 1.5x growth rate #10699
Problem:    Json_encode() is very slow for large results.
Solution:   In the growarray use a growth of at least 50%. (Ken Takata,
            closes vim/vim#4461)
c47ed44be7
2019-08-05 23:42:41 +02:00
Björn Linse
f5d1e0e7b1
Merge pull request #10690 from bfredl/lua_print
lua: laundry list (crashes and additions)
2019-08-05 13:59:40 +02:00
Björn Linse
88938634e7 lua: add vim.in_fast_event() to check if we are in a luv callback 2019-08-05 13:57:24 +02:00
Björn Linse
e6d77993d1 lua: do not crash on syntax error in debug.debug() 2019-08-05 13:19:44 +02:00
Björn Linse
d3a7bdefb0 lua: immediate-callback safe print() 2019-08-05 13:19:44 +02:00
Jan Edmund Lazo
6871445dfe vim-patch:8.1.1383: warning for size_t/int mixup (#10694)
Problem:    Warning for size_t/int mixup.
Solution:   Change type. (Mike Williams)
d33a764123
2019-08-05 03:35:46 +02:00
Justin M. Keyes
45c34bd84a
:doautocmd : Never show "No matching autocommands" #10689
The message is useless, it doesn't even mention the event name.

vim_dev discussion:
https://groups.google.com/forum/#!msg/vim_dev/RTbq58TMq9w/Xr4rSoUTCgAJ

ref: https://github.com/vim/vim/issues/4300
2019-08-05 03:33:45 +02:00
Jan Edmund Lazo
01ddb39699 vim-patch:8.1.1311: test: abort autocmd with exception #10692
Problem:    Aborting an autocmd with an exception is not tested.
Solution:   Add a test.  Also shows how to abort a command by throwing an
            exception.
23b5139234
2019-08-05 01:54:17 +02:00
Jan Edmund Lazo
a724209b5a vim-patch:8.1.1251: test completion of mapping keys #10691
Problem:    No test for completion of mapping keys.
Solution:   Add a test.  Also clean up the code.
2cb9f02532
2019-08-05 01:12:35 +02:00
Justin M. Keyes
2141dc2262 provider: check #Call() if g:loaded_xx_provider=2 2019-08-04 13:23:46 +02:00
Justin M. Keyes
5e6a08f2e6 provider: skip non-provider has() feature-names
We don't want to retry autoload sourcing (slow) for every random has()
query that finds it way to eval_call_provider().
2019-08-04 13:23:46 +02:00
Justin M. Keyes
241956720d provider: g:loaded_xx_provider=2 means "enabled and working"
Value of 1 cannot be used, because users might set that in their vimrc
to _disable_ a provider, which would confuse :checkhealth and has().
2019-08-04 13:23:46 +02:00
Justin M. Keyes
66938b928c provider: decide status by g:loaded_xx_provider 2019-08-04 13:23:46 +02:00
Rui Abreu Ferreira
2cfe4748e5 provider: let providers decide their status
Instead of deciding provider status in eval_has_provider, move the
decision to the provider Vim scripts.

Previously, provider loading worked as follows:

1. eval_has_provider() verified provider availability by searching for
   the provider#providername#Call function and cached this verificaion as a static
   variable for some providers
2. providers short-circuited on loading to prevent the definition of the
   Call function (with the exception of the node provider that did not)

This commit changes the expected interface between nvim and its
providers to facilitate provider reloading, by splitting the
verification of the provider from the availability of the Call function.

eval_has_provider() now checks for a provider#providername#enabled
variable. It is up to the provider script to set this to 0 or 1
accordingly. eval_call_provider() remains unchanged.

All providers hosting a Call function were updated to respect this.

The clipboard provider now has a Reload function to reload the
provider.
2019-08-04 13:23:46 +02:00
Jan Edmund Lazo
5dd860fd73 vim-patch:8.1.1237: error for using "compl", reserved word in C++
Problem:    Error for using "compl", reserved word in C++.
Solution:   Rename to "complp". (suggestion by Ken Takata)
52111f8231
2019-08-03 12:38:50 -04:00
Jan Edmund Lazo
01b2dac727 vim-patch:8.1.1796: :argdo is not tested
Problem:    :argdo is not tested
Solution:   Add a test.
72e1b39111
2019-08-03 11:38:52 -04:00
Jan Edmund Lazo
620a906406 vim-patch:8.1.1775: error message may be empty in filetype test
Problem:    Error message may be empty in filetype test.
Solution:   Use v:exception instead. (Daniel Hahler, closs vim/vim#4744)
eee9f65b2a
2019-08-02 19:51:04 -04:00
Jan Edmund Lazo
12fe0cf5f9 vim-patch:8.1.1762: some filetype rules are in the wrong place
Problem:    Some filetype rules are in the wrong place.
Solution:   Move to the right place.  Add a few more tests.
c273405188
2019-08-02 19:48:32 -04:00
Jan Edmund Lazo
d827a750f7 vim-patch:8.1.1761: filetype "vuejs" causes problems for some users
Problem:    Filetype "vuejs" causes problems for some users.
Solution:   Rename to "vue".
4248111497
2019-08-02 19:46:34 -04:00
Jan Edmund Lazo
cdd8540a20 vim-patch:8.1.1187: cannot recognize Pipfile
Problem:    Cannot recognize Pipfile.
Solution:   Use existing filetypes. (Charles Ross, closes vim/vim#4280)
3a4c53ba51
2019-08-02 19:44:37 -04:00
Daniel Hahler
24fb7eefaa
terminfo_start: use unibi_from_term, skip without TERM (#10670)
This is clearer/more explicit and avoids potential mismatch between what unibilium thinks vs what Nvim thinks.

For reference: e3b16d6219/uniutil.c (L203-L211)
2019-08-02 19:39:29 +02:00
Justin M. Keyes
b92a5bc3c4
Merge #10664 from janlazo/vim-8.1.1780
vim-patch:8.1.{1374,1780}
2019-08-02 06:01:46 +02:00
Justin M. Keyes
1f6c9fd822
stream: log unwritten bytes, if any #10663 2019-08-01 15:26:22 +02:00
Daniel Hahler
41bb68b8e8 process_stop: uv: do not close stdin first/explicitly #10584
- process_stop: do not close stdin explicitly. The "close stdin" step was from
  aa9cb48, before we fixed/reworked the SIGTERM timing logic. So it's probably
  outdated / no longer needed.
- win: jobstop: exit_code 15
   GetExitCodeProcess appears to return the used signal.
   https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess

ref #10573
2019-08-01 13:55:06 +02:00
Jan Edmund Lazo
c708567262 fileio: port hotfix from patch 8.1.1379
Patch 8.1.1379 includes a change to a test, added in Patch 8.1.0815.
Patch 8.1.0815 includes runtime doc changes to Blob.
Neovim does not support Blobs yet.
2019-08-01 04:35:23 -04:00
Jan Edmund Lazo
7995a5e964 vim-patch:8.1.1374: check for file changed triggers too often
Problem:    Check for file changed triggers too often.
Solution:   Don't use "b_p_ar" when it is negative.
c97582b029
2019-08-01 04:29:39 -04:00
Jan Edmund Lazo
28946c285b lint 2019-08-01 04:20:35 -04:00
Jan Edmund Lazo
309296545c vim-patch:8.1.1780: warning for file no longer available is repeated
Problem:    Warning for file no longer available is repeated every time Vim is
            focused. (Brian Armstrong)
Solution:   Only give the message once. (closes vim/vim#4748)
674e2bde6e
2019-07-31 21:49:36 -04:00
Justin M. Keyes
65578693b2
Merge #10654 from ngortheone/clang/npd_helptags_one
clang/"null pointer dereference": ex_cmds.c
2019-07-31 07:22:12 +02:00
Ihor Antonov
6fc0a9f557 lint: helptags_one 2019-07-30 16:58:28 -04:00
Daniel Hahler
6e01ed6a4c vim-patch:8.1.0572: stopping a job does not work properly on OpenBSD
Problem:    Stopping a job does not work properly on OpenBSD.
Solution:   Do not use getpgid() to check the process group of the job
            processs ID, always pass the negative process ID to kill().
            (George Koehler, closes vim/vim#3656)
76ab4fd619

Ref: https://github.com/neovim/neovim/issues/9704
Ref: https://github.com/neovim/neovim/issues/10182#issuecomment-514450069
Closes https://github.com/neovim/neovim/pull/10660
2019-07-30 18:41:38 +02:00
Daniel Hahler
da87b67812
tests: runnvim.vim: do not call jobstop() (#10659)
It should be done for timeouts only (-1, not != -1), but the job is
stopped via `:bwipeout!` already also in that case.

Fixes E900 with timing out tests:

    "test_xxx.tlog" "test_xxx.tlog" [New] 183L, 13375C written
    Error detected while processing function Main:
    line   37:
    E900: Invalid channel id================================================================================
2019-07-30 15:08:05 +02:00
Daniel Hahler
b117754a8b gen_eval.lua: use correct name in usage 2019-07-30 10:37:41 +02:00
Daniel Hahler
08ed3d6523 tests: use Vim's version for patch 8.1.0005
Not sure what happened in daca22f5b / #8821, but Vim used assert_match /
no expand in vim/vim@d19b23415 (8.1.0005) already.
2019-07-30 10:35:44 +02:00
Ihor Antonov
11ed7377f9 clang/"null pointer dereference": ex_cmds.c 2019-07-29 22:56:59 -04:00
Daniel Hahler
d7b04ae7a7 py: flake8 fixes 2019-07-29 22:14:23 +02:00
Justin M. Keyes
bae02eb396
Merge #10645 from janlazo/vim-8.1.0999
vim-patch:8.1.{1005,1041,1049,1052,1053,1086,1394}
2019-07-29 20:59:38 +02:00
Justin M. Keyes
6e03f87e09
Merge #10615 'vim-patch:8.1.0053'
fix #10604
2019-07-29 20:43:44 +02:00
Ihor Antonov
454902d663 PVS/V507: suppress false positive #10647
The pointer does not outlive the value in local scope as it gets
reassigned immediately after scope.
2019-07-29 19:57:16 +02:00
cangscop
ea14d8d493 vim-patch:8.1.0053 use typval_T in the caller of call_vim_function
Problem:	unreliable types for complete function arguments
Solution:	fix argument type for functions w/ unreliable type conversion(Ozaki Kiichi)
vim/vim#2993
2019-07-29 19:56:02 +02:00
Gavin D. Howard
696334181f build/macOS: enable fallthrough attribute #10653 2019-07-29 19:51:49 +02:00
Jan Edmund Lazo
d6b31721bf vim-patch:8.1.1086: too many curly braces
Problem:    Too many curly braces.
Solution:   Remove curly braces where they are not needed. (Hirohito Higashi,
            closes vim/vim#3982)
abab0b0fdd

Neovim code style requires the opposite.
Add curly braces to minimize lint errors when applying Vim patches.
2019-07-28 23:44:36 -04:00
Jan Edmund Lazo
b388f46266 buffer: add attributes to pure functions 2019-07-28 22:19:11 -04:00
Jan Edmund Lazo
01e3690ca8 vim-patch:8.1.1049: when user tries to exit with CTRL-C message is confusing
Problem:    When user tries to exit with CTRL-C message is confusing.
Solution:   Only mention ":qa!" when there is a changed buffer. (closes vim/vim#4163)
a84a3dd663

vim-patch:8.1.1052: test for CTRL-C message sometimes fails

Problem:    test for CTRL-C message sometimes fails
Solution:   Make sure there are no changed buffers.
553e5a5c56

vim-patch:8.1.1053: warning for missing return statement

Problem:    Warning for missing return statement. (Dominique Pelle)
Solution:   Add return statement.
d6c3f1fa2b
2019-07-28 22:19:11 -04:00
Jan Edmund Lazo
4c50f0dc76 vim-patch:8.1.1041: test for Arabic no longer needed
Problem:    Test for Arabic no longer needed.
Solution:   Remove the test for something that was intentionally left out.
295e3ba31f
2019-07-28 22:05:51 -04:00
Jan Edmund Lazo
00e882e6f6 vim-patch:8.1.1394: not restoring t_F2 in registers test
Problem:    Not restoring t_F2 in registers test.
Solution:   Assign to &t_F2 instead of t_F2. (Andy Massimino, closes vim/vim#4434)
a5e44600eb
2019-07-28 22:05:51 -04:00
Jan Edmund Lazo
c53e78e125 vim-patch:8.1.1005: test fails because t_F2 is not set
Problem:    Test fails because t_F2 is not set.
Solution:   Add try-catch.
55d81cd2a1
2019-07-28 22:05:51 -04:00
Ihor Antonov
1c74c7c446 lint: makemap
* if braces
* spaces
* post increments
* comment style
2019-07-28 21:10:49 -04:00
Ihor Antonov
ed5f891e83 pvs/V560: part of conditional expression is always false
makemap: same condition is used to skip outer loop cycle
2019-07-28 20:48:44 -04:00
Justin M. Keyes
caa8c06bae
vim-patch:8.1.1138: add CompleteChanged #10644
(This was originally a Neovim patch, but this commit merges some changes
from the Vim patch.)

d7f246c68c
2019-07-29 02:36:46 +02:00
erw7
505f47403b vim-patch:8.1.0017: shell command completion has duplicates #10616
Problem:    Shell command completion has duplicates. (Yegappan Lakshmanan)
Solution:   Use a hash table to avoid duplicates. (Ozaki Kiichi, closes vim/vim#539, closes vim/vim#2733)
62fe66f251
2019-07-29 01:25:54 +02:00
Bartosz Miera
16727dcf1e clang/"dead assignments" #10620
Also revert possibly-wrong change in f_sign_getplaced() from
652be3cb00.
2019-07-29 00:52:24 +02:00
Jit
7cc2b723d4 TextYankPost: spurious/too-early dispatch during delete #10392
Problem: delete-with-register dispatches TextYankPost before updating yank registers
Solution: Add flag to op_yank().

Fixes #10225
2019-07-29 00:50:11 +02:00