Commit Graph

2814 Commits

Author SHA1 Message Date
Jan Edmund Lazo
a5b915e56c
test: win: enable output_spec test 2019-08-18 21:40:26 -04:00
Björn Linse
628f8f3dfd ui: transmit "blend=" property of highlight attributes 2019-08-18 13:52:32 +02:00
Björn Linse
6b2d67eb59 test/ui: properly test win_hide by explicitly marking hidden grids 2019-08-17 21:46:11 +02:00
Björn Linse
3397b8c51a ui: use Window type in win_pos consistently with win_float_pos
Also check invalid positional arguments to screen:expect()
2019-08-17 20:52:08 +02:00
Björn Linse
6fe2d24cef keymap: allow modifiers to multibyte chars, like <m-ä> 2019-08-16 19:54:34 +02:00
erw7
85edb33fd1 Change to output status on failure 2019-08-16 13:37:44 +09:00
erw7
e82fc20f23 windows: ok(#children >= 3 and #chidlen <= 5)
Depending on the version of Windows, conhost.exe may not be included in
the child process.
2019-08-16 13:34:53 +09:00
Daniel Hahler
ae60172106 windows: ok(#children >= 4 and #children <= 5) 2019-08-16 13:24:44 +09:00
Daniel Hahler
fc60d92795
tests: skip "API nvim_parse_expression" on MSVC_32 (#10773)
Only "API nvim_parse_expression works with &opt" is flaky, but easier to
skip all of "API nvim_parse_expression".

Ref: https://github.com/neovim/neovim/issues/10241
2019-08-14 23:57:45 +02:00
Björn Linse
7d92c391a1
Merge pull request #10774 from bfredl/miminal_fdc
api: nvim_win_open() style="minimal" should disable 'foldcolumn'
2019-08-14 23:54:08 +02:00
Björn Linse
48b43352b0 pyxversion: fix logic error #10759
Do not incorrectly prefer python2 if python3 is working.
fixes #10758
2019-08-14 22:36:43 +02:00
Björn Linse
f9f238b21a api: nvim_win_open() style="minimal" should disable 'foldcolumn' 2019-08-14 14:49:27 +02:00
Daniel Hahler
8fda095b6d tests: fix/improve "jobwait returns -1 when timed out" #10767
There was a longer timeout for Windows already, but unlike stated in
51d42917f it is not a worst-case, but gets waited for always.

The test is only about "-1" on timeout, so reduce it to this.

Fixes:

    16:33:19,309 INFO  - not ok 627 - jobs jobwait with timeout argument will return -1 if the wait timed out
    16:33:19,309 INFO  - # test/functional/core/job_spec.lua @ 707
    16:33:19,309 INFO  - # Failure message: test/functional/core/job_spec.lua:714: Expected objects to be the same.
    16:33:19,309 INFO  - # Passed in:
    16:33:19,309 INFO  - # (table: 0x0db1a3f0) {
    16:33:19,309 INFO  - #   [1] = 'notification'
    16:33:19,309 INFO  - #   [2] = 'wait'
    16:33:19,309 INFO  - #  *[3] = {
    16:33:19,309 INFO  - #    *[1] = {
    16:33:19,309 INFO  - #      *[1] = -1
    16:33:19,309 INFO  - #       [2] = -1 } } }
    16:33:19,309 INFO  - # Expected:
    16:33:19,309 INFO  - # (table: 0x0db1a480) {
    16:33:19,309 INFO  - #   [1] = 'notification'
    16:33:19,309 INFO  - #   [2] = 'wait'
    16:33:19,309 INFO  - #  *[3] = {
    16:33:19,309 INFO  - #    *[1] = {
    16:33:19,309 INFO  - #      *[1] = 4
    16:33:19,309 INFO  - #       [2] = -1 } } }
    16:33:19,309 INFO  - # stack traceback:
    16:33:19,309 INFO  - # 	test/functional/core/job_spec.lua:714: in function <test/functional/core/job_spec.lua:707>
2019-08-14 09:08:25 +02:00
Daniel Hahler
f2377e3575
tests: use larger timeout with "timers can be stopped from the handler" (#10760)
Seen on quickbuild:

    23:01:01,289 INFO  - not ok 1172 - timers can be stopped from the handler
    23:01:01,289 INFO  - # test/functional/eval/timer_spec.lua @ 154
    23:01:01,289 INFO  - # Failure message: test/functional/eval/timer_spec.lua:166: Expected objects to be the same.
    23:01:01,289 INFO  - # Passed in:
    23:01:01,289 INFO  - # (number) 3
    23:01:01,289 INFO  - # Expected:
    23:01:01,289 INFO  - # (number) 0
    23:01:01,289 INFO  - # stack traceback:
    23:01:01,289 INFO  - # 	test/functional/eval/timer_spec.lua:166: in function <test/functional/eval/timer_spec.lua:154>

Log: http://neovim-qb.szakmeister.net/build/24288
Ref: https://github.com/neovim/neovim/pull/10364
2019-08-14 00:44:32 +02:00
Ghjuvan Lacambre
2037028b50 ex_getln.c: fix compute_cmdrow() not resetting lines_left (#10749)
Before this commit, when `inccomand` was set to `nosplit`, multi-line
substitutions collapsed the command-line.

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

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

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

Closes #8254.
2019-08-12 14:21:15 +02:00
Justin M. Keyes
ad4eb18e43 Merge #10098 'win: fix msg_puts_printf()' 2019-08-12 02:42:13 +02:00
Björn Linse
67664c74f8 api/window: disallow closing non-current window in cmdwin state 2019-08-10 17:41:31 +02:00
R. Simon
5f243fc68a API: nvim_win_close: Fix closing cmdline-window #10087 2019-08-10 13:41:35 +02:00
Justin M. Keyes
278c5d452c
win/os_env_exists(): workaround libuv bug #10734
os_env_exists() fails on MSVC build:
    os_env_exists:104: uv_os_getenv(EMPTY_VAR) failed: -4094 UNKNOWN

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

ref 396a3945c4 (r34642361)
2019-08-10 11:48:36 +02:00
Justin M. Keyes
0062c65ba8 test/cmdline_spec: adjust "no-op"
(<Cmd>0<cr> is not really a no-op, it moves the cursor.)

Attempt to avoid flaky test:

    test/functional/ui/cmdline_spec.lua @ 830
    Failure message: ./test/functional/ui/screen.lua:579: Row 2 did not match.
    Expected:
    |                         |
    |*{1:~                        }|
    |{3:                         }|
    |:012345678901234567890123|
    |456789^                   |
    Actual:
    |                         |
    |*{3:                         }|
    |:012345678901234567890123|
    |:012345678901234567890123|
    |456789^                   |

    ./test/functional/ui/screen.lua:579: in function '_wait'
    ./test/functional/ui/screen.lua:367: in function 'expect'
    test/functional/ui/cmdline_spec.lua:841: in function <test/functional/ui/cmdline_spec.lua:830>

ref https://github.com/neovim/neovim/pull/10171#issuecomment-520134344
ref #10171
2019-08-10 11:46:26 +02:00
Justin M. Keyes
396a3945c4 test/environ_spec: Windows treats empty as undefined
ref #10657
2019-08-10 01:43:37 +02:00
Daniel Hahler
06d9cc734b exists(): return false for empty env var #10657
Fixes https://github.com/neovim/neovim/issues/3266
close #10657
2019-08-09 23:42:03 +02:00
Daniel Hahler
939d9053bd
channels: reflect exit due to signals in exit status code (#10573)
Uses `128 + term_signal` in case of exit due to a signal.

Fixes https://github.com/neovim/neovim/issues/10571.
2019-08-09 15:34:06 +02:00
Daniel Hahler
fa0c677a63
tests/functional: expect_msg_seq: use load_adjust (#10727)
Regardless of the comment "Big timeout for ASAN/valgrind" it would use
10s by default already.
This changes it to use `load_adjust`, which itself is only computed on
CI now, and outside of any tests - since it has side effects when being
used the first time!

The failure seen on AppVeyor:

    [ RUN      ] jobs can get the pid value using getpid: ERR
    test\functional\helpers.lua:167:
    ==============================================================================
    got 0 messages (ignored 0), expected 1
    stack traceback:
            test\functional\helpers.lua:167: in function 'expect_msg_seq'
            test/functional\core\job_spec.lua:288: in function <test/functional\core\job_spec.lua:281>

Log: https://ci.appveyor.com/project/neovim/neovim/builds/26537324/job/y1io66fbx399q7h6?fullLog=true#L6554
2019-08-09 15:32:38 +02:00
Justin M. Keyes
4bb728dfa0
test: Minimize shada/helpers.lua #10728 2019-08-09 10:23:57 +02:00
Björn Linse
1f54f68732 lua: minimal UTF-16 support needed for LSP 2019-08-08 20:10:14 +02:00
Daniel Hahler
e4bd31dbac
tests: use module pattern with test/functional/helpers.lua (#10724) 2019-08-08 16:03:25 +02:00
Daniel Hahler
38a3af5dff
tests: output_spec: use shell-test REP_NODELAY (#10726)
Fix flaky "shell command :! throttles shell-command output greater than ~10KB:":

    [ RUN      ] shell command :! throttles shell-command output greater than ~10KB:
    warning: Screen changes were received after the expected state. This indicates
    indeterminism in the test. Try adding screen:expect(...) (or wait()) between
    asynchronous (feed(), nvim_input()) and synchronous API calls.
      - Use screen:redraw_debug() to investigate; it may find relevant intermediate
        states that should be added to the test to make it more robust.
      - If the purpose of the test is to assert state after some user input sent
        with feed(), adding screen:expect() before the feed() will help to ensure
        the input is sent when Nvim is in a predictable state. This is preferable
        to wait(), for being closer to real user interaction.
      - wait() can trigger redraws and consequently generate more indeterminism.
        Try removing wait().

    ERR
    test/functional/ui/screen.lua:579: Failed to match any screen lines.
    Expected (anywhere): "
    %."
    Actual:
      |XXXXXXXXXX 591                                    |
      |XXXXXXXXXX 592                                    |
      |XXXXXXXXXX 593                                    |
      |XXXXXXXXXX 594                                    |
      |                                                  |
      |                                                  |
      |{3:-- TERMINAL --}                                    |
    stack traceback:
            test/functional/ui/screen.lua:579: in function '_wait'
            test/functional/ui/screen.lua:367: in function 'expect'
            test/functional/ui/output_spec.lua:63: in function <test/functional/ui/output_spec.lua:53>

Log: https://travis-ci.org/neovim/neovim/jobs/569082705#L5355
(gcc-functionaltest-lua)
2019-08-08 16:02:28 +02:00
Daniel Hahler
1d6e368159 Fix lualint: remove unused var 2019-08-07 14:20:23 +02:00
Daniel Hahler
4f148edd75 tests: more cleanup of plugin/shada_spec
Ref: https://github.com/neovim/neovim/pull/10701/commits/330a6713#r311005754
Closes https://github.com/neovim/neovim/pull/10710.
2019-08-07 12:47:21 +02:00
Björn Linse
6fb0020df4
Merge pull request #10513 from bfredl/bytecount
api/lua: add {byte_count} parameter to line region change event
2019-08-06 20:25:46 +02:00
Björn Linse
c0993ed343 lua: support getting UTF-32 and UTF-16 sizes of replaced text 2019-08-06 20:24:36 +02:00
Daniel Hahler
e85b4e749e
tests: unit.helpers: provide string with write errors (#10715)
This might help to have more information in case of errors, like
mentioned in https://github.com/neovim/neovim/commit/eec529cf9e.
2019-08-06 17:42:32 +02:00
Björn Linse
b0e26199ec lua: add {old_byte_size} to on_lines buffer change event 2019-08-06 17:01:47 +02:00
Justin M. Keyes
067a39ba85
Merge #10701 from justinmk/test-fixes
test: Eliminate plugin/helpers.lua
2019-08-06 01:36:01 +02:00
Daniel Hahler
d55b12ea50 f_environ: cleanup/refactor
- use os_getenvname_at_index / os_getenv
- f_getenv: empty (*p == NUL) is not null (undefined)
2019-08-06 01:23:11 +02:00
Justin M. Keyes
f6c9412436 test/mbyte_spec: skip broken test on QuickBuild
Forgot `return` in eec529cf9e.
2019-08-06 00:28:00 +02:00
Justin M. Keyes
330a6713bf test: Eliminate plugin/helpers.lua 2019-08-05 23:55:57 +02:00
Björn Linse
f5d1e0e7b1
Merge pull request #10690 from bfredl/lua_print
lua: laundry list (crashes and additions)
2019-08-05 13:59:40 +02:00
Björn Linse
88938634e7 lua: add vim.in_fast_event() to check if we are in a luv callback 2019-08-05 13:57:24 +02:00
Björn Linse
e6d77993d1 lua: do not crash on syntax error in debug.debug() 2019-08-05 13:19:44 +02:00
Björn Linse
d3a7bdefb0 lua: immediate-callback safe print() 2019-08-05 13:19:44 +02:00
Justin M. Keyes
d4a0b6c4e1 test/man_spec: remove plugin_helpers.reset()
The call to plugin_helpers.reset() is redundant with the clear() call
above it.  Probably just a copy-paste mistake.

Avoids exit_event race #8813.

Helped-by: Björn Linse <bjorn.linse@gmail.com>
2019-08-05 04:51:49 +02:00
Justin M. Keyes
eec529cf9e test/mbyte_spec: skip broken test on QuickBuild
14:13:04,119 INFO  - # ./test/unit/helpers.lua @ 760: mbyte utf_char2bytes for chars 0xa000 - 0xafff
    14:13:06,307 WARN  - E908: using an invalid value as a String
      /usr/home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/.deps/usr/bin/luajit:
      ./test/unit/helpers.lua:459: write() error: 32: Broken pipe
    14:13:06,308 WARN  - stack traceback:
    14:13:06,308 WARN  - 	[C]: in function 'throw'
    14:13:06,308 WARN  - 	...quests-automated/.deps/usr/share/lua/5.1/busted/core.lua:149: in function 'error'
    14:13:06,308 WARN  - 	...ts-automated/.deps/usr/share/lua/5.1/luassert/assert.lua:171: in function 'assert'
    14:13:06,308 WARN  - 	./test/unit/helpers.lua:459: in function 'write'
    14:13:06,308 WARN  - 	./test/unit/helpers.lua:626: in function 'hook'
    14:13:06,308 WARN  - 	./test/unit/helpers.lua:574: in function <./test/unit/helpers.lua:557>
    14:13:06,308 WARN  - 	[C]: in function 'type'
    14:13:06,308 WARN  - 	...d/.deps/usr/share/lua/5.1/busted/outputHandlers/base.lua:57: in function 'copyElement'
    14:13:06,308 WARN  - 	...d/.deps/usr/share/lua/5.1/busted/outputHandlers/base.lua:66: in function 'format'
    14:13:06,308 WARN  - 	...d/.deps/usr/share/lua/5.1/busted/outputHandlers/base.lua:172: in function 'fn'
    14:13:06,308 WARN  - 	...-requests-automated/.deps/usr/share/lua/5.1/mediator.lua:103: in function 'publish'
    14:13:06,308 WARN  - 	...quests-automated/.deps/usr/share/lua/5.1/busted/core.lua:201: in function 'safe'
    14:13:06,308 WARN  - 	...quests-automated/.deps/usr/share/lua/5.1/busted/core.lua:312: in function 'execute'
    14:13:06,308 WARN  - 	...sts-automated/.deps/usr/share/lua/5.1/busted/execute.lua:58: in function 'execute'
    14:13:06,308 WARN  - 	...ests-automated/.deps/usr/share/lua/5.1/busted/runner.lua:197: in function <...ests-automated/.deps/usr/share/lua/5.1/busted/runner.lua:11>
    14:13:06,308 WARN  - 	./.deps/usr/lib/luarocks/rocks/busted/2.0.0-1/bin/busted:3: in main chunk
    14:13:06,308 WARN  - 	[C]: at 0x004041a0
    14:13:06,323 WARN  - Terminated
    14:13:06,325 INFO  - Executing post-execute action...
    14:13:06,526 INFO  - Checking step execute condition...
    14:13:06,526 INFO  - Step execute condition satisfied, executing...
    14:13:06,706 INFO  - Executing pre-execute action...
    14:13:06,706 INFO  - Running step...
2019-08-05 04:19:36 +02:00
Justin M. Keyes
94afc201bc test: isCI(): add "name" parameter 2019-08-05 04:02:41 +02:00
Justin M. Keyes
c516586dc3 tests: fix flaky "TermClose … fast-exiting terminal job stops"
This extra retry() was removed (at my suggestion) in 5b94a2977a, but
it is probably needed: jobwait(…, timeout=0) could return while
channel_process_exit_cb() is still queued (so TermClose event didn't
fire yet).

    20:46:21,288 INFO  - not ok 547 - TermClose event triggers when fast-exiting terminal job stops
    20:46:21,288 INFO  - # test/functional/autocmd/termclose_spec.lua @ 20
    20:46:21,288 INFO  - # Failure message: ./test/functional/helpers.lua:98: Vim:E121: Undefined variable: g:test_termclose
    20:46:21,288 INFO  - # stack traceback:
    20:46:21,288 INFO  - # 	./test/functional/helpers.lua:98: in function 'eval'
    20:46:21,288 INFO  - # 	test/functional/autocmd/termclose_spec.lua:25: in function <test/functional/autocmd/termclose_spec.lua:20>
2019-08-05 03:52:17 +02:00
Justin M. Keyes
45c34bd84a
:doautocmd : Never show "No matching autocommands" #10689
The message is useless, it doesn't even mention the event name.

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

ref: https://github.com/vim/vim/issues/4300
2019-08-05 03:33:45 +02:00
Justin M. Keyes
2141dc2262 provider: check #Call() if g:loaded_xx_provider=2 2019-08-04 13:23:46 +02:00
Justin M. Keyes
5e6a08f2e6 provider: skip non-provider has() feature-names
We don't want to retry autoload sourcing (slow) for every random has()
query that finds it way to eval_call_provider().
2019-08-04 13:23:46 +02:00
Justin M. Keyes
241956720d provider: g:loaded_xx_provider=2 means "enabled and working"
Value of 1 cannot be used, because users might set that in their vimrc
to _disable_ a provider, which would confuse :checkhealth and has().
2019-08-04 13:23:46 +02:00