Commit Graph

2326 Commits

Author SHA1 Message Date
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
Justin M. Keyes
36622014c6 Merge #10596 'vim-patch:8.1.{899,903,905,907,908,910,913,1746}'
close #9930
close #10051
2019-07-25 12:00:08 +02:00
Gabriel
33ce6a7f62 Checks for overflow when parsing string to int 2019-07-24 21:43:04 -04: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
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
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
Daniel Hahler
d7274f2417
shell-test: fix REP for count larger than uint8_t (#10581) 2019-07-22 20:49:45 +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
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
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
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
Justin M. Keyes
643ba06d4d
test: shell-test.c: flush stdout for REP #10548
fix #10534
2019-07-20 12:52:33 +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
Daniel Hahler
4fc91fe365
tests: fix "system() … prints verbose information" (#10532)
It would previously fail with `set shell=sh` (no slash).

For the test itself we can just use a non-existing (fake) shell, because
it is only about the verbose output.

Ref: https://github.com/neovim/neovim/issues/9330
2019-07-17 23:05:04 +02:00
Daniel Hahler
3a1d3e9ef1
tests: shell-test: use count for REP (#10514)
Also fix V576: use width specification

> Incorrect format. Consider checking the third actual argument of the
> 'sscanf' function. It's dangerous to use string specifier without width
> specification. Buffer overflow is possible.
2019-07-16 21:35:53 +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
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
Daniel Hahler
b06f29318d
Fix missing CursorHoldI events (#3758)
Fixes https://github.com/neovim/neovim/issues/3757.
2019-07-16 01:35:43 +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
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
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
Daniel Hahler
4731027447
tests: use vim.inspect (#10485)
The inspect modules is vendored as `vim.inspect`, and therefore it makes
sense to use this in tests also.

Ref: https://github.com/neovim/neovim/issues/6580
Ref: https://github.com/neovim/neovim/commit/bb3aa824b
2019-07-13 00:50:52 +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
Daniel Hahler
13fbeda0e5
Revert "tests: executable_spec: enable pending test #10443" (#10454)
This reverts commit b53c483a4a.
2019-07-09 11:46:23 +02:00
Björn Linse
42bdccdf6c
Merge pull request #10234 from bfredl/resizefloat
window: allow resize wincmds for floats
2019-07-08 19:50:43 +02:00
Björn Linse
d11a146516 window: allow resize wincmds for floats 2019-07-08 19:45:57 +02:00
Daniel Hahler
c07f266c5b
tests: ex_terminal_spec: add test for previous leak (#10450)
Closes https://github.com/neovim/neovim/pull/4766.
2019-07-08 18:42:52 +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
Daniel Hahler
b53c483a4a tests: executable_spec: enable pending test #10443
Should hopefully work now after efc6d9951b.
2019-07-07 13:05:52 +02: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
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
68c594b10c
tests: loop_spec: retry (#10413)
Flaky test (osx):

    [  FAILED  ] ...is/build/neovim/neovim/test/functional/lua/loop_spec.lua @ 23: vim.loop timer
    ...is/build/neovim/neovim/test/functional/lua/loop_spec.lua:56: Expected objects to be the same.
    Passed in:
    (number) 0
    Expected:
    (number) 2
    stack traceback:
            ...is/build/neovim/neovim/test/functional/lua/loop_spec.lua:56: in function <...is/build/neovim/neovim/test/functional/lua/loop_spec.lua:23>

It was bumped from sleeping for 20ms to 50ms in d33aaa0f5f already.
2019-07-04 16:42:10 +02:00
Daniel Hahler
05a17e419a
tests: fix flaky ':digraphs displays digraphs' (#10406) 2019-07-04 15:22:59 +02:00
Daniel Hahler
f6298aba82
tests: shell-test: add INTERACT mode (#10405)
Use it to improve ls_spec: it should not use the user's real shell for
performance and other reasons.
2019-07-03 22:49:13 +02:00
Daniel Hahler
0dc73b87f1
tests: executable_spec: keep assertion (#10408)
It was moved to become pending in 18127f64c, but the assertion should be
kept.
2019-07-03 12:56:03 +02:00
Daniel Hahler
e48257e63e
tests: fix/improve "TUI background color" tests (#10229)
- Ensure the opposite of the expected bg is active.
- Improves performance: 1.2s instead of 4.5s.
2019-07-03 03:37:19 +02:00
Daniel Hahler
5b94a2977a
tests: fix flaky "TermClose event triggers when fast-exiting terminal job stops" (#10377)
[  ERROR   ]...neovim/neovim/test/functional/autocmd/termclose_spec.lua @ TermClose event triggers when fast-exiting terminal job stops
    test/functional/helpers.lua:96: Vim(call):E900: Invalid channel id

    stack traceback:
            test/functional/helpers.lua:96: in function 'request'
            test/functional/helpers.lua:254: in function 'command'
            ...neovim/neovim/test/functional/autocmd/termclose_spec.lua:23: in function <...neovim/neovim/test/functional/autocmd/termclose_spec.lua:20>
2019-07-02 22:44:11 +02:00
Daniel Hahler
1c45ba462b
tests: fix flaky "terminal (with fake shell) with not arguments …" (#10401)
`retry()` would only try it three times (waiting for 20ms in between),
despite the large timeout.

Fixes https://github.com/neovim/neovim/issues/10265.
2019-07-02 19:31:36 +02:00