Commit Graph

9160 Commits

Author SHA1 Message Date
Justin M. Keyes
4213492231
Merge #10643 from janlazo/vim-8.1.1765
vim-patch:8.1.{990,992,1765}
2019-07-29 00:34:47 +02:00
Ihor Antonov
00d915d021 PVS/V547: expression is always true/false #10640
Functions marked with FUNC_ATTR_NONNULL_RET do not return NULL.
Remove redundant checks.
2019-07-29 00:11:54 +02:00
Jan Edmund Lazo
b457a58e34 vim-patch:8.1.0990: floating point exception with "%= 0" and "/= 0"
Problem:    Floating point exception with "%= 0" and "/= 0".
Solution:   Avoid dividing by zero. (Dominique Pelle, closes vim/vim#4058)
e21c1580b7
2019-07-28 17:19:20 -04:00
Ihor Antonov
f5b5f60b86 PVS/V512: memcpy overflow/underflow #10642
problem:  bfredl: pvs thinks the type of the pointed
          at item is too small.
solution: refactored address calculation.
2019-07-28 23:05:18 +02:00
Jan Edmund Lazo
98d389ce55 vim-patch:8.1.1765: get(func, dict, def) does not work properly
Problem:    get(func, dict, def) does not work properly.
Solution:   Handle NULL dict better. (Takuya Fujiwara, closes vim/vim#4734)
f91aac5e3e
2019-07-28 16:11:54 -04:00
Ihor Antonov
fe2ada7375 PVS/V560: condition is always false #10638
* shorten_buf_name: condition inside outer if-branch with inverse condition
2019-07-28 21:28:53 +02:00
Ihor Antonov
3b82c075b3 vim-patch:8.0.1753: fix various warnings #10639
vim-patch:8.0.1753: various warnings from a static analyser
Problem:    Various warnings from a static analyser
Solution:   Remove unneeded conditions.
1c17ffa461
2019-07-28 21:26:17 +02:00
Justin M. Keyes
6953e151bb
context: shada_encode_regs(): init WriteMergerState #10637
- Check shada_pack_xx() result, abort on failure.
- Use xcalloc() to zero-initialize `wms`, fixes below ASAN failure.

ASAN failure (running vim_spec.lua in a loop):

    ../src/nvim/shada.c:1773:13: runtime error: load of value 224, which is not a valid value for type 'bool'
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/nvim/shada.c:1773:13

Adding an explicit check just before the ASAN failed line:

    case kSDItemRegister: {
      if (*((int *)(void *)&entry.data.reg.is_unnamed) != 1
          && *((int *)(void *)&entry.data.reg.is_unnamed) != 0) {
        abort();

    (gdb) p entry.data.reg
    +p entry.data.reg
    $5 = {name = 49 '1', type = kMTLineWise, contents = 0x60200000c250, is_unnamed = true, contents_size = 1, width = 0, additional_data = 0x0}
    (gdb) p *((uint8_t *)(void *)&entry.data.reg.is_unnamed)
    +p *((uint8_t *)(void *)&entry.data.reg.is_unnamed)
    $7 = 2049
2019-07-28 19:39:03 +02:00
Ihor Antonov
cfa2759df6 PVS/V560: expression is always false/true #10623 2019-07-28 17:58:24 +02:00
Daniel Hahler
05fa1cb3f4
src/clint.py: flake8 fixes [ci skip] (#10631) 2019-07-28 11:48:24 +02:00
Justin M. Keyes
b5c44b66eb
Merge #10628 from notomo/vim-8.1.1759 2019-07-28 11:15:30 +02:00
Ihor Antonov
e0f2c36667 PVS/V560: condition is always true #10630
earlier condition leads to short-circuit of the loop
2019-07-28 11:08:41 +02:00
Ihor Antonov
ce59a70f5b PVS/V560: condition is always true #10624
* before changed line status variable is set to RA_FAIL in 2 places
line 3816 and 3826, both lead to short-circuit of the loop, making
comparing it to RA_FAIL useless

close #10624
2019-07-28 10:59:44 +02:00
Ihor Antonov
5b47ee5b7a pvs/V560: part of conditional expression is always true (#10629)
Since timed_out is pointer to int  condition timed_out != NULL && timed_out makes no sense as both are effectively the same thing. Most likely the first check was meant to guard the dereference of the second.
Wrong import of Vim patch (8.0.0643).
2019-07-28 05:16:14 +02:00
notomo
32a6b5601b Fix clint error 2019-07-28 09:22:46 +09:00
notomo
08c7e206cc vim-patch:8.1.1759: no mode char for terminal mapping from maparg()
Problem:    No mode char for terminal mapping from maparg().
Solution:   Check for TERMINAL mode. (closes vim/vim#4735)
14371ed697
2019-07-28 08:00:52 +09:00
cangscop
dedcd3ad1e 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-28 00:19:41 +02:00
Daniel Hahler
7f5a113f65
vim-patch:8.1.1748: :args output is not aligned (#10625)
Problem:    :args output is not aligned.
Solution:   Output a line break after the last item in a row.
74da39373c

vim-patch:8.1.1750: depending on the terminal width :version may miss a line break

Problem:    Depending on the terminal width :version may miss a line break.
Solution:   Add a line break when needed.
8a5c29aee9

vim-patch:8.1.1760: extra line break for wrapping output of :args

Problem:    Extra line break for wrapping output of :args.
Solution:   Avoid the extra line break. (Daniel Hahler, closes vim/vim#4737)
9800bfe0fc
2019-07-27 23:48:32 +02:00
Justin M. Keyes
8e6b0a73c9
Merge #10619 'API: context' 2019-07-27 22:56:05 +02:00
Abdelhakeem
b6278bbf12 API: Context: save/restore 2019-07-27 22:14:58 +02:00
Jan Edmund Lazo
0e23ee3cc7 vim-patch:8.1.0956: context:0 in 'diffopt' #10622
Problem:    Using context:0 in 'diffopt' does not work well.
Solution:   Make zero context do the same as one line context. (closes vim/vim#4005)
b9ddda6c2d
2019-07-27 20:33:33 +02:00
Abdelhakeem
691deca2e8 eval: context: add ctx-family functions 2019-07-27 16:36:56 +02:00
Justin M. Keyes
411a06c8b6 API: Context 2019-07-27 16:36:57 +02:00
cangscop
0364e47ccb vim-patch:8.1.53 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-27 16:25:33 +02:00
Daniel Hahler
709e87792f
tests: test_arglist.vim: align with Vim [ci skip] (#10612)
This just moves the test to where it is in Vim.
2019-07-27 01:47:12 +02:00
Justin M. Keyes
af01b347d8
Merge #10606 'vim-patch:8.1.0404' 2019-07-27 01:33:58 +02:00
Jan Edmund Lazo
2b731a388a vim-patch:8.1.1747: unused variables #10605
Problem:    Compiler warning for unused variables. (Tony Mechelynck)
Solution:   Add #ifdef.
fbfb757d4c
2019-07-26 11:21:44 +02:00
Jan Edmund Lazo
0fb05b2c7d Revert "vim-patch:8.1.0430: Xargadd file left behind after running test"
This reverts commit ce1b4f95fe.
2019-07-26 05:19:05 -04:00
Jan Edmund Lazo
cbda383efe vim-patch:8.1.0404: accessing invalid memory with long argument name
Problem:    Accessing invalid memory with long argument name.
Solution:   Use item_count instead of checking for a terminating NULL.
            (Dominique Pelle, closes vim/vim#3444)
e961cba3cb
2019-07-26 05:19:05 -04:00
Justin M. Keyes
2731080212 cleanup: remove mch_fopen in favor of os_fopen 2019-07-25 22:32:23 +02:00
Justin M. Keyes
bb3a0099c6 os/fs: introduce os_fopen()
Windows: Using fopen() directly may need UTF-16 filepath conversion. To
achieve that, os_fopen() goes through os_open().

fix #10586
2019-07-25 22:32:23 +02:00
Ihor Antonov
8a9c9a9963 PVS/V768: do use enum as bool #10582
Fix win_draw_end invocation, pass HLF symbol explicitly.
2019-07-25 21:57:58 +02:00
Jan Edmund Lazo
0925afcfcf regexp: add function attributes 2019-07-25 03:34:26 -04:00
Jan Edmund Lazo
98fcf66b7a vim-patch:8.1.0913: CI crashes when running out of memory
Problem:    CI crashes when running out of memory.
Solution:   Apply 'maxmempattern' also to new regexp engine.
688b3983d8
2019-07-25 03:02:22 -04:00
Jan Edmund Lazo
52488ea6fb vim-patch:8.1.0910: crash with tricky search pattern
Problem:    Crash with tricky search pattern. (Kuang-che Wu)
Solution:   Check for runnning out of memory. (closes vim/vim#3950)
15bbd6ec87
2019-07-25 02:39:24 -04:00
Jan Edmund Lazo
fb059a1741 vim-patch:8.1.0907: CI tests on AppVeyor are failing
Problem:    CI tests on AppVeyor are failing.
Solution:   Reduce the recursiveness limit for regexp.
5382f12c91
2019-07-25 02:21:32 -04:00
Jan Edmund Lazo
a77e5b3606 vim-patch:8.1.0905: complicated regexp causes a crash
Problem:    Complicated regexp causes a crash. (Kuang-che Wu)
Solution:   Limit the recursiveness of addstate(). (closes vim/vim#3941)
5567ad48b6
2019-07-25 02:04:32 -04:00
Jan Edmund Lazo
8e490b98cc regexp: use fixed types to avoid overflow 2019-07-24 21:50:16 -04:00
Gabriel
33ce6a7f62 Checks for overflow when parsing string to int 2019-07-24 21:43:04 -04:00
Jan Edmund Lazo
43f4e5d5be vim-patch:8.1.0908: can't handle large value for %{nr}v in regexp
Problem:    Can't handle large value for %{nr}v in regexp. (Kuang-che Wu)
Solution:   Give an error if the value is too large. (closes vim/vim#3948)
9403a2168d
2019-07-24 21:43:04 -04:00
Jan Edmund Lazo
9ea449085d vim-patch:8.1.1746: ":dl" is seen as ":dlist" instead of ":delete"
Problem:    ":dl" is seen as ":dlist" instead of ":delete".
Solution:   Do not use cmdidxs2[] if the length is 1. (closes vim/vim#4721)
94f82cbacf
2019-07-24 21:43:04 -04:00
Jan Edmund Lazo
80487b59c9 vim-patch:8.1.0903: struct uses more bytes than needed
Problem:    Struct uses more bytes than needed.
Solution:   Reorder members of regitem_S. (Dominique Pelle, closes vim/vim#3936)
beb7574d6b
2019-07-24 19:46:09 -04:00
Jan Edmund Lazo
2385039623 vim-patch:8.1.0899: no need to check restricted mode for setwinvar()
Problem:    No need to check restricted mode for setwinvar().
Solution:   Remove check_restricted().
e0fb7d1e38
2019-07-24 19:46:09 -04:00
Daniel Hahler
b8fcf62da9
vim-patch:8.1.1740: exepath() doesn't work for "bin/cat" (#10556)
Problem:    Exepath() doesn't work for "bin/cat".
Solution:   Check for any path separator. (Daniel Hahler, closes vim/vim#4724,
            closes vim/vim#4710)
d08b8c4c04

Fixes https://github.com/neovim/neovim/issues/10554.
2019-07-24 22:23:00 +02:00
Daniel Hahler
3566267e75
vim-patch:8.1.1738: testing lambda with timer is slow (#10590)
Problem:    Testing lambda with timer is slow.
Solution:   Do not test timer accuracy, only that it works. (Daniel Hahler,
            closes vim/vim#4723)
9bc4dde45d
2019-07-24 19:47:41 +02:00
Jan Edmund Lazo
06547cdfc0 sign: REMOVE FEAT_SIGN_ICONS, dead code #10595 2019-07-24 12:17:53 +02:00
Daniel Hahler
733e1a0e73 vim-patch:8.1.1737: :args command that outputs one line gives more prompt
Problem:    :args command that outputs one line gives more prompt.
Solution:   Only output line break if needed. (Daniel Hahler, closes vim/vim#4715)
949f1989cb

Closes https://github.com/neovim/neovim/pull/10147.
2019-07-24 06:14:12 +02:00
Daniel Hahler
e134cc9d4a vim-patch:8.0.1738: ":args" output is hard to read
Problem:    ":args" output is hard to read.
Solution:   Make columns with the names if the output is more than one line.
5d69da462f

vim-patch:8.0.1740: warning for signed-unsigned incompatibility

Problem:    Warning for signed-unsigned incompatibility.
Solution:   Change type from "char *" to "char_u *". (John Marriott)
405dadb63e

Removes ported legacy test that was re-added later.
Ref: https://github.com/neovim/neovim/pull/10147#issuecomment-512609513
2019-07-24 06:09:28 +02:00
erw7
465a0a3c09 env: invalid pointer after os_setenv() #10558 2019-07-23 11:45:38 +02:00
erw7
f6e779d939 win/TUI: workaround libuv LF => CRLF conversion #10558
Replace cud1 with \x1b[B because \n is CRLF on Windows (due to libuv).

fix #9461
2019-07-23 11:45:38 +02:00
Jan Edmund Lazo
0d5f629208 Revert "vim-patch:8.0.1723: using one item array size declaration is misleading" (#10583)
This reverts commit 315076a26d.
2019-07-23 05:37:20 +02:00
Ihor Antonov
324dc0dbc0 PVS/V1019: "readability" warning #10566 2019-07-22 19:45:59 +02:00
ddcien
184b87ee31 build: fix gcc warnings #10568
gcc version 8.3.0 (Debian 8.3.0-6)

    ../src/nvim/ex_docmd.c: In function ‘commands_array’:
    ../src/nvim/ex_docmd.c:10192:36: warning: ‘%ld’ directive output may be truncated writing between 1 and 19 bytes into a region of size 10 [-Wformat-truncation=]
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
                                        ^~~
    ../src/nvim/ex_docmd.c:10192:37: note: format string is defined here
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
    ../src/nvim/ex_docmd.c:10192:36: note: directive argument in the range [0, 9223372036854775807]
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
                                        ^~~
    ../src/nvim/ex_docmd.c:10192:9: note: ‘snprintf’ output between 2 and 20 bytes into a destination of size 10
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../src/nvim/ex_docmd.c:10205:36: warning: ‘%ld’ directive output may be truncated writing between 1 and 19 bytes into a region of size 10 [-Wformat-truncation=]
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
                                        ^~~
    ../src/nvim/ex_docmd.c:10205:37: note: format string is defined here
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
    ../src/nvim/ex_docmd.c:10205:36: note: directive argument in the range [0, 9223372036854775807]
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
                                        ^~~
    ../src/nvim/ex_docmd.c:10205:9: note: ‘snprintf’ output between 2 and 20 bytes into a destination of size 10
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../src/nvim/spell.c: In function ‘did_set_spelllang’:
    ../src/nvim/spell.c:1631:61: warning: ‘%s’ directive output may be truncated writing up to 254 bytes into a region of size 84 [-Wformat-truncation=]
                    "autocmd VimEnter * call spellfile#LoadFile('%s')|set spell",
                                                                 ^~
    ../src/nvim/spell.c:2063:25:
             spell_load_lang(lang);
                             ~~~~                                 
    ../src/nvim/spell.c:1630:7: note: ‘snprintf’ output between 57 and 311 bytes into a destination of size 128
           snprintf(autocmd_buf, sizeof(autocmd_buf),
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                    "autocmd VimEnter * call spellfile#LoadFile('%s')|set spell",
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                    lang);
                    ~~~~~
    ../src/nvim/window.c: In function ‘win_rotate’:
    ../src/nvim/window.c:1780:22: warning: ‘wp2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       wp2->w_pos_changed = true;
                          ^
    ../src/nvim/window.c:1779:22: warning: ‘wp1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       wp1->w_pos_changed = true;
2019-07-22 12:38:14 +02:00
Jan Edmund Lazo
39549159fe vim-patch:8.1.0706: introduce :redrawtabline #10570
Problem:    Tabline is not always redrawn when something that is used in
            'tabline' changes.
Solution:   Add ":redrawtabline" so that a plugin can at least cause the
            redraw when needed.
e12bab3144
2019-07-22 12:25:07 +02:00
Jan Edmund Lazo
8d66b6091b vim-patch:8.1.1724: too much overhead checking for CTRL-C #10564
Problem:    Too much overhead checking for CTRL-C while processing text.
Solution:   Increase BREAKCHECK_SKIP.  Remove the difference for when built
            with the GUI. (suggested by Andy Massimino, closes vim/vim#4708)
b4fe0eb4b4
2019-07-21 23:30:56 +02:00
Justin M. Keyes
1fde79eedf os_can_exe: remove char_u 2019-07-21 20:51:37 +02:00
Justin M. Keyes
b08dc3ec19 win: jobstart(), system(): $PATHEXT-resolve exe
Windows: In order for jobstart(['foo']), system(['foo']) to find
"foo.cmd", we must replace "foo" with "foo.cmd" before sending `argv` to
process_spawn().

Rationale: jobstart([…]), system([…]) "executable" semantics should be
consistent with the VimL executable() function.

fix #9569
related: #10554
2019-07-21 20:51:37 +02:00
Jan Edmund Lazo
a63b95b315 move: assert nonnull wp pointer 2019-07-20 19:51:32 -04:00
Jan Edmund Lazo
54d9ea61ab vim-patch:8.1.0856: when scrolling a window the cursorline is not always updated
Problem:    When scrolling a window other than the current one the cursorline
            highlighting is not always updated. (Jason Franklin)
Solution:   Call redraw_for_cursorline() after scrolling.  Only set
            w_last_cursorline when drawing the cursor line.  Reset the lines
            to be redrawn also when redrawing the whole window.
bbb5f8d4c2
2019-07-20 19:34:06 -04:00
Jan Edmund Lazo
526dbcafd1 vim-patch:8.1.1720: crash with very long %[] pattern
Problem:    Crash with very long %[] pattern. (Reza Mirzazade farkhani)
Solution:   Check for reg_toolong. (closes vim/vim#4703)
2a5b52758b
2019-07-20 17:28:45 -04:00
Jan Edmund Lazo
d20bbc8022 vim-patch:8.1.0789: session sets v:errmsg #10553
Problem:    Sourcing a session sets v:errmsg.
Solution:   Use "%argdel" instead of "argdel *". (Jason Franklin)
555de4e3b2
2019-07-20 19:06:17 +02:00
Jan Edmund Lazo
7935f6ce35 vim-patch:8.1.0754: preferred column when setting 'cursorcolumn' #10549
Problem:    Preferred column is lost when setting 'cursorcolumn'.
Solution:   Change option flag to P_RWINONLY. (Takayuki Kurosawa,
            closes vim/vim#3806)
177ab9e026
2019-07-20 14:12:56 +02:00
Jan Edmund Lazo
7f66fdb54d [RFC]vim-patch:8.1.{749,1715} #10545
* vim-patch:8.1.1715: emoji characters are seen as word characters for spelling

Problem:    Emoji characters are seen as word characters for spelling. (Gautam
            Iyer)
Solution:   Exclude class 3 from word characters.
06e6377009

* vim-patch:8.1.0749: error message contains garbage

Problem:    Error message contains garbage. (Dominique Pelle)
Solution:   Use correct pointer to failed expression.
6acc79f5d4
2019-07-20 10:48:45 +02:00
Justin M. Keyes
f55c1e4233
reltimefloat(): allow negative result #10544
For "backwards" duration, reltimefloat() should return negative value
like its counterpart reltimestr().

ref bab24a88ab
ref 06af88cd72
ref #10521
fix #10452
2019-07-20 10:46:09 +02:00
Justin M. Keyes
afef973262
doc [ci skip] #10383
- test/README.md: document luassert `TableFormatLevel`
- CONTRIBUTING.md: absorb parts of the old "Development tips" wiki page
2019-07-19 21:32:04 +02:00
Björn Linse
d5f7099be2
Merge pull request #10541 from bfredl/conversion_getln
refactor: enable -Wconversion for ex_getln.c and use int for Rows/Columns
2019-07-19 20:15:03 +02:00
Ihor Antonov
7e4fd045f9 PVS/V1026: possible overflow in a loop #10529
* pvs/V1026: possible overflow in a loop
* refactor: char_u -> uint8_t
* lint
* remove unused if branch: enc_utf8 is always true
2019-07-19 19:41:57 +02:00
Ihor Antonov
f42bb50392 lint 2019-07-19 12:31:34 -04:00
Ihor Antonov
f1127a33f1 pvs/V560: A part of conditional expression is always true
wp->w_p_list is checked earlier in the same composite if condition
2019-07-19 11:06:40 -04:00
Ihor Antonov
91bbd07417 pvs/V560: A part of conditional expression is always true
c == '\000' is always true because of the if branch it is already in
2019-07-19 10:58:31 -04:00
Björn Linse
aa28e070e9 refactor: use int for Columns and Rows 2019-07-19 15:57:19 +02:00
Björn Linse
75928101f8 refactor: enable -Wconversion for ex_getln.c 2019-07-19 15:56:38 +02:00
Justin M. Keyes
a46fe2e615
option_defs.h: fix incorrect definition #10542 2019-07-19 15:17:31 +02:00
Jan Edmund Lazo
d4e93fedf1 vim-patch:8.1.0740: Tcl test fails (#10540)
Problem:    Tcl test fails.
Solution:   When the argument is empty don't give an error, instead rely on
            the error reporting higher up.
8309b0559d
2019-07-19 11:46:22 +02:00
Justin M. Keyes
281d422e71
Merge #10368 from janlazo/vim-8.0.1164
vim-patch:8.0.{755,1146,1164}
2019-07-19 00:39:50 +02:00
Justin M. Keyes
572ecdfeed
Merge #10052 from janlazo/vim-8.1.0729
vim-patch:8.1.{729,732}
2019-07-19 00:36:56 +02:00
Ihor Antonov
ba7ec994ae pvs/V1037: two case branches doing the same thing (#10527) 2019-07-18 03:12:45 +02:00
Ihor Antonov
9412dcb6ae PVS/V1037: suppress warning #10526
* Case branches are semantically different.
* Lint
2019-07-18 03:10:45 +02:00
Jan Edmund Lazo
fdfdc0a228 vim-patch:8.1.0732: cannot build without the eval feature
Problem:    Cannot build without the eval feature.
Solution:   Make a copy of the sourced file name.
ea56e167c8
2019-07-17 20:27:08 -04:00
Jan Edmund Lazo
aa681df25f vim-patch:8.1.0729: there is a SourcePre autocommand event but not a SourcePost
Problem:    There is a SourcePre autocommand event but not a SourcePost.
Solution:   Add the SourcePost autocommand event. (closes vim/vim#3739)
2b6185287a
2019-07-17 20:23:05 -04:00
Ihor Antonov
8499e18615 PVS/V1037: suppress warning #10528
Despite the PVS warning, we do not want to conflate these
cases, they are semantically different.
2019-07-18 01:20:59 +02:00
Ihor Antonov
452ec4ed31 PVS/V1037: redundant switch-case branches #10519
Suppress the warning, the branches are semantically different.
2019-07-18 00:20:06 +02:00
Justin M. Keyes
58dd5fcc01
jobstop(): close channel before process_stop() #10522
fix #9799
regression of #7081
Helped-by: Björn Linse <bjorn.linse@gmail.com>

Problem: :UpdateRemotePlugins (which calls rpcstop()) sometimes crashes:

    remote/host: python3 host registered plugins []
    nvim: ../src/nvim/event/wstream.c:78:
      _Bool wstream_write(Stream *, WBuffer *): Assertion `!stream->closed' failed.
    Aborted (core dumped)

  Order of events (channel 163, see logs below):

    1. Channel's in-stream (0x2ba86c0) is **closed** by `f_rpcstop`..`process_stop`.
    2. `receive_msgpack` parses the channel out-stream (0x2ba8860)
    3. Invokes "nvim_command_output" API method.
    4. Writes result to the **closed** in-stream  => **abort**

  - af993da435 (`receive_msgpack`) tried to hack around same/similar issue.
  - Hack was removed in 5215e3205a.

Solution: in jobstop(), close the channel before process_stop().

Log:

    DEBUG 2019-07-16T20:54:12.191 25159 stream_close:96: closing Stream: 0x2b01a90
    DEBUG 2019-07-16T20:54:12.210 25159 process_spawn:124: new: pid=28407 argv=[/usr/bin/python3]
    DEBUG 2019-07-16T20:54:12.210 25159 rpc_start:72: rpc ch 163 in-stream=0x2ba86c0 out-stream=0x2ba8860
    INFO  2019-07-16T20:54:12.210 25159 channel_create_event:199: new channel 163 (function <SNR>61_on_exit[4]..<SNR>60_job_exit_cb[101]..<SNR>60_decrement_job_count[8]..remote#host#UpdateRemotePlugins[6]..<SNR>31_RegistrationCommands[15]..remote#host#Require[10]..provider#pythonx#Require[13]..provider#Poll:3) : {"id": 163, "client": {}, "mode": "rpc", "stream": "job"}
    DEBUG 2019-07-16T20:54:12.211 25159 log_server_msg:729: RPC ->ch 163: [request]  [0, 1, "poll", []]
    DEBUG 2019-07-16T20:54:12.355 25159 receive_msgpack:227: ch 163: parsing 21 bytes from msgpack Stream: 0x2ba8860
    DEBUG 2019-07-16T20:54:12.355 25159 log_client_msg:766: RPC <-ch 163: [request]  [0, 1, "vim_get_api_info", []]
    DEBUG 2019-07-16T20:54:12.355 25159 RPC: <-ch 163: invoke nvim_get_api_info
    DEBUG 2019-07-16T20:54:12.357 25159 log_server_msg:729: RPC ->ch 163: [response] [1, 1, nil, [163, {"version"=>{"major"=>0, "minor"=>4, }, ...
    DEBUG 2019-07-16T20:54:12.377 25159 receive_msgpack:227: ch 163: parsing 85 bytes from msgpack Stream: 0x2ba8860
    DEBUG 2019-07-16T20:54:12.377 25159 log_client_msg:766: RPC <-ch 163: [request]  [0, 2, "nvim_eval", ["((&number||&relativenumber) ? &numberwidth : 0) + &foldcolumn"]]
    DEBUG 2019-07-16T20:54:12.377 25159 handle_request:359: RPC: scheduled nvim_eval
    DEBUG 2019-07-16T20:54:12.377 25159 log_client_msg:766: RPC <-ch 163: [response] [1, 1, nil, "ok"]
    DEBUG 2019-07-16T20:54:12.378 25159 log_server_msg:729: RPC ->ch 163: [request]  [0, 2, "specs", ["/home/vagrant/.config/nvim/rplugin/python3/__pycache__"]]
    DEBUG 2019-07-16T20:54:12.378 25159 RPC: <-ch 163: invoke nvim_eval
    DEBUG 2019-07-16T20:54:12.379 25159 log_server_msg:729: RPC ->ch 163: [response] [1, 2, nil, 0]
    DEBUG 2019-07-16T20:54:12.379 25159 receive_msgpack:227: ch 163: parsing 5 bytes from msgpack Stream: 0x2ba8860
    DEBUG 2019-07-16T20:54:12.379 25159 log_client_msg:766: RPC <-ch 163: [response] [1, 2, nil, 0]
    DEBUG 2019-07-16T20:54:12.380 25159 log_server_msg:729: RPC ->ch 163: [request]  [0, 3, "specs", ["/home/vagrant/.config/nvim/rplugin/python3/foo.py"]]
    DEBUG 2019-07-16T20:54:12.380 25159 receive_msgpack:227: ch 163: parsing 79 bytes from msgpack Stream: 0x2ba8860
    DEBUG 2019-07-16T20:54:12.380 25159 log_client_msg:766: RPC <-ch 163: [request]  [0, 3, "nvim_command", ["redir =>a |exe "sil sign place buffer=".bufnr('')|redir end"]]
    DEBUG 2019-07-16T20:54:12.381 25159 handle_request:359: RPC: scheduled nvim_command
    DEBUG 2019-07-16T20:54:12.381 25159 RPC: <-ch 163: invoke nvim_command
    DEBUG 2019-07-16T20:54:12.381 25159 log_server_msg:729: RPC ->ch 163: [response] [1, 3, nil, nil]
    DEBUG 2019-07-16T20:54:12.381 25159 receive_msgpack:227: ch 163: parsing 5 bytes from msgpack Stream: 0x2ba8860
    DEBUG 2019-07-16T20:54:12.381 25159 log_client_msg:766: RPC <-ch 163: [response] [1, 3, nil, 0]
    DEBUG 2019-07-16T20:54:12.382 25159 stream_close:95: trace:
      log_callstack at /home/vagrant/neovim/build/../src/nvim/log.c:256
      stream_close at /home/vagrant/neovim/build/../src/nvim/event/stream.c:95
      stream_may_close at /home/vagrant/neovim/build/../src/nvim/event/stream.c:111
      process_stop at /home/vagrant/neovim/build/../src/nvim/event/process.c:230
      f_jobstop at /home/vagrant/neovim/build/../src/nvim/eval.c:12231
      f_rpcstop at /home/vagrant/neovim/build/../src/nvim/eval.c:14533
      call_func at /home/vagrant/neovim/build/../src/nvim/eval.c:6564
      get_func_tv at /home/vagrant/neovim/build/../src/nvim/eval.c:6304
      ex_call at /home/vagrant/neovim/build/../src/nvim/eval.c:2903
      do_one_cmd at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2249
      do_cmdline at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:593
      call_user_func at /home/vagrant/neovim/build/../src/nvim/eval.c:22666
      call_func at /home/vagrant/neovim/build/../src/nvim/eval.c:6550
      get_func_tv at /home/vagrant/neovim/build/../src/nvim/eval.c:6304
      eval7 at /home/vagrant/neovim/build/../src/nvim/eval.c:4407
      eval6 at /home/vagrant/neovim/build/../src/nvim/eval.c:4104
      eval5 at /home/vagrant/neovim/build/../src/nvim/eval.c:3985
      eval4 at /home/vagrant/neovim/build/../src/nvim/eval.c:3688
      eval3 at /home/vagrant/neovim/build/../src/nvim/eval.c:3606
      eval2 at /home/vagrant/neovim/build/../src/nvim/eval.c:3537
      eval1 at /home/vagrant/neovim/build/../src/nvim/eval.c:3464
      eval0 at /home/vagrant/neovim/build/../src/nvim/eval.c:3424
      ex_let_const at /home/vagrant/neovim/build/../src/nvim/eval.c:1604
      ex_let at /home/vagrant/neovim/build/../src/nvim/eval.c:1546
      do_one_cmd at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2249
      do_cmdline at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:593
      call_user_func at /home/vagrant/neovim/build/../src/nvim/eval.c:22666
      call_func at /home/vagrant/neovim/build/../src/nvim/eval.c:6550
      get_func_tv at /home/vagrant/neovim/build/../src/nvim/eval.c:6304
      ex_call at /home/vagrant/neovim/build/../src/nvim/eval.c:2903
      do_one_cmd at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2249
      do_cmdline at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:593
      do_ucmd at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:5803
      do_one_cmd at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2243
      do_cmdline at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:593
      call_user_func at /home/vagrant/neovim/build/../src/nvim/eval.c:22666
      call_func at /home/vagrant/neovim/build/../src/nvim/eval.c:6550
      get_func_tv at /home/vagrant/neovim/build/../src/nvim/eval.c:6304
      ex_call at /home/vagrant/neovim/build/../src/nvim/eval.c:2903
      do_one_cmd at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2249
      do_cmdline at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:593
      call_user_func at /home/vagrant/neovim/build/../src/nvim/eval.c:22666
      call_func at /home/vagrant/neovim/build/../src/nvim/eval.c:6550
      get_func_tv at /home/vagrant/neovim/build/../src/nvim/eval.c:6304
      ex_call at /home/vagrant/neovim/build/../src/nvim/eval.c:2903
      do_one_cmd at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2249
      do_cmdline at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:593
      call_user_func at /home/vagrant/neovim/build/../src/nvim/eval.c:22666
      call_func at /home/vagrant/neovim/build/../src/nvim/eval.c:6550
      callback_call at /home/vagrant/neovim/build/../src/nvim/eval.c:17917
      channel_callback_call at /home/vagrant/neovim/build/../src/nvim/channel.c:675
      on_channel_event at /home/vagrant/neovim/build/../src/nvim/channel.c:581
      multiqueue_process_events at /home/vagrant/neovim/build/../src/nvim/event/multiqueue.c:147
      nv_event at /home/vagrant/neovim/build/../src/nvim/normal.c:7987
      normal_execute at /home/vagrant/neovim/build/../src/nvim/normal.c:1133
      state_enter at /home/vagrant/neovim/build/../src/nvim/state.c:73
      normal_enter at /home/vagrant/neovim/build/../src/nvim/normal.c:462
      main at /home/vagrant/neovim/build/../src/nvim/main.c:570
      ?? ??:0
      _start at ??:?
    DEBUG 2019-07-16T20:54:12.417 25159 stream_close:96: closing Stream: 0x2ba86c0
    INFO  2019-07-16T20:54:12.417 25159 os_proc_tree_kill:96: sending SIGTERM to process group: -28407
    DEBUG 2019-07-16T20:54:12.417 25159 receive_msgpack:227: ch 163: parsing 31 bytes from msgpack Stream: 0x2ba8860
    DEBUG 2019-07-16T20:54:12.417 25159 log_client_msg:766: RPC <-ch 163: [request]  [0, 4, "nvim_command_output", ["echo a"]]
    DEBUG 2019-07-16T20:54:12.417 25159 handle_request:359: RPC: scheduled nvim_command_output
    DEBUG 2019-07-16T20:54:12.424 25159 RPC: <-ch 163: invoke nvim_command_output
    DEBUG 2019-07-16T20:54:12.424 25159 log_server_msg:729: RPC ->ch 163: [response] [1, 4, [0, "Vim(echo):E121: Undefined variable: a"], nil]
    ERROR 2019-07-16T20:54:12.424 25159 wstream_write:78: xxx stream=0x2ba86c0
    DEBUG 2019-07-16T20:54:12.425 25159 wstream_write:79: trace:
      log_callstack at /home/vagrant/neovim/build/../src/nvim/log.c:256
      wstream_write at /home/vagrant/neovim/build/../src/nvim/event/wstream.c:82
      channel_write at /home/vagrant/neovim/build/../src/nvim/msgpack_rpc/channel.c:407
      request_event at /home/vagrant/neovim/build/../src/nvim/msgpack_rpc/channel.c:383
      multiqueue_process_events at /home/vagrant/neovim/build/../src/nvim/event/multiqueue.c:147
      nv_event at /home/vagrant/neovim/build/../src/nvim/normal.c:7987
      normal_execute at /home/vagrant/neovim/build/../src/nvim/normal.c:1133
      state_enter at /home/vagrant/neovim/build/../src/nvim/state.c:73
      normal_enter at /home/vagrant/neovim/build/../src/nvim/normal.c:462
      main at /home/vagrant/neovim/build/../src/nvim/main.c:570
      ?? ??:0
      _start at ??:?
2019-07-17 11:13:57 +02:00
Jan Edmund Lazo
f96dec4a2c vim-patch:8.1.0715: superfluous redraw_win_later() #10523
Problem:    Superfluous call to redraw_win_later().
Solution:   Remove the call.
6f7e555f74
2019-07-17 11:08:44 +02:00
Justin M. Keyes
bab24a88ab
viml/profile: revert proftime_T to unsigned type #10521
- reltimestr(): Produce negative value by comparing the unsigned
  proftime_T value to INT64_MAX.

https://github.com/neovim/neovim/issues/10452#issuecomment-511155132
1. The interfaces of nearly all platforms return uint64_t. INT64_MAX is
   only half of that.
2. Low-level interfaces like this typically define that there is no
   fixed starting point. The only guarantees are that it's (a)
   monotonically increasing at a rate that (b) matches real time.

ref 06af88cd72
fix #10452
2019-07-16 20:10:08 +02:00
Ihor Antonov
f31f2d0b22 PVS/V1028: cast operands, not the result #10505 2019-07-16 20:03:08 +02:00
Justin M. Keyes
1eea2d236f
Merge #10500 from ngortheone/pvs/V1028_misc1 2019-07-16 20:01:50 +02:00
Ihor Antonov
56bc0a8bed PVS/V108: cast operands, not the result #10501 2019-07-16 19:58:30 +02:00
Justin M. Keyes
b53b3f7dac
Merge #10493 from ngortheone/pvs/V1028_getchar_918 2019-07-16 19:56:30 +02:00
Justin M. Keyes
b35ad86024
Merge #10391 from janlazo/vim-8.1.0495
vim-patch:8.1.{495,505,531,533,583,623,630,641,686,715,833,1012,1221,1651}
2019-07-16 19:52:23 +02:00
Ihor Antonov
b9a2b3f014 PVS/V1028: cast operands, not the result #10503 2019-07-16 19:50:01 +02:00
Ihor Antonov
96e87c5a63 lint 2019-07-16 08:32:09 -04:00
Ihor Antonov
6262d82d2f pvs/V1028: cast operands, not the result 2019-07-16 08:28:50 -04:00
Justin M. Keyes
583c35714c Merge #10520 'PVS/V1037: redundant case-branches' 2019-07-16 11:32:35 +02:00
Ihor Antonov
6316247da3 PVS/V1028: cast operands, not the result #10502 2019-07-16 11:23:58 +02:00
Björn Linse
8a3f8589a3
Merge pull request #10504 from bfredl/hl_def
highlight: expose builtin highlight groups using hl_group_set event
2019-07-16 10:17:29 +02:00
Jan Edmund Lazo
bf919454eb vim-patch:8.1.0686: when 'y' is in 'cpoptions' yanking for the clipboard changes redo
Problem:    When 'y' is in 'cpoptions' yanking for the clipboard changes redo.
Solution:   Do not use the 'y' flag when "gui_yank" is TRUE. (Andy Massimino,
            closes vim/vim#3760)
5823f84dd0
2019-07-15 23:07:29 -04:00
Jan Edmund Lazo
5be40b9aad vim-patch:8.1.0641: no check for out-of-memory when converting regexp
Problem:    No check for out-of-memory when converting regexp.
Solution:   Bail out when lalloc() returns NULL. (John Marriott)
c57463c9c6
2019-07-15 23:07:29 -04:00
Jan Edmund Lazo
eace147bb0 vim-patch:8.1.0630: "wincmd p" does not work after using an autocmd window
Problem:   "wincmd p" does not work after using an autocmd window.
Solution:   Store "prevwin" in aco_save_T. (Christian Brabandt, closes vim/vim#3690)
a42df5934b
2019-07-15 23:07:29 -04:00
Jan Edmund Lazo
e95945a157 vim-patch:8.1.0623: iterating through window frames is repeated
Problem:    Iterating through window frames is repeated.
Solution:   Define FOR_ALL_FRAMES. (Yegappan Lakshmanan)
3d1491ed23
2019-07-15 23:07:29 -04:00
Jan Edmund Lazo
1c2cfdba88 vim-patch:8.1.0583: using illogical name for get_dict_number()/get_dict_string()
Problem:    Using illogical name for get_dict_number()/get_dict_string().
Solution:   Rename to start with dict_.
8f66717a1f
2019-07-15 23:07:29 -04:00
Jan Edmund Lazo
066ef812c2 vim-patch:8.1.1651: suspend test is flaky on some systems
Problem:    Suspend test is flaky on some systems.
Solution:   Wait for the shell prompt to show. (Yee Cheng Chin, closes vim/vim#4632)
9992244226
2019-07-15 23:07:29 -04:00
Jan Edmund Lazo
71018924fc vim-patch:8.1.0533: screendump tests can be flaky
Problem:    Screendump tests can be flaky.
Solution:   Add VerifyScreenDump to the pattern of flaky tests.
447f6ce8bd
2019-07-15 23:07:29 -04:00
Jan Edmund Lazo
5b8d378923 vim-patch:8.1.0531: flaky tests often fail with a common error message
Problem:    Flaky tests often fail with a common error message.
Solution:   Add a pattern to match an error message indicating a flaky test.
dbc0d2163a
2019-07-15 23:07:29 -04:00
Jan Edmund Lazo
9108256ad4 vim-patch:8.1.1012: memory leak with E461
Problem:    Memory leak with E461.
Solution:   Clear the typeval. (Dominique Pelle, closes vim/vim#4111)
ab89d7ab89
2019-07-15 23:07:29 -04:00
Jan Edmund Lazo
df6354c223 vim-patch:8.1.0833: memory leak when jumps output is filtered
Problem:    Memory leak when jumps output is filtered.
Solution:   Free the filtered name. (Dominique Pelle, closes vim/vim#3869)
d93090f41f
2019-07-15 23:07:29 -04:00
Jan Edmund Lazo
d27175aa28 vim-patch:8.1.1221: filtering does not work when listing marks
Problem:    Filtering does not work when listing marks.
Solution:   Implement filtering marks. (Marcin Szamotulski, closes vim/vim#3895)
ad6dc49a75
2019-07-15 23:07:29 -04:00
Jan Edmund Lazo
5d933310c8 vim-patch:8.1.0505: filter command test may fail if helplang is not set
Problem:    Filter command test may fail if helplang is not set.
Solution:   Set 'helplang' for the test. (James McCoy, closes vim/vim#3591)
bd9a0c611c
2019-07-15 23:07:28 -04:00
Jan Edmund Lazo
263d62f628 vim-patch:8.1.0495: :filter only supports some commands
Problem:    :filter only supports some commands.
Solution:   Add :filter support for more commands. (Marcin Szamotulski,
            closes vim/vim#2856)
f86db78fed
2019-07-15 23:07:28 -04:00
Ihor Antonov
9a5183f22d lint 2019-07-15 21:34:15 -04:00
Ihor Antonov
31d256892e pvs/V1037: two case-branches perform the same action 2019-07-15 21:32:53 -04:00
Justin M. Keyes
990f99658b viml/profile: cast os_hrtime() result
Temporary measure to avoid QuickBuild CI failure:

    8:42:54,702 INFO  - Executing post-execute action...
    18:42:54,702 ERROR - Step 'master>buildall>build-node?testNode=freebsd-64>build-and-run-tests>build-and-run-tests-parameterized?buildType=Release>configure-neovim-and-build-nvim' is failed: Failed to run command: mkdir -p build/Release && cd build/Release && cmake -G "Unix Makefiles" -DBUSTED_OUTPUT_TYPE=TAP -DMIN_LOG_LEVEL=3 -DCMAKE_BUILD_TYPE=Release -DTRAVIS_CI_BUILD=ON ../.. && gmake VERBOSE=1 nvim unittest-prereqs functionaltest-prereqs
    Command return code: 2
    Command error output: /usr/home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/profile.c:70:27: error: implicit conversion changes signedness: 'proftime_T' (aka 'long') to 'unsigned long' [-Werror,-Wsign-conversion]
    STRICT_ADD(os_hrtime(), nsec, &rv, int64_t);
    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
    /usr/home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/assert.h:150:26: note: expanded from macro 'STRICT_ADD'
    do { *(c) = (t)((a) + (b)); } while (0)
    ^
    1 error generated.
    gma...
2019-07-16 02:47:50 +02:00
Ihor Antonov
0156e6b810 PVS/V781: suppress false positive #10516 2019-07-16 02:30:31 +02:00
Ihor Antonov
ec81cfb406 PVS/V1028: cast operands, not the result #10496 2019-07-16 02:27:25 +02:00
Ihor Antonov
8df20ff562 lint 2019-07-15 20:10:35 -04:00
Ihor Antonov
dc0d021d9f pvs/V1028: cast operands, not the result 2019-07-15 19:59:41 -04:00
Daniel Hahler
b06f29318d
Fix missing CursorHoldI events (#3758)
Fixes https://github.com/neovim/neovim/issues/3757.
2019-07-16 01:35:43 +02:00
Ihor Antonov
046deeeaa1 PVS/V1028: cast operands, not the result #10507 2019-07-16 01:01:12 +02:00
Ihor Antonov
de3e2f051e PVS/V1028: cast operands, not the result #10498
The + 1 can be removed. It was used for current_screenline, which
now is dedicated linebuf_char buffer.
2019-07-16 00:55:10 +02:00
erw7
519382646b Fix is_executable_in_path() on Windows (#10468)
* Fix problem that 1byte extra memory was allocated in is_executable_in_path

* Revert "Revert "tests: executable_spec: enable pending test #10443" (#10454)"

This reverts commit 13fbeda0e5.
2019-07-15 17:39:34 +02:00
Ihor Antonov
63ecfc97ef PVS/V590: redundant condition #10510 2019-07-15 10:52:38 +02:00
Ihor Antonov
5a32db9ad4 PVS/V547: expression is always false #10511 2019-07-15 10:47:35 +02:00
erw7
78f36fcf8c PVS/V1028: cast operands, not the result #10508
fix #10508
2019-07-14 22:16:44 +02:00
Ihor Antonov
47d53d66bd PVS/V1028: cast operands, not the result #10508 2019-07-14 21:03:06 +02:00
Ihor Antonov
452112ae38 PVS/V1028 ugrid.c:76 (#10495)
* code review
2019-07-14 15:46:07 +02:00
Björn Linse
857b29bdd8 highlight: expose builtin highlight groups using hl_group_set event 2019-07-14 13:26:40 +02:00
Björn Linse
1e47e3f599
Merge pull request #10497 from bfredl/synlist
messages: fix missing newlines in execute("syn list").
2019-07-14 13:11:56 +02:00
Björn Linse
4c6e62d056 syntax: refactor syn_list_header to not use magic value 2019-07-14 09:31:49 +02:00
Björn Linse
c2b3cc970c syntax: fix missing newlines in execute("syn list"). fixes #10467 2019-07-14 09:31:45 +02:00
Björn Linse
cb9e0a051f floats: fix 'winblend' on top of doublewidth chars.
The interaction between 'winblend' and doublewidth chars in the background
does not look very good. But check no chars get incorrectly placed
at least.

Also check that hidden EndOfBuffer region (from style="minimal") blends
correctly.
2019-07-13 14:27:06 +02:00
Justin M. Keyes
4013f67053
viml/profile: revert gettimeofday() #10488
e2ce5ff9d6 was proven to be bogus, so revert it.

close #10328
ref #10356
ref #10452
2019-07-13 12:37:58 +02:00
Justin M. Keyes
e1fae8f1fe
Merge #10435 from Shougo/vim-8.1.1610 2019-07-13 12:36:32 +02:00
Bartosz Miera
06826139e1 PVS/V547: dead code #10459 2019-07-13 12:30:52 +02:00
Daniel Hahler
108eb4201f vim-patch:8.1.1660: assert_fails() inside try/catch #10472
Problem:    Assert_fails() does not fail inside try/catch.
Solution:   Set trylevel to zero. (Ozaki Kiichi, closes vim/vim#4639)
7780e5c1c5
2019-07-13 00:09:05 +02:00
Daniel Hahler
e682d799fa
build: fix check_c_compiler_flag for -Wno-… (#10483)
`check_c_compiler_flag(-Wno-doesnotexist …)` is successful always,
apparently for all "no-" prefixes.

Therefore check for the flag itself (without "no-" prefix).

I am seeing a warning if the source fails to compile:

> cc1: warning: unrecognized command line option ‘-Wno-meh’

Which is turned into an error with `-Werror`:

> cc1: error: unrecognized command line option ‘-Wno-meh’ [-Werror]

But when it compiles successfully, there is no warning/error.

gcc (GCC) 9.1.0.
2019-07-12 22:42:44 +02:00
Daniel Hahler
ec66d2eecd
oldtest: more compact output with "clean" target (#10477)
Previously it would be displayed across multiple lines (with the escaped
newlines), while this makes it display in a single line.
2019-07-12 15:15:15 +02:00
Daniel Hahler
6eab3b9250
vim-patch:8.1.1173: suspend test has duplicated lines (#10466)
Problem:    Suspend test has duplicated lines.
Solution:   Use a function.
a8356bc173
2019-07-11 12:20:36 +02:00
Björn Linse
7cf7c0a0b8
Merge pull request #9575 from bfredl/redrawdebug
ui: implement better redrawdebug for the compositor
2019-07-09 17:56:30 +02:00
Björn Linse
0da7b67ef9
Merge pull request #10457 from bfredl/dwfloat
compositor: handle float overlapping left half of doublewidth char
2019-07-09 15:42:02 +02:00
Björn Linse
2c2f160a27 ui: add 'redrawdebug' option for flexible debugging of redrawing 2019-07-09 15:13:24 +02:00
Björn Linse
4af1ada9ef compositor: handle float overlapping left half of doublewidth char 2019-07-09 14:46:58 +02:00
Justin M. Keyes
06af88cd72
viml/reltime(): allow negative result #10453
- define proftime_T as signed integer
- profile_sub(): allow negative result

closes #10452
2019-07-09 12:08:54 +02:00
Bartosz Miera
652be3cb00 eval.c: clang/"Dead assignment" #10446 2019-07-09 12:06:14 +02:00
Björn Linse
d11a146516 window: allow resize wincmds for floats 2019-07-08 19:45:57 +02:00
Björn Linse
524fe6205d
Merge pull request #10090 from bfredl/floatpopup
api/window: add style="minimal" flag to disable unwanted UI features for simple floats
2019-07-07 21:35:55 +02:00
Daniel Hahler
28a86608a8 CI: improve gcov handling #10404
- Move __gcov_flush to process_spawn, for more reliable coverage
  tracking of subprocesses
- Travis: use GCOV_ERROR_FILE
- codecov: use "-X fix" to skip "fixing" uploaded coverage data; it
  should be handled by codecov's backend instead.
- AppVeyor: no $PATH mangling, which breaks with the improved coverage tracking
  due to missing .dll in PATH.
2019-07-07 21:09:37 +02:00
Björn Linse
ef3e32d57e api/window: add style="minimal" flag to nvim_open_win() 2019-07-07 20:52:15 +02:00
Jan Edmund Lazo
8c8961d9a2 vim-patch:8.0.1164: changing StatusLine highlight does not always work
Problem:    Changing StatusLine highlight while evaluating 'statusline' may
            not change the status line color.
Solution:   When changing highlighting while redrawing don't cause another
            redraw. (suggested by Ozaki Kiichi, closes vim/vim#2171, closes vim/vim#2120)
65ed136844
2019-07-06 09:34:00 -04:00
Jan Edmund Lazo
6012e4a52c vim-patch:8.0.1146: redraw when highlight is set with same names
Problem:    Redraw when highlight is set with same names. (Ozaki Kiichi)
Solution:   Only free and save a name when it changed. (closes vim/vim#2120)
452030e530
2019-07-06 09:31:39 -04:00
Jan Edmund Lazo
5dc5db1557 vim-patch:8.0.0755: terminal window does not have colors in the GUI
Problem:    Terminal window does not have colors in the GUI.
Solution:   Lookup the GUI color.
26af85d97b
2019-07-06 08:38:21 -04:00
Justin M. Keyes
1b99aa8c53
Merge #10394 from janlazo/vim-8.1.1614
vim-patch:8.1.{1614,1632,1634,1639}
2019-07-06 12:33:51 +02:00
Daniel Hahler
b7ca478e10 func_clear_items: use XFREE_CLEAR #10436
Follow-up to https://github.com/neovim/neovim/pull/10428#discussion_r300813498
2019-07-06 12:22:20 +02:00
Shougo Matsushita
b9474b0641 Fix lint failed 2019-07-06 17:51:02 +09:00
Shougo Matsushita
85164b28cb Fix errors 2019-07-06 17:18:25 +09:00
Shougo Matsushita
5f7e0531c1 vim-patch:8.1.1611: bufadd() reuses existing buffer without a name
Problem:    Bufadd() reuses existing buffer without a name.
Solution:   When the name is empty always create a new buffer.
892ae723ab
2019-07-06 17:11:27 +09:00
Shougo Matsushita
3f6346b732 vim-patch:8.1.1610: there is no way to add or load a buffer without side effects
Problem:    There is no way to add or load a buffer without side effects.
Solution:   Add the bufadd() and bufload() functions.
15e248e37f
2019-07-06 17:09:56 +09:00
Jan Edmund Lazo
6f924880c7 vim-patch:8.1.1639: changing an autoload name into a file name is inefficient
Problem:    Changing an autoload name into a script file name is inefficient.
Solution:   Remember the last replaced #. (Ozaki Kiichi, closes vim/vim#4618)
28fc247f8d
2019-07-05 22:13:27 -04:00
Jan Edmund Lazo
255d189089 vim-patch:8.1.1634: terminal test fails when term_getansicolors() is missing
Problem:    Terminal test fails when term_getansicolors() is missing.
            Diff test fails without +rightleft.  (Dominique Pelle)
Solution:   Check if term_getansicolors() is supported. (closes vim/vim#4597)
981d9dc8f3
2019-07-05 21:26:47 -04:00
Jan Edmund Lazo
18ce2d3039 vim-patch:8.1.1632: build with EXITFREE but without +arabic fails
Problem:    Build with EXITFREE but without +arabic fails.
Solution:   Rename the function and adjust #ifdefs. (closes vim/vim#4613)
48ac671fe5
2019-07-05 21:26:46 -04:00
Jan Edmund Lazo
8062e6ff88 vim-patch:8.1.1614: 'numberwidth' can only go up to 10
Problem:    'numberwidth' can only go up to 10.
Solution:   Allow up to 20. (Charlie Stanton, closes vim/vim#4584)
f8a0712655
2019-07-05 21:26:46 -04:00
Daniel Hahler
3c860e25e9 vim-patch:8.1.0229: crash when dumping profiling data #10428
Problem:    Crash when dumping profiling data.
Solution:   Reset flag indicating that initialization was done.
79c2ad50b8
2019-07-05 22:00:28 +02:00
Björn Linse
48efafc81c
Merge pull request #10398 from bfredl/resizeautocmd
screen: disable redrawing inside VimResized
2019-07-05 20:27:01 +02:00
Björn Linse
51a451570d screen: disable redrawing inside VimResized
Note: test doesn't fail on master. I cannot reproduce the glitches with
-u NONE, probably it requires interfering events. But add some coverage
for these checks at least.
2019-07-05 16:58:53 +02:00
Björn Linse
399eb49baf highlight: show "hi Group" message correctly when not using the screen
ext_message doesn't set msg_col. Add a space and let client deal with
wrapping. When using silent redirect show the unwrapped message form.

Removed check is already part of msg_advance()
2019-07-05 15:52:59 +02:00
Daniel Hahler
5835398152
Merge pull request #10414 from blueyed/luacheck
Improve luacheck integration, fix more issues.
2019-07-04 15:21:44 +02:00
erw7
efc6d9951b win,fs.c: Fix is_executable_ext #10209
Fix issue that increment expression is executable and pointer ext
pointing out of the buffer, if the pointer ext points to the terminating
NUL.

* Change termination condition judgment to one place
* Change first condition judgment
Change to not evaluate *(ext -1) in the first condition judgment.

* Change to use copy_option_part instead of STRLCPY
2019-07-04 14:45:51 +02:00
Daniel Hahler
32361a1245 Improve luacheck setup [skip appveyor]
- Move .luacheckrc to root, add read_globals=vim
- Simplify lualint target, run it on all lua files
- Lint preload.lua, but ignore W211
- Remove testlint target, included in lualint (and lint)
- Clean up .luacheckrc
2019-07-04 12:29:54 +02:00
Sameed Ali
571b2c5e7b Fix luacheck errors for all Lua source files 2019-07-04 06:59:44 +02:00
Björn Linse
2afaf175f1 cmdline: remove local variables i and j from command_line_state 2019-07-02 10:19:39 +02:00
Justin M. Keyes
097f85ae6c
defaults: wildoptions=pum,tagfile #10384
ref #6289
2019-07-01 23:59:24 +02:00
Jan Edmund Lazo
ff95e62ff8 test/old: pass Test_recover_root_dir on Windows (#10207)
* Revert "oldtests: win: keep set dir=/"

This reverts commit 714e0f8bf0.

* test/old: set swap directory to non-existent drive

Appveyor uses Administrator user so it can write anywhere in C:\\.
Neovim creates a directory for the swap file
if the directory does not exist.
D:\\ is the backup/recovery drive so use F:\\ invoke error E303.
2019-07-01 21:51:00 +02:00
Björn Linse
5e4b93a38f
Merge pull request #10389 from bfredl/luafloat
api/lua: make nvim_execute_lua use native lua floats, not special tables
2019-07-01 20:28:00 +02:00
Björn Linse
6ee05536ca api/lua: make nvim_execute_lua use native lua floats, not special tables
Rationale: the purpose of nvim_execute_lua is to simply call lua code with lua
values. If a lua function expects a floating point value, it should be enough
to specify a float as argument to nvim_execute_lua.

However, make sure to preserve the existing roundtripping behavior of
API values when using `vim.api` functions. This is covered by existing
lua/api_spec.lua tests.
2019-07-01 18:44:58 +02:00
Björn Linse
b98d1cf68b cmdline: correct the column position of wildoptions=pum popupmenu
- position might get invalid with "longest" match
- position might be wrong when completed pattern ends in "/"
2019-07-01 18:24:00 +02:00
Björn Linse
10a533e9d4
Merge pull request #10316 from bfredl/cb_safety
luv callbacks: throw error on deferred methods instead of crashing
2019-06-30 16:03:58 +02:00
Justin M. Keyes
3b504e7c8d
fileio.c: eliminate set_file_time() #10357
Introduce os_file_settime(), remove cruft.
2019-06-30 16:00:35 +02:00
Björn Linse
99f24dfbed make vim.loop == require'luv'
This avoids initializing libluv a second time if a plugin invokes
require'luv'. It is probably not an issue, but better to be safe.
2019-06-30 15:16:32 +02:00
Björn Linse
d33aaa0f5f libluv: use luv_set_callback to control callback execution
Disable the use of deferred API functions in a fast lua callback
Correctly display error messages from a fast lua callback
2019-06-30 13:13:08 +02:00
Björn Linse
7030d7daf1 rename: FUNC_API_ASYNC => FUNC_API_FAST 2019-06-30 11:33:01 +02:00
Justin M. Keyes
0480e991d2
:digraphs : check for CTRL-C less often #10376
No need to do this so frequently.
2019-06-30 02:33:50 +02:00
Justin M. Keyes
2ef6f28e11
doc [ci skip] #10177
ref #10278 #10279 #10353
2019-06-30 00:09:45 +02:00
Justin M. Keyes
2d4a37ebab
:ls : show "R", "F" for terminal-jobs #10370
This matches Vim behavior. From `:help :ls` :

    R    a terminal buffer with a running job
    F    a terminal buffer with a finished job
    ?    a terminal buffer without a job: `:terminal NONE`

TODO: implement `:terminal NONE`.

ref #10349
2019-06-29 21:03:38 +02:00
Daniel Hahler
c207095445
build: CMake: do not set CMP0059 to old (#10363)
Keeps using add_definitions for compatibility with older CMake.

Newer CMake (3.12) would have `add_compile_definitions`, but it is not
required, since `add_defitions` was meant to be used for
compile/preprocessor definitions initially anyway.

Ref: https://github.com/neovim/neovim/pull/4389
2019-06-29 20:37:48 +02:00
Justin M. Keyes
e2ce5ff9d6
viml/profile: switch to uv_gettimeofday() #10356
Performance of high-resolution time (clock_gettime via uv_hrtime) is
expensive on some systems.  For profiling VimL, syntax, etc., we don't
care about nanosecond-precision and monotonicity edge-cases, so avoid
uv_hrtime().

closes #10328

From the uv__hrtime() source:
0cdb4a5b4b/src/unix/linux-core.c (L442-L462)

    /* Prefer CLOCK_MONOTONIC_COARSE if available but only when it has
     * millisecond granularity or better.  CLOCK_MONOTONIC_COARSE is
     * serviced entirely from the vDSO, whereas CLOCK_MONOTONIC may
     * decide to make a costly system call.
     */

This micro-benchmark (Debug build) shows negligible differences on my
system:

    #include <sys/time.h>
    ...

    proftime_T tm = profile_start();
    int trials = 999999;
    int64_t t = 0;
    struct timeval tv;
    for (int i = 0; i < trials; i++) {
      t += gettimeofday(&tv,NULL);
    }
    tm = profile_end(tm);
    ILOG("%d trials of gettimeofday: %s", trials, profile_msg(tm));
    tm = profile_start();
    for (int i = 0; i < trials; i++) {
      t += os_hrtime();
    }
    tm = profile_end(tm);
    ILOG("%d trials of os_hrtime: %s", trials, profile_msg(tm));
    tm = profile_start();
    for (int i = 0; i < trials; i++) {
      t += os_utime();
    }
    tm = profile_end(tm);
    ILOG("%d trials of os_utime: %s", trials, profile_msg(tm));
    ILOG("%zu", t);
2019-06-29 16:39:22 +02:00
Jan Edmund Lazo
489d3b084f vim-patch:8.0.1259: search test can be flaky
Problem:    Search test can be flaky.
Solution:   Use WaitFor() instead of a delay.  Make it possible to pass a
            funcref to WaitFor() to avoid the need for global variables.
            (James McCoy, closes vim/vim#2282)
13deab8d08
2019-06-28 23:53:28 -04:00
Jan Edmund Lazo
bddc4dc0ed vim-patch:8.0.1238: incremental search only shows one match
Problem:    Incremental search only shows one match.
Solution:   When 'incsearch' and and 'hlsearch' are both set highlight all
            matches. (haya14busa, closes vim/vim#2198)
2e51d9a097
2019-06-28 23:47:16 -04:00
Jan Edmund Lazo
805d6e450a vim-patch:8.0.1202: :wall gives an errof for a terminal window
Problem:    :wall gives an errof for a terminal window. (Marius Gedminas)
Solution:   Don't try writing a buffer that can't be written. (Yasuhiro
            Matsumoto, closes vim/vim#2190)
059db5c29f
2019-06-28 22:22:59 -04:00
Jan Edmund Lazo
d555e44219 vim-patch:8.0.1120: :tm means :tmap instead of :tmenu
Problem:    :tm means :tmap instead of :tmenu. (Taro Muraoka)
Solution:   Move the new entry below the old entry. (closes vim/vim#2102)
63c4e8a198
2019-06-27 07:59:49 -04:00
Jan Edmund Lazo
2b400daca3 vim-patch:8.0.1100: stuck in redraw loop when 'lazyredraw' is set
Problem:    Stuck in redraw loop when 'lazyredraw' is set.
Solution:   Don't loop on update_screen() when not redrawing. (Yasuhiro
            Matsumoto, closes vim/vim#2082)
072412ed45
2019-06-26 21:49:29 -04:00
Jan Edmund Lazo
58cf81914d vim-patch:8.0.1013: terminal window behaves different from a buffer with changes
Problem:    A terminal window with a running job behaves different from a
            window containing a changed buffer.
Solution:   Do not set 'bufhidden' to "hide".  Fix that a buffer where a
            terminal used to run is listed as "[Scratch]".
e561a7e2fa
2019-06-26 20:51:18 -04:00
Jan Edmund Lazo
59b35d6a10 vim-patch:8.0.0935: cannot recognize a terminal buffer in :ls output
Problem:    Cannot recognize a terminal buffer in :ls output.
Solution:   Use R for a running job and F for a finished job.
304b64c9e6
2019-06-26 20:39:24 -04:00
Björn Linse
ac013d7147
Merge pull request #10342 from bfredl/apisandbox
eval/api: don't allow the API to be called in the sandbox
2019-06-26 11:59:08 +02:00
Justin M. Keyes
469726d3c5
Merge #10340 from janlazo/vim-8.1.1593
vim-patch:8.0.1688,8.1.1593
2019-06-26 11:01:10 +02:00
Björn Linse
8b263c7a68
Merge pull request #10344 from bfredl/extcmdredraw
cmdline: remove invalid cmdline_show event when aborting mapping
2019-06-26 10:47:18 +02:00
Björn Linse
4bf05ba399 cmdline: remove invalid cmdline_show event when aborting mapping 2019-06-26 09:16:17 +02:00
Björn Linse
2a2d288228 compositor: handle scrolling of blended window 2019-06-26 08:37:36 +02:00
Björn Linse
619a86cb1e eval/api: don't allow the API to be called in the sandbox.
Identifying and maintaining a "secure" subset of the API would be too
much busywork. So just disable the entire thing.
2019-06-26 08:19:57 +02:00
Jan Edmund Lazo
2d6c91ab99 vim-patch:8.0.1688: some macros are used without a semicolon
Problem:    Some macros are used without a semicolon, causing auto-indent to be
            wrong.
Solution:   Use the do-while(0) trick. (Ozaki Kiichi, closes vim/vim#2729)
6f4700233f
2019-06-26 00:05:29 -04:00
Jan Edmund Lazo
62c7fcbdab vim-patch:8.1.1593: filetype not detected for C++ header files without extension
Problem:    Filetype not detected for C++ header files without extension.
Solution:   Recognize the file by the Emacs file mode. (Dmitry Ilyin,
            closes vim/vim#4593)
6a7af8e2db
2019-06-25 21:20:26 -04:00
Björn Linse
b0c1e2ab5a api: make nvim__inspect_cell support multiple grids 2019-06-25 18:08:21 +02:00
Björn Linse
4c4d964eeb ui: add 'winblend' to support blending of floating windows
Also add `hi blend=` attribute to override transparency of indiviual attributes.
2019-06-25 18:08:21 +02:00
Jan Edmund Lazo
ace7e4e11b vim-patch:8.1.1342: using freed memory when joining line with text property
Problem:    Using freed memory when joining line with text property.
Solution:   Use already computed length.
787880a86d
2019-06-25 00:23:00 -04:00
Jan Edmund Lazo
56a96d8f82 vim-patch:8.0.1535: C syntax test still fails when using gvim
Problem:    C syntax test still fails when using gvim.
Solution:   Clear Normal cterm highlighting instead of setting it.
6acadda8d6
2019-06-24 23:44:54 -04:00
Jan Edmund Lazo
e7901301d3 vim-patch:8.1.0198: there is no hint that syntax is disabled for 'redrawtime'
Problem:    There is no hint that syntax is disabled for 'redrawtime'.
Solution:   Add a message.
0a6efcd27d
2019-06-24 23:40:18 -04:00
Jan Edmund Lazo
dfd050867b vim-patch:8.1.0437: may access freed memory when syntax HL times out
Problem:    May access freed memory when syntax HL times out. (Philipp Gesang)
Solution:   Clear b_sst_first when clearing b_sst_array.
95892c27b2
2019-06-24 23:34:17 -04:00
Justin M. Keyes
615fc68263
Merge #10323 from janlazo/vim-8.1.1055
vim-patch:8.0.{1479,1480,1482},8.1.1055
2019-06-25 02:37:50 +02:00
Justin M. Keyes
79450f2da9
Merge #10250 from blueyed/vim-8.0.1039
vim-patch:8.0.{10{39,53,55},1274}: cannot change a line in not current buffer
2019-06-25 02:36:07 +02:00
Justin M. Keyes
8cd87af8d6
Merge pull request #10290 from janlazo/vim-8.1.0086
vim-patch:8.1.{86,347}
2019-06-25 01:56:10 +02:00
James McCoy
8c7e41f596
[RFC] vim-patch:8.1.1365,8.1.1366,8.1.1367,8.1.1368,8.1.1382,8… (#10309)
[RFC] vim-patch:8.1.1365,8.1.1366,8.1.1367,8.1.1368,8.1.1382,8.1.1401
2019-06-24 12:08:57 -04:00
Justin M. Keyes
f2e3849100
Merge #10313 from rhysd/const-patches
vim-patch:8.1.1539,8.1.1543,8.1.1554 for :const from Vim
2019-06-24 14:27:31 +02:00
James McCoy
6cb4460207
lint 2019-06-24 06:46:01 -04:00
James McCoy
280938d932
vim-patch:8.1.1401: misspelled mkspellmem as makespellmem
Problem:    Misspelled mkspellmem as makespellmem.
Solution:   Drop duplicate help entry, fix test. (Naruhiko Nishino, Ken
            Takata, closes vim/vim#4437)
076073950c
2019-06-24 06:46:01 -04:00
James McCoy
d265054394
vim-patch:8.1.1382: error when editing test file
Problem:    Error when editing test file.
Solution:   Remove part of modeline.
3020a87cb1
2019-06-24 06:46:01 -04:00
James McCoy
f9694de9f1
vim-patch:8.1.1368: modeline test fails with python but without pythonhome
Problem:    Modeline test fails with python but without pythonhome.
Solution:   Correct test argument.
e09244ee35
2019-06-24 06:46:01 -04:00
James McCoy
2db189f57c
vim-patch:8.1.1367: can set 'modelineexpr' in modeline
Problem:    can set 'modelineexpr' in modeline.
Solution:   Add P_SECURE flag.
7e800c6047
2019-06-24 06:46:00 -04:00
James McCoy
1e4673d167
vim-patch:8.1.1366: using expressions in a modeline is unsafe
Problem:    Using expressions in a modeline is unsafe.
Solution:   Disallow using expressions in a modeline, unless the
            'modelineexpr' option is set.  Update help, add more tests.
110289e781
2019-06-24 06:45:55 -04:00
James McCoy
45bb1757bf
vim-patch:8.1.1365: source command doesn't check for the sandbox
Problem:    Source command doesn't check for the sandbox. (Armin Razmjou)
Solution:   Check for the sandbox when sourcing a file.
5357552140
2019-06-24 06:41:57 -04:00
Jan Edmund Lazo
ed2d651b50 vim-patch:8.0.1482: using feedkeys() does not work to test completion
Problem:    Using feedkeys() does not work to test Insert mode completion.
            (Lifepillar)
Solution:   Do not check for typed keys when executing :normal or feedkeys().
            Fix thesaurus completion not working when 'complete' is empty.
02ae9b4a93
2019-06-24 00:09:28 -04:00
erw7
28456e96f3 os: close library even if uv_dlopen() fails 2019-06-23 23:23:33 -04:00
Jan Edmund Lazo
87d6b1eccb vim-patch:8.1.0347: some tests fail on Solaris
Problem:    Some tests fail on Solaris.
Solution:   Skip writefile test. Fix path to libc.so. Improve test for Turkish
            case change. (Libor Bukata, Bjorn Linse, closes vim/vim#3403)
f1c118be93
2019-06-23 23:20:29 -04:00
Jan Edmund Lazo
d4de2cd7c7 vim-patch:8.1.0086: no tests for libcall() and libcallnr()
Problem:    No tests for libcall() and libcallnr().
Solution:   Add tests. (Dominique Pelle, closes vim/vim#2982)
1ceebb4efc
2019-06-23 23:20:29 -04:00
Jan Edmund Lazo
162bc62f56 vim-patch:8.0.1480: patch missing change
Problem:    Patch missing change.
Solution:   Add missing change.
0562532c2e
2019-06-23 22:23:50 -04:00
Jan Edmund Lazo
287f7a46a4 vim-patch:8.0.1479: insert mode completion state is confusing
Problem:    Insert mode completion state is confusing.
Solution:   Move ctrl_x_mode into edit.c.  Add CTRL_X_NORMAL for zero.
bc0e9adae9
2019-06-23 22:23:50 -04:00
Jan Edmund Lazo
3dcf2d5c16 vim-patch:8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Problem:    CTRL-G U in Insert mode doesn't work to avoid splitting the undo
            sequence for shift-left and shift-right.
Solution:   Also check dont_sync_undo for shifted cursor keys. (Christian
            Brabandt)
75bf3d22f4
2019-06-23 20:50:37 -04:00
rhysd
3e8bc4a13f eval.c: Fix clint errors and typo in comment of ex_const() 2019-06-24 09:35:56 +09:00
Justin M. Keyes
7d604a1e61
Merge #10294 from janlazo/vim-8.0.1239
vim-patch:8.0.1239,8.1.{112,125,165,166,167,169,181,242,270,272,747,850,853,1519}
2019-06-24 02:35:25 +02:00
rhysd
3d5a800278 vim-patch:8.1.1554: docs and tests for :const can be improved
Problem:    Docs and tests for :const can be improved.
Solution:   Improve documentation, add a few more tests. (Ryuichi Hayashida,
            closes vim/vim#4551)
1c196e7b17
2019-06-24 09:31:30 +09:00
rhysd
bd0615590b vim-patch:8.1.1543: const test fails with small features
Problem:    Const test fails with small features.
Solution:   Don't unlet non-existing variables.
b6e3b88ec8
2019-06-24 09:31:12 +09:00
rhysd
1c90c19f62 vim-patch:8.1.1539: not easy to define a variable and lock it
Problem:    Not easy to define a variable and lock it.
Solution:   Add ":const".
9937a05543
2019-06-24 09:30:51 +09:00
Jan Edmund Lazo
fa3db26f10 eval: assert VAR_LIST branch in filter_map() 2019-06-23 19:11:01 -04:00
Alan Wu
9fd4a0b526 getchar: Handle incomplete <Paste> in typeahead buffer #10311
<Paste> is a 3-byte sequence and the beginning one or two bytes can appear at
the very end of the typeahead buffer. When this happens, we were exiting from
`vgetorpeek()` instead of reading more characters to see the complete sequence.

I think this should fix #7994 -- at least partially. Before this change, when I
paste exactly 64 characters into a freshly booted instance, I get what I pasted
plus the literal text "<Paste>" at the end. Nvim also stays in nopaste mode.
The attached test case fails in this manner without the code change.

Fix #7994
2019-06-24 00:28:04 +02:00
Jan Edmund Lazo
4653b5943f vim-patch:8.1.0747: map() with a bad expression doesn't give an error
Problem:    map() with a bad expression doesn't give an error. (Ingo Karkat)
Solution:   Check for giving an error message. (closes vim/vim#3800)
ce9d50df07
2019-06-23 18:17:10 -04:00
Jan Edmund Lazo
2813c83ea1 vim-patch:8.1.1519: 'backupskip' may contain duplicates
Problem:    'backupskip' may contain duplicates.
Solution:   Add the P_NODUP flag. (Tom Ryder)
06e2c81f6d
2019-06-23 18:17:10 -04:00
Jan Edmund Lazo
6558e02b95 vim-patch:8.1.0853: options test fails on Mac
Problem:    Options test fails on Mac.
Solution:   Remove a trailing slash from $TMPDIR.
cbbd0f6578
2019-06-23 18:17:09 -04:00
Jan Edmund Lazo
ca6b42d7fd vim-patch:8.1.0850: test for 'backupskip' is not correct
Problem:    Test for 'backupskip' is not correct.
Solution:   Split the option in parts and use expand(). (Michael Soyka)
98ad1e17c3
2019-06-23 18:17:09 -04:00
Jan Edmund Lazo
25f99dde94 vim-patch:8.1.0272: options test fails if temp var ends in slash
Problem:    Options test fails if temp var ends in slash. (Tom Briden)
Solution:   Check for optional slash. (closes vim/vim#3308)
f53c692240
2019-06-23 18:17:09 -04:00
Jan Edmund Lazo
450d9e6bdf vim-patch:8.1.0270: checking for a Tab in a line could be faster
Problem:    Checking for a Tab in a line could be faster.
Solution:   Use strchr() instead of strrchr(). (closes vim/vim#3312)
b31a3acce1
2019-06-23 18:17:09 -04:00
Jan Edmund Lazo
1935cc2639 vim-patch:8.1.0242: Insert mode completion may use an invalid buffer pointer
Problem:    Insert mode completion may use an invalid buffer pointer.
Solution:   Check for ins_buf to be valid. (closes vim/vim#3290)
02ab97709d
2019-06-23 18:17:09 -04:00
Jan Edmund Lazo
3a49fa8f8b vim-patch:8.1.0169: calling message_filtered() a bit too often
Problem:    Calling message_filtered() a bit too often.
Solution:   Only call message_filtered() when filtering is already false.
a9defadb8f
2019-06-23 18:17:09 -04:00
Jan Edmund Lazo
bb02ca6def vim-patch:8.1.0167: lock flag in new dictitem is reset in many places
Problem:    Lock flag in new dictitem is reset in many places.
Solution:   Always reset the lock flag.
c89d4b3530
2019-06-23 18:17:09 -04:00
Jan Edmund Lazo
98801ec7ae vim-patch:8.1.0166: using dict_add_nr_str() is clumsy
Problem:    Using dict_add_nr_str() is clumsy.
Solution:   Split into two functions. (Ozaki Kiichi, closes vim/vim#3154)
e0be167a80
2019-06-23 18:17:09 -04:00
Jan Edmund Lazo
ff244a1309 vim-patch:8.1.0165: :clist output can be very long
Problem:    :clist output can be very long.
Solution:   Support filtering :clist entries. (Yegappan Lakshmanan)
4cde86c2ef
2019-06-23 18:17:09 -04:00
Jan Edmund Lazo
f99e314da0 ops: refactor swapchar() to return bool 2019-06-23 18:17:09 -04:00
Jan Edmund Lazo
3abffe7015 vim-patch:8.1.0125: virtual edit replace with multi-byte fails at end of line
Problem:    Virtual edit replace with multi-byte fails at end of line. (Lukas
            Werling)
Solution:   use ins_char() to add the character. (Christian Brabandt,
            closes vim/vim#3114)  Rename PCHAR() to PBYTE() to avoid mistakes like
            this.
630afe889a
2019-06-23 18:17:09 -04:00
Jan Edmund Lazo
f0d6695e7c vim-patch:8.1.0181: memory leak with trailing characters in skip expression
Problem:    Memory leak with trailing characters in skip expression.
Solution:   Free the return value.
a43ebe9454
2019-06-23 18:17:08 -04:00
Jan Edmund Lazo
6eae28f090 eval: require nonnull func args to pass ASAN build 2019-06-23 18:17:08 -04:00
Jan Edmund Lazo
efdc0f6a69 vim-patch:8.1.0112: no error when using bad arguments with searchpair()
Problem:    No error when using bad arguments with searchpair().
Solution:   Add error messages.
3dddb09c98
2019-06-23 18:17:08 -04:00
Jan Edmund Lazo
8bc365c886 lint 2019-06-23 18:17:08 -04:00
Jan Edmund Lazo
83ef740e15 vim-patch:8.0.1239: cannot use a lambda for the skip argument to searchpair()
Problem:    Cannot use a lambda for the skip argument to searchpair().
Solution:   Evaluate a partial, funcref and lambda. (LemonBoy, closes vim/vim#1454,
            closes vim/vim#2265)
48570488f1
2019-06-23 18:17:08 -04:00
oni-link
0bdeec8ef0 screen: Adjust buffer sizes for multiple sign columns #10314
* screen: Fix to draw signs with combining characters.
The buffer size for signs can be too small, because the upper length
limit of a sign can be 56 bytes. If combining characters are only two
bytes in size, this reduces to 32 bytes.

* screen: Adjust buffer size to maximal sign column count
2019-06-24 00:01:01 +02:00
Marvim the Paranoid Android
098fd36235 version.c: update [ci skip] #10115
vim-patch:8.0.0908: cannot set terminal size with options
vim-patch:8.0.0909: channel test fails
vim-patch:8.0.0920: cursor wrong after switching altscreen in terminal
vim-patch:8.0.0923: crash in GUI when terminal job exits
vim-patch:8.0.0924: terminal window not updated after using term_sendkeys()
vim-patch:8.0.0926: when job in terminal window ends topline is wrong
vim-patch:8.0.0927: if a terminal job sends a blank title "running" is not shown
vim-patch:8.0.0929: :term without argument does not work
vim-patch:8.0.0936: mode() returns wrong value for a terminal window
vim-patch:8.0.0938: scrolling in terminal window is inefficient
vim-patch:8.0.0939: Test_terminal_env is flaky
vim-patch:8.0.0940: Test_terminal_scrape_multibyte is flaky
vim-patch:8.0.0942: using freed memory with ":terminal"
vim-patch:8.0.0943: MS-Windows: Test_terminal_scrape_multibyte may fail
vim-patch:8.0.0957: a terminal job can deadlock when sending many keys
vim-patch:8.0.0958: terminal test fails on Windows when winpty dll is missing
vim-patch:8.0.0959: build failure on MS-Windows
vim-patch:8.0.0963: terminal test fails on MacOS
vim-patch:8.0.0964: channel write buffer does not work with poll()
vim-patch:8.0.0965: not restoring cursor shape after it was set in a terminal
vim-patch:8.0.0968: crash when switching terminal modes
vim-patch:8.0.0973: initial info about blinking cursor is wrong
vim-patch:8.0.0977: cannot send lines to a terminal job on MS-Windows
vim-patch:8.0.0978: writing to terminal job is not tested
vim-patch:8.0.0979: terminal noblock test fails on MS-Windows
vim-patch:8.0.0981: cursor in terminal window blinks by default
vim-patch:8.0.0982: cannot use a terminal when 'encoding' is non-utf8 multi-byte
vim-patch:8.0.0984: terminal blinking cursor not correct in the GUI
vim-patch:8.0.0985: libvterm has its own idea of character width
vim-patch:8.0.0987: terminal: second byte of double-byte char wrong
vim-patch:8.0.0990: with DBCS 'encoding' wrong pasting register into terminal
vim-patch:8.0.0991: using wrong character conversion for DBCS
vim-patch:8.0.0992: terminal title is wrong when 'encoding' is DBCS
vim-patch:8.0.0994: MS-Windows: cursor in terminal blinks undesirably
vim-patch:8.0.0995: terminal tests fail on Mac
vim-patch:8.0.1009: Xterm cursor blinking status may be inverted
vim-patch:8.0.1011: terminal test fails with Athena and Motif
vim-patch:8.0.1015: missing update to terminal test
vim-patch:8.0.1034: sending buffer lines to terminal doesn't work on MS-Windows
vim-patch:8.0.1036: ++eof argument for terminal only available on MS-Windows
vim-patch:8.0.1049: shell on Mac can't handle long text
vim-patch:8.0.1052: term_start() does not allow in_io, out_io and err_io options
vim-patch:8.0.1054: terminal test fails on MS-Windows
vim-patch:8.0.1057: terminal scrape test waits too long
vim-patch:8.0.1058: terminal redirection test is flaky
vim-patch:8.0.1070: terminal test is flaky on Mac
vim-patch:8.0.1075: MS-Windows: mouse does not work in terminal
vim-patch:8.0.1076: term_start() does not take callbacks
vim-patch:8.0.1080: memory leak for eof_chars terminal option and buffer name
vim-patch:8.0.1081: memory leak for the channel write queue
vim-patch:8.0.1083: leaking memory in input part of channel
vim-patch:8.0.1087: Test_terminal_cwd is flaky
vim-patch:8.0.1095: terminal multibyte escrape test is flaky
vim-patch:8.0.1101: channel write fails if writing to log fails
vim-patch:8.0.1103: converting cterm color fails for grey ramp
vim-patch:8.0.1106: terminal colors wrong on an MS-Windows console
vim-patch:8.0.1116: terminal test fails on MS-Windows
vim-patch:8.0.1117: Test_terminal_no_cmd hangs on MS-Windows with GUI
vim-patch:8.0.1126: endless resize when terminal showing in two buffers
vim-patch:8.0.1131: not easy to trigger an autocommand for new terminal window
vim-patch:8.0.1149: libvterm colors differ from xterm
vim-patch:8.0.1167: Motif: typing in terminal window is slow
vim-patch:8.0.1173: terminal window is not redrawn after CTRL-L
vim-patch:8.0.1177: in a terminal window the popup menu is not cleared
vim-patch:8.0.1213: setting 'mzschemedll' has no effect
vim-patch:8.0.1261: program in terminal window gets NL instead of CR
vim-patch:8.0.1277: terminal window CR-NL conversions may cause problems
vim-patch:8.0.1286: occasional crash when using a channel
vim-patch:8.0.1296: checking the same condition twice
vim-patch:8.0.1315: build still fails on Mac
vim-patch:8.0.1316: build still still fails on Mac
vim-patch:8.0.1317: accessing freed memory in term_wait()
vim-patch:8.0.1323: mouse events in a terminal window may cause endless loop
vim-patch:8.0.1328: trouble when using ":term ++close" with autocmd
vim-patch:8.0.1340: MS-Windows: cannot build GUI without IME
vim-patch:8.0.1342: cannot build with Motif and multi-byte
vim-patch:8.0.1347: MS-Windows: build broken by misplaced curly
vim-patch:8.0.1359: libvterm ANSI colors can not always be recognized
vim-patch:8.0.1360: the Terminal highlighting doesn't work in a terminal
vim-patch:8.0.1362: terminal window colors wrong when using Terminal highlighting
vim-patch:8.0.1368: cannot drag status or separator of new terminal window
vim-patch:8.0.1376: cursor in terminal not always updated
vim-patch:8.0.1381: ch_readraw() waits for NL if channel mode is NL
vim-patch:8.0.1429: crash when calling term_start() with empty argument
vim-patch:8.0.1430: crash when term_start() fails
vim-patch:8.0.1462: missing yet another file in patch
vim-patch:8.0.1476: screen isn't always updated right away
vim-patch:8.0.1477: redraw flicker when moving the mouse outside of terminal window
vim-patch:8.0.1484: reduntant conditions
vim-patch:8.0.1515: BufWinEnter event fired when opening hidden terminal
vim-patch:8.0.1521: Shift-Tab does not work in a terminal window
vim-patch:8.0.1533: libterm doesn't support requesting fg and bg color
vim-patch:8.0.1537: xxd does not skip NUL lines when using ebcdic
vim-patch:8.0.1542: terminal screen dump does not include cursor position
vim-patch:8.0.1546: using feedkeys() in a terminal may trigger mappings
vim-patch:8.0.1552: may leak file descriptors when executing job
vim-patch:8.0.1576: Perl VIM::Buffers() does not find every buffer
vim-patch:8.0.1594: :conform qall not tested with active terminal window
vim-patch:8.0.1598: cannot select text in a terminal with the mouse
vim-patch:8.0.1605: terminal test is a bit flaky
vim-patch:8.0.1611: CTRL-W in system terminal does not go to job
vim-patch:8.0.1615: term_dumpload() does not use the right colors
vim-patch:8.0.1623: terminal kill tests are flaky
vim-patch:8.0.1628: channel log doesn't mention exiting
vim-patch:8.0.1629: Mac: getpagesize() is deprecated
vim-patch:8.0.1631: testing with Vim running in terminal is a bit flaky
vim-patch:8.0.1632: in a terminal dump NUL and space are different
vim-patch:8.0.1636: no test for term_dumpload() and term_dumpdiff()
vim-patch:8.0.1637: no test for term_dumpdiff() options argument
vim-patch:8.0.1638: popup test fails depending on environment variable
vim-patch:8.0.1640: Test_cwd() is flaky
vim-patch:8.0.1642: running Vim in terminal fails with two windows
vim-patch:8.0.1643: terminal API tests fail
vim-patch:8.0.1644: terminal API tests still fail
vim-patch:8.0.1645: test for terminal response to escape sequence may fail
vim-patch:8.0.1648: resource fork tool doesn't work on Python 3
vim-patch:8.0.1652: term_dumpwrite() does not output composing characters
vim-patch:8.0.1656: no option to have xxd produce upper case variable names
vim-patch:8.0.1657: crash when reading a channel
vim-patch:8.0.1662: showing dump diff doesn't mention both file names
vim-patch:8.0.1664: test failure because of not allocating enough space
vim-patch:8.0.1667: terminal window tests are flaky
vim-patch:8.0.1670: terminal window tests are still a bit flaky
vim-patch 8.0.1671: crash when passing non-dict argument as env to job_start()
vim-patch:8.0.1673: terminal window tests are still a bit flaky
vim-patch:8.0.1680: memory allocated by libvterm is not profiled
vim-patch:8.0.1681: the format attribute fails with MinGW
vim-patch:8.0.1684: ml_get errors when using terminal window for shell command
vim-patch:8.0.1690: not easy to run one test with gvim instead of vim
vim-patch:8.0.1691: xxd test sometimes fails
vim-patch:8.0.1694: terminal API test is a bit flaky
vim-patch:8.0.1695: xxd test not run on MS-Windows
vim-patch:8.0.1703: in the tutor 'showcmd' is not set
vim-patch:8.0.1709: some non-C89 code may slip through
vim-patch:8.0.1714: term_setsize() does not give an error in a normal buffer
vim-patch:8.0.1715: terminal buffer can be 1 more than 'terminalscroll' lines
vim-patch:8.0.1716: test for term_setsize() does not give a good error message
vim-patch:8.0.1718: terminal scrollback test fails on MS-Windows
vim-patch:8.0.1720: when a timer is running a terminal window may not close
vim-patch:8.0.1721: no test for using the 'termsize' option
vim-patch:8.0.1724: declarations cannot be halfway a block
vim-patch:8.0.1728: condition always false, useless code
vim-patch:8.0.1746: MS-Windows: channel tests fail
vim-patch:8.0.1761: job in terminal window with no output channel is killed
vim-patch:8.0.1762: terminal debug logging is a bit complicated
vim-patch:8.0.1775: MS-Windows: warning for unused variable
vim-patch:8.0.1780: test fails because Vim in a terminal uses wrong 'encoding'
vim-patch:8.0.1795: lose contact with jobs when :gui forks
vim-patch:8.0.1796: GUI: click on tab fails when the focus is in a terminal
vim-patch:8.0.1801: MS-Windows: redirecting terminal output does not work
vim-patch:8.0.1802: MS-Windows: terminal test fails
vim-patch:8.0.1814: crash with terminal window and with 'lazyredraw' set
vim-patch:8.0.1818: lines remove from wrong buffer when using terminal window
vim-patch:8.0.1820: terminal window redirecting stdout does not show stderr
vim-patch:8.0.1821: cursor in terminal window moves when pressing CTRL-W
vim-patch:8.0.1823: test for terminal stdout redirection is flaky
vim-patch:8.0.1830: switching to Terminal-Normal mode does not redraw
vim-patch:8.0.1838: cursor in wrong pos when switching to Terminal-Normal mode
vim-patch:8.0.1841: HP-UX does not have setenv()
vim-patch:8.0.1846: Python interface is incompatible with lldb
vim-patch:8.0.1848: 'termwinscroll' does not work properly

vim-patch:8.1.0013: using freed memory when changing terminal cursor color
vim-patch:8.1.0015: cursor color wrong when closing a terminal window
vim-patch:8.1.0016: possible crash in term_wait()
vim-patch:8.1.0026: terminal test fails with very tall terminal
vim-patch:8.1.0029: terminal test fails on MS-Windows when "wc" exists
vim-patch:8.1.0031: terminal test aucmd_on_close if flaky
vim-patch:8.1.0033: keys to stop Vim in terminal are wrong
vim-patch:8.1.0076: command getting cleared with CTRL-W : in a terminal window
vim-patch:8.1.0082: in terminal window, typing : at more prompt, inserts ':'
vim-patch:8.1.0088: terminal test for stdout and stderr is a bit flaky
vim-patch:8.1.0094: help text "usage:" is not capatalized
vim-patch:8.1.0106: build fails when HAVE_DATE_TIME is undefined
vim-patch:8.1.0171: typing CTRL-W n in a terminal window causes ml_get error
vim-patch:8.1.0182: Unicode standard was updated
vim-patch:8.1.0210: still a few K&R function declarations
vim-patch:8.1.0227: spaces instead of tabs in makefile
vim-patch:8.1.0238: 'buftype' is cleared when using ":term ++hidden cat"
vim-patch:8.1.0243: using :term ++close ++hidden closes a window
vim-patch:8.1.0263: channel log doesn't show part of channel
vim-patch:8.1.0283: missing test dump
vim-patch:8.1.0326: screen dump does not consider NUL and space equal
vim-patch:8.1.0329: using inputlist() during startup results in garbage
vim-patch:8.1.0358: crash when using term_dumpwrite() after the job finished
vim-patch:8.1.0520: screen diff test sometimes fails
vim-patch:8.1.0530: channel and terminal tests that start a server can be flaky
vim-patch:8.1.0600: channel test is flaky
vim-patch:8.1.0626: MS-Windows: no resize to fit parent when using --windowid
vim-patch:8.1.0633: crash when out of memory while opening a terminal window
vim-patch:8.1.0712: MS-Windows build instructions are a bit outdated
vim-patch:8.1.0766: various problems when using Vim on VMS
vim-patch:8.1.0785: depending on the configuration some functions are unused
vim-patch:8.1.0821: xxd "usage" output and other arguments not tested
vim-patch:8.1.0854: xxd does not work with more than 32 bit addresses
vim-patch:8.1.0855: cannot build xxd with MSVC 10
vim-patch:8.1.0893: terminal test is a bit flaky
vim-patch:8.1.0966: one terminal test is flaky
vim-patch:8.1.1125: libvterm does not handle the window position report
vim-patch:8.1.1169: writing coverage info in a separate dir is not needed
vim-patch:8.1.1464: only 4-digit rgb termresponse is recognized
vim-patch:8.1.1468: the generated desktop files may be invalid
vim-patch:8.1.1480: desktop file check doesn't run on CI
vim-patch:8.1.1481: length for two-digit rgb termresponse is off by one
vim-patch:8.1.1482: no test for wincol() depending on the 'number' option
vim-patch:8.1.1487: older msgfmt cannot generate proper .desktop file
vim-patch:8.1.1500: wrong shell command when building with VIMDLL and "! in 'go'
vim-patch:8.1.1503: sound test fails on Travis
vim-patch:8.1.1504: sound test still fails on Travis
vim-patch:8.1.1506: syntax error in Travis config
vim-patch:8.1.1507: sound test still fails on Travis
vim-patch:8.1.1512: ch_evalexpr() hangs when used recursively
vim-patch:8.1.1514: MS-Windows: wrong shell command with ! in 'guioptions'
vim-patch:8.1.1529: libcanberra is linked with even when not used
vim-patch:8.1.1531: clipboard type name is inconsistent
vim-patch:8.1.1532: build fails
vim-patch:8.1.1533: GUI build fails on Mac
vim-patch:8.1.1556: command for failing screenshot does not include directory
vim-patch:8.1.1557: compiler warning for unused variables in tiny version
vim-patch:8.1.1566: error message when terminal closes in another tab
vim-patch:8.1.1578: MS-Windows: pathdef.c should depend on build options
vim-patch:8.1.1582: cannot build with +textprop but without +timers

vim-patch:8.0.0947: entering terminal using C-O C-W C-W goes to Insert mode
vim-patch:8.1.1490: when a single test fails the exit code is not set
vim-patch:8.1.1492: MS-Windows: when "!" is in 'guioptions' ":!start" fails
vim-patch:8.0.1162: shared script for tests cannot be included twice
vim-patch:8.1.1530: Travis config is not optimal
2019-06-23 02:31:19 +02:00
erw7
3f48b3a92f Update argc(),argv() based on 8.1.0493 2019-06-19 01:36:01 -04:00
Jan Edmund Lazo
516eb9bf9d test/old: run test_arglist
Run failing tests, added in vim-patch:8.1.0493.
2019-06-19 01:36:01 -04:00
Jan Edmund Lazo
5c2feb690e vim-patch:8.1.0074: crash when running quickfix tests
Problem:    Crash when running quickfix tests.
Solution:   Do not alloc a new location list when checking for the reference
            to be still valid.
d6b01a2d38
2019-06-19 01:36:00 -04:00
Jan Edmund Lazo
a6707f5791 vim-patch:8.1.0073: crash when autocommands call setloclist()
Problem:    Crash when autocommands call setloclist(). (Dominique Pelle)
Solution:   If the quickfix list changes then don't jump to the error.
0366c0161e
2019-06-19 01:36:00 -04:00
Jan Edmund Lazo
8bea8d7b47 vim-patch:8.0.1726: older MSVC doesn't support declarations halfway a block
Problem:    Older MSVC doesn't support declarations halfway a block.
Solution:   Move the declaration back to the start of the block.
df2c774ded
2019-06-19 01:36:00 -04:00
Jan Edmund Lazo
315076a26d vim-patch:8.0.1723: using one item array size declaration is misleading
Problem:    Using one item array size declaration is misleading.
Solution:   Instead of using "[1]" and actually using a larger array, use
            "[]".  This is to verify that this C99 feature works for all
            compilers.
f3a411783c

The following patch is N/A because Neovim requires C99.
vim-patch:8.0.1735: flexible array member feature not supported by HP-UX
2019-06-19 01:36:00 -04:00
Daniel Hahler
59b2b1c955
tests: oldtests: mark Test_cursorhold_insert as flaky [ci skip] (#10264)
Fails often on CI (OSX), e.g.:

```
1 FAILED:
Found errors in Test_cursorhold_insert():
function RunTheTest[37]..Test_cursorhold_insert line 9: Expected 1 but got 0
```

> Compiler: clang Xcode: xcode10.1 C

The test could be adjusted to re-try the timer a few times, but I do not
think it's really worth it currently, and that the test should be marked
as flaky instead.
2019-06-19 01:19:20 +02:00
Björn Linse
149dcbf2c7
Merge pull request #10021 from bfredl/chanevent
channel: refactor events, prevent recursive invocation of callbacks
2019-06-18 13:58:14 +02:00
Björn Linse
d4938743e6 channel: refactor events, prevent recursive invocation of events 2019-06-18 10:49:38 +02:00
Daniel Hahler
25e04c1d98
gcov: use __gcov_flush instead of __gcov_dump (#10260)
This restores missing coverage again.

Move it to process_spawn in os/pty_process_unix.c, since it seems to
break printargs-test on Windows/AppVeyor otherwise (#10248).
2019-06-18 06:31:57 +02:00
Daniel Hahler
d0e1417254 vim-patch:8.0.1274: setbufline() fails when using folding
Problem:    setbufline() fails when using folding.
Solution:   Set "curwin" if needed. (Ozaki Kiichi, closes vim/vim#2293)
0c4dc88a63
2019-06-18 00:51:08 +02:00
Daniel Hahler
d43cf02186 vim-patch:8.0.1055: bufline test hangs on MS-Windows
Problem:    Bufline test hangs on MS-Windows.
Solution:   Avoid message for writing file.  Source shared.vim when running
            test individually.
11aa62f8f9
2019-06-18 00:21:52 +02:00
Daniel Hahler
8db93d0d83 vim-patch:8.0.1053: setline() does not work on startup
Problem:    setline() does not work on startup. (Manuel Ortega)
Solution:   Do not check for ml_mfp to be set for the current buffer.
            (Christian Brabandt)
9d954207e2
2019-06-18 00:18:52 +02:00
Daniel Hahler
9485061baa vim-patch:8.0.1039: cannot change a line in not current buffer
Problem:    Cannot change a line in a buffer other than the current one.
Solution:   Add setbufline(). (Yasuhiro Matsumoto, Ozaki Kiichi, closes vim/vim#1953)
b31cf2bb0b
2019-06-17 23:43:26 +02:00
Daniel Hahler
c6602df015 vim-patch:8.1.1546: in some tests 'tags' is set but not restored
Problem:    In some tests 'tags' is set but not restored. (Daniel Hahler)
Solution:   Restore 'tags'. (closes vim/vim#4535)
0331faf712
2019-06-16 19:51:12 +02:00
Daniel Hahler
3d8e8cb889 tests: fix Test_tagfiles: use Vim's 'tags' setting
Otherwise it might fail with an existing `tags` file upwards, e.g. in
neovim's source directory (which should be rather common).
2019-06-16 19:51:12 +02:00
Daniel Hahler
d32b92e265
vim-patch:8.0.1845: various comment updates needed, missing white space (#10203)
Problem:    Various comment updates needed, missing white space.
Solution:   Update comments, add white space.
259f26ac2d

Ignored (partly) applied patch for src/nvim/po/it.po.
2019-06-16 19:49:23 +02:00
Daniel Hahler
491a3210a9
vim-patch:8.1.1003: playing back recorded key sequence mistakes key code (#10155)
Problem:    Playing back recorded key sequence mistakes key code.
Solution:   Insert a <Nop> after the <Esc>. (closes vim/vim#4068)
6edbbd8114
2019-06-16 19:48:46 +02:00
Daniel Hahler
d792d4ec06
Merge pull request #10236 from janlazo/vim-8.1.1545
vim-patch:8.0.{1516,1549},8.1.{0044,1545}
2019-06-16 17:52:38 +02:00
Björn Linse
e39d217592 messages: fix crash with msg_advance when using ext_messages 2019-06-16 11:31:35 +02:00
Björn Linse
41f31ca90d messages: support shortmess-=S in ext_messages 2019-06-16 11:07:29 +02:00
Jan Edmund Lazo
cb01925eb4 vim-patch:8.0.1549: various small problems in test files
Problem:    Various small problems in test files.
Solution:   Include small changes.
5d7ead3bc8
2019-06-15 22:24:59 -04:00
Jan Edmund Lazo
b837c56576 vim-patch:8.0.1516: errors for job options are not very specific
Problem:    Errors for job options are not very specific.
Solution:   Add more specific error messages.
b3292fa2d3
2019-06-15 22:14:29 -04:00
Jan Edmund Lazo
c6c5754a86 vim-patch:8.1.0044: if a test function exists Vim this may go unnoticed
Problem:    If a test function exists Vim this may go unnoticed.
Solution:   Check for a test funtion quitting Vim.  Fix tests that did exit
            Vim.
8903676d3d

Restore test_assert.vim to run Test_zz_quit_detected().
2019-06-15 21:48:27 -04:00
Jan Edmund Lazo
1abfeff978 vim-patch:8.1.1545: when the screen is to small there is no message about that
Problem:    When the screen is to small there is no message about that.
            (Daniel Hahler)
Solution:   Do not use :cquit. (closes vim/vim#4534)
45aa07d3c1
2019-06-15 21:48:27 -04:00
Jan Edmund Lazo
b60c986a49 vim-patch:8.0.1245: when WaitFor() has a wrong expression it just waits a second (#10233)
Problem:    When WaitFor() has a wrong expression it just waits a second,
            which goes unnoticed. (James McCoy)
Solution:   When WaitFor() times out throw an exception.  Fix places where the
            expression was wrong.
3e1c617d49
2019-06-15 18:56:55 +02:00
Daniel Hahler
d3d25f957d
Dump gcov coverage in process_spawn (#10230)
Fixes https://github.com/neovim/neovim/pull/3926#issuecomment-502343527.
2019-06-15 18:30:04 +02:00
Björn Linse
64cdf9f78a api/lua: add on_detach to nvim_buf_attach 2019-06-15 13:19:12 +02:00
Jan Edmund Lazo
18b031ea1d vim-patch:8.0.0953: get "no write since last change" error in terminal window
Problem:    Get "no write since last change" error in terminal window.
Solution:   Use another message when closing a terminal window. Make ":quit!"
            also end the job.
f5be7cd016
2019-06-13 22:40:12 -04:00
Jan Edmund Lazo
6efa3bff09 test/old: pass Test_statusline on Windows 2019-06-13 19:39:55 -04:00
Jan Edmund Lazo
47a5456670 vim-patch:8.0.0933: terminal test tries to start GUI when it's not possible
Problem:    Terminal test tries to start GUI when it's not possible.
Solution:   Check if the GUI can run. (James McCoy, closes vim/vim#1971)
9f0139a2a8
2019-06-13 19:39:55 -04:00
Jan Edmund Lazo
e6a1bea1eb vim-patch:8.0.0931: getwininfo() does not indicate a terminal window
Problem:    getwininfo() does not indicate a terminal window.
Solution:   Add "terminal" to the dictionary.
69905d108b
2019-06-13 19:39:55 -04:00
Björn Linse
21cf4b0ce6 screen: showcmd should never move the cursor
Also restore the symmetry between grid_puts_line_start and
grid_puts_line_flush.
2019-06-13 20:22:37 +02:00
Daniel Hahler
cc4d463cad
Merge pull request #10202 from blueyed/vim-8.0.1704
vim-patch:8.0.1704: 'backupskip' default doesn't work for Mac

Also aligns tests from two previous patched to the ones in upstream.
2019-06-13 14:20:51 +02:00
Harm te Hennepe
424ddd01f5 tui: support rgba background detection (#10205)
Fixes https://github.com/neovim/neovim/issues/10159.
2019-06-13 14:14:41 +02:00
Daniel Hahler
66613ace48 vim-patch:8.0.1704: 'backupskip' default doesn't work for Mac
Problem:    'backupskip' default doesn't work for Mac.
Solution:   Use "/private/tmp". (Rainer Müller, closes vim/vim#2793)
b8e22a053b
2019-06-13 00:28:16 +02:00
Daniel Hahler
5db3be092a tests: align tests in test_options to Vim (moved) 2019-06-12 23:08:27 +02:00
Daniel Hahler
6f27f5ef91 main: do event_init before early_init #10183
Fixes https://github.com/neovim/neovim/issues/10172

* move log_init to event_init
* move init_signs to end of early_init
2019-06-12 14:22:42 +02:00
Jan Edmund Lazo
22d58ab664 vim-patch:8.1.0213: CTRL-W CR does not work properly in a quickfix window
Problem:    CTRL-W CR does not work properly in a quickfix window.
Solution:   Split the window if needed. (Jason Franklin)
0a08c63da1
2019-06-12 00:22:16 -04:00
Jan Edmund Lazo
005316ae41 vim-patch:8.0.1689: no tests for xxd
Problem:    No tests for xxd.
Solution:   Add a test. (Christian Brabandt)
29f9ed20b4
2019-06-11 22:31:21 -04:00
Justin M. Keyes
f8d0e41b28
Merge #10163 from blueyed/vim-8.1.1292
vim-patch:8.1.1292: invalid command line arguments not tested
2019-06-11 14:01:09 +02:00
Daniel Hahler
432f69fc09 vim-patch:8.1.1211: test user command code #10162
Problem:    Not all user command code is tested.
Solution:   Add more tests.
e61e548dd6
2019-06-11 13:56:15 +02:00
Daniel Hahler
304861e0ee adjust tests for nvim 2019-06-11 12:52:17 +02:00
Daniel Hahler
76506ca0a3 vim-patch:8.1.1292: invalid command line arguments not tested
Problem:    Invalid command line arguments not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#4346)
ba9ea91beb
2019-06-10 18:10:15 +02:00
erw7
ce90a19abd TUI: set os/input.c:global_fd to input->in_fd #10174
Problem: When we changed startup to wait for the TUI (like a remote UI),
         we forgot to set os/input.c:global_fd.  That used to be done by
         input_start().

Solution: Initialize os/input.c:global_fd before initializing libtermkey
          (termkey_new_abstract) so that tui_get_stty_erase() and
          friends can inspect the correct fd.

fixes #10134
close #10174
2019-06-10 16:43:52 +02:00
Justin M. Keyes
04e2ba85b1
doc [ci skip] #10129
- document lua vim.loop #10123
2019-06-10 15:53:42 +02:00
George Zhao
c83926cd0a lua: introduce vim.loop (expose libuv event-loop) #10123
Co-authored-by: Andrey Popp <8mayday@gmail.com>

closes #9546
closes #10084
2019-06-10 14:13:18 +02:00
Jan Edmund Lazo
3e58e60568 vim-patch:8.0.1278: Add the "k" flag in 'guioptions' #10175
Problem:    GUI window always resizes when adding/removing a scrollbar,
            toolbar, etc.
Solution:   Add the 'k' flag in 'guioptions' to keep the GUI window size and
            change the number of lines/columns instead. (Ychin, closes vim/vim#703)
8ac441576f
2019-06-10 12:18:59 +02:00
Jan Edmund Lazo
84ba37fbcb lint 2019-06-09 16:25:10 -04:00