Commit Graph

13902 Commits

Author SHA1 Message Date
Daniel Hahler
8404e8df20
third-party: download: retry (#10599)
This is meant to handle the common case of failing to download
libtermkey:

    FAILED: cd /home/travis/build/neovim/neovim/deps-downloads/libtermkey && /usr/local/cmake-3.12.4/bin/cmake -DPREFIX=/home/travis/nvim-deps/build -DDOWNLOAD_DIR=/home/travis/build/neovim/neovim/deps-downloads/libtermkey -DURL=http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.21.1.tar.gz -DEXPECTED_SHA256=cecbf737f35d18f433c8d7864f63c0f878af41f8bd0255a3ebb16010dc044d5f -DTARGET=libtermkey -DUSE_EXISTING_SRC_DIR=OFF -P /home/travis/build/neovim/neovim/third-party/cmake/DownloadAndExtractFile.cmake && /usr/local/cmake-3.12.4/bin/cmake -E touch /home/travis/nvim-deps/build/src/libtermkey-stamp/libtermkey-download
    -- file: /home/travis/build/neovim/neovim/deps-downloads/libtermkey/libtermkey-0.21.1.tar.gz
    -- downloading...
         src='http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.21.1.tar.gz'
         dst='/home/travis/build/neovim/neovim/deps-downloads/libtermkey/libtermkey-0.21.1.tar.gz'
         timeout='none'
    CMake Error at /home/travis/build/neovim/neovim/third-party/cmake/DownloadAndExtractFile.cmake:77 (message):
      error: downloading
      'http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.21.1.tar.gz' failed
        status_code: 6
        status_string: "Couldn't resolve host name"
        log: Curl_ipv4_resolve_r failed for www.leonerd.org.uk
      Couldn't resolve host 'www.leonerd.org.uk'
      Closing connection 0

Co-Authored-By: Justin M. Keyes <justinkz@gmail.com>
2019-07-24 19:11:27 +02:00
Daniel Hahler
431cf56e2f
ci: RunTests: ensure that the logfile gets displayed (#10597)
This is meant to help with test failures where e.g. `busted` itself might
crash or get killed.

Ref: https://github.com/neovim/neovim/issues/10182#issuecomment-514450069
2019-07-24 18:12:55 +02:00
Jan Edmund Lazo
06547cdfc0 sign: REMOVE FEAT_SIGN_ICONS, dead code #10595 2019-07-24 12:17:53 +02:00
Daniel Hahler
451f6046b0
tests: AppVeyor: fix test/functional/ex_cmds/arg_spec.lua (#10598)
For unknown reasons it does not have the trailing space in `:args`
output there anymore:

    [  FAILED  ] test/functional\ex_cmds\arg_spec.lua @ 11: :argument does not restart :terminal buffer
    test/functional\ex_cmds\arg_spec.lua:25: Expected objects to be the same.
    Passed in:
    (string) '
    [term://.//4552:C:\Windows\system32\cmd.exe]'
    Expected:
    (string) '
    [term://.//4552:C:\Windows\system32\cmd.exe] '
    stack traceback:
            test/functional\ex_cmds\arg_spec.lua:25: in function <test/functional\ex_cmds\arg_spec.lua:11>

The test is not about that though, and this can be made less strict by
using `trim()`.  The new test in `test_arglist.vim` for no trailing
newline is OK, and contains trailing spaces.  So this is likely due to
the length of it exceeding the column width already.
2019-07-24 09:31:46 +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
Daniel Hahler
8fc93241d6
tests: fix/improve Screen:expect_unchanged (#10577)
Do not sleep before collecting initial state.

Ref: https://github.com/neovim/neovim/pull/10550#issuecomment-513670205
2019-07-24 02:50:24 +02:00
Daniel Hahler
b59a1f7b52
ci: restore accidentally removed config (#10592) 2019-07-24 02:16:09 +02:00
Daniel Hahler
f08d10a0df
tests: re-enable "tab drag in tabline to the left moves tab left" (#10588)
Ref: https://github.com/neovim/neovim/pull/4874
2019-07-24 02:12:19 +02:00
Justin M. Keyes
5cccfa7c5a
Merge #10558 from erw7/fix-text-overrides-line-number2
Windows: Fix text overrides line number
2019-07-23 19:20:07 +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
Daniel Hahler
4aabe4a0d5
build: GetBinaryDeps: move include, fix doc (#10579) 2019-07-22 20:50:30 +02:00
Daniel Hahler
d7274f2417
shell-test: fix REP for count larger than uint8_t (#10581) 2019-07-22 20:49:45 +02:00
Ihor Antonov
324dc0dbc0 PVS/V1019: "readability" warning #10566 2019-07-22 19:45:59 +02:00
Daniel Hahler
1e2af5e39d
tests: make TERM=interix test pending (#10576)
Ref: https://github.com/neovim/neovim/issues/10179
Ref: https://github.com/neovim/neovim/pull/9494
2019-07-22 18:49:37 +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
Daniel Hahler
f8684bf6b9 build: remove -Wno-array-bounds workaround #10484
Might not be necessary anymore, at least it is fine on gcc 9.1, and
since the bug is still open/unresolved, something else might have fixed
it.

Ref: 4b81f627c
Ref: #7083
2019-07-22 12:22:53 +02:00
Daniel Hahler
66149ecffe
test/helpers: improve pattern with module functions (#10421)
Benefits:

- less lines, especially less results when grepping
- makes it clearer what is exported
2019-07-22 01:13:11 +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
27fb8933f5
Merge #10561 from justinmk/os_can_exe
jobstart(), system(): use $PATHEXT-resolved exe
2019-07-21 22:58:39 +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
Justin M. Keyes
9d0f8224c9
Merge #10555 from janlazo/vim-8.1.1720
vim-patch:8.1.{856,1720}
2019-07-21 14:40:32 +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
Justin M. Keyes
b764120ee7
test: shell-test.c: "REP" command: flush, wait 1ms #10552
Typically most shell output is the result of non-trivial work, so it
would not blast stdout instantaneously.  To more closely simulate that
typical scenario, change `shell-test REP` to wait 1 millisecond between
iterations.
2019-07-20 18:07:04 +02:00
Justin M. Keyes
02e7ef4978
Merge #10550 'screen.lua: expect_unchanged()' 2019-07-20 15:49:49 +02:00
Justin M. Keyes
d19d9e4d9e screen.lua: always print keyword-args snapshot 2019-07-20 14:25:07 +02:00
Justin M. Keyes
6b45e12d67 screen.lua: expect_unchanged(), get_snapshot()
Factor `get_snapshot()` out of `print_snapshot()`, so that callers can
get a table (for use with `expect()`) instead of the string form.

Try to use this to fix indeterminism in `searchhl_spec.lua`.
  - Since the screen state is collected by `screen:expect_unchanged()`,
    we don't need a deterministic initial state (which would then be
    hardcoded into the test). This allows us to check "did anything
    change in the last N ms?" rather than "did anything change compared
    to a hardcoded screen-state?"
  - This may end up fruitless, because `expect_unchanged()` depends on
    timing to wait for an initial "current state".
2019-07-20 14:25:07 +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
Justin M. Keyes
643ba06d4d
test: shell-test.c: flush stdout for REP #10548
fix #10534
2019-07-20 12:52:33 +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
Justin M. Keyes
1745e59ac1
Merge #10543 'PVS/V560' 2019-07-19 19:39:46 +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
erw7
6614543316 test: Force $TEST_FILE to relative path [ci skip] #10535
- Always force TEST_PATH to a relative path.
- Eliminate rel_test_path. (The code simplification is worth the extra
  subdirectory below Xtest_tmpdir/.)
2019-07-19 13:51:18 +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