Commit Graph

14415 Commits

Author SHA1 Message Date
Daniel Hahler
ac6fd11fa1 only check got_int with ex_echo
Ref: https://github.com/neovim/neovim/pull/10926#discussion_r320706446
2019-09-04 13:30:11 +02:00
Daniel Hahler
4556bb90fa move test 2019-09-04 13:13:39 +02:00
Daniel Hahler
e867ac3e52 Check got_int in msg_multiline_attr
Fixes quitting the pager using `q`.

Fixes https://github.com/neovim/neovim/issues/10923.
2019-09-04 10:50:26 +02:00
Jan Edmund Lazo
1838f6ba76
vim-patch:8.1.0145: test with grep is failing on MS-Windows
Problem:    Test with grep is failing on MS-Windows.
Solution:   Skip the test.
851332ea9c
2019-09-04 02:45:57 -04:00
Jan Edmund Lazo
9d50d033bc
vim-patch:8.0.1844: superfluous quickfix code, missing examples
Problem:    Superfluous quickfix code, missing examples.
Solution:   Remove unneeded code.  Add a few examples.  Add a bit more
            testing. (Yegappan Lakshmanan, closes vim/vim#2916)
78ddc06bdd
2019-09-04 02:05:25 -04:00
erw7
d3f1eb3024 vim-patch:8.1.1946: memory error when profiling a function without a script ID
Problem:    Memory error when profiling a function without a script ID.
Solution:   Check for missing script ID.  (closes vim/vim#4877)
163588005d
2019-09-04 14:48:21 +09:00
Jan Edmund Lazo
7876f4f218
vim-patch:8.0.1752: qf_set_properties() is to long
Problem:    qf_set_properties() is to long.
Solution:   Refactor the function.  Define INVALID_QFIDX. (Yegappan
            Lakshmanan, closes vim/vim#2812)
a2aa8a2b22
2019-09-04 01:34:18 -04:00
erw7
9db60b06a1 vim-patch:8.1.0515: reloading a script gives errors for existing functions
Problem:    Reloading a script gives errors for existing functions.
Solution:   Allow redefining a function once when reloading a script.
ded5f1bed7
2019-09-04 13:40:05 +09:00
erw7
e4a4786241 vim-patch:8.1.0365: function profile doesn't specify where it was defined
Problem:    Function profile doesn't specify where it was defined.
Solution:   Show the script name and line number.
4c7b08f640
2019-09-04 13:40:05 +09:00
erw7
0e11a106c5 vim-patch:8.1.0309: profiling does not show a count for condition lines
Problem:    Profiling does not show a count for condition lines.  (Daniel
            Hahler)
Solution:   Count lines when not skipping. (Ozaki Kiichi, closes #2499)
7feb35e778
2019-09-04 13:40:05 +09:00
erw7
2926a36d91 [squash] Fix errors when porting 2019-09-04 13:40:05 +09:00
erw7
4f6df65f02 Change test because maparg was changed to also return lnum 2019-09-04 13:40:04 +09:00
erw7
a2e48b556b vim-patch:8.1.0362: cannot get the script line number when executing a function
Problem:    Cannot get the script line number when executing a function.
Solution:   Store the line number besides the script ID. (Ozaki Kiichi,
            closes vim/vim#3362)  Also display the line number with ":verbose set".
f29c1c6aa3
2019-09-04 13:40:04 +09:00
Justin M. Keyes
38806f23ed
test: enable "exit event follows stdout, stderr" [ci skip] #10929
- Update the test to work with changes since it was originally written.
- Keep the test pending() because it still fails:

      Expected objects to be the same.
      Passed in:
      (table: 0x50ce9e38) {
        [1] = {
          [1] = 'notification'
          [2] = 'stderr'
          [3] = {
            [1] = 0
            [2] = {
              [1] = '' } } }
       *[2] = {
          [1] = 'notification'
          [2] = 'stdout'
         *[3] = {
            [1] = 0
           *[2] = {
             *[1] = '' } } }
        [3] = {
          [1] = 'notification'
          [2] = 'exit'
          [3] = {
            [1] = 0
            [2] = 143 } } }
      Expected:
      (table: 0x50ce9870) {
        [1] = {
          [1] = 'notification'
          [2] = 'stderr'
          [3] = {
            [1] = 0
            [2] = {
              [1] = '' } } }
       *[2] = {
          [1] = 'notification'
          [2] = 'stdout'
         *[3] = {
            [1] = 0
           *[2] = {
             *[1] = 'abcdef' } } }
        [3] = {
          [1] = 'notification'
          [2] = 'stdout'
          [3] = {
            [1] = 0
            [2] = {
              [1] = '' } } } }
2019-09-03 10:25:27 -07:00
Abdelhakeem Osama
8b8ecf44f2 shada/context: fully remove jumplist duplicates #10898
- Always load files when cleaning up jumplist.
  - For Shada: avoids writing duplicate entries, which happens when you read
    from a shada file with duplicate entries (merging the jumplist while
    writing sometimes produces duplicate entries, bug?) and then write right
    away (i.e.: without any `:jumps`, `getjumplist()`, or any jump movement,
    that is: nothing that calls `cleanup_jumplist` with `loadfiles == true`).
  - For Context: avoids non-idempotent behavior for the same reason (i.e.:
    first call to `shada_encode_jumps` does not remove duplicate entries).

- Do not set pcmark when dumping jumplist for Context.
  - Retrieving current Context shouldn't add an entry to the jumplist
    (which will be removed by a subsequent `cleanup_jumplist` anyway, i.e.:
    tail entry matching current position), just act like `getjumplist` for
    instance.
2019-09-03 10:18:24 -07:00
Justin M. Keyes
b8f2436feb
Merge #10915 'jobwait(): fix race if job exits quickly' 2019-09-03 08:40:54 -07:00
Justin M. Keyes
6242bac904 f_jobwait: cleanup 2019-09-03 16:14:29 +02:00
Justin M. Keyes
58318af718 jobwait(): fix race if job exits before waiting on it
Problem:  If a job exits while waiting on another job, the on_exit
          handler is queued but f_jobwait() skips it.
Solution: Always do process_wait(), so that handlers are run during
          f_jobwait().

fix #8302

Test case:
    $ BUSTED_ARGS="--repeat=2000 --no-keep-going" TEST_FILE=test/functional/core/job_spec.lua TEST_FILTER=waiting make functionaltest

Failure example (macOS CI):
    FAILED  test/functional/core/job_spec.lua: jobs jobwait will run callbacks while waiting
    test/functional/core/job_spec.lua:606: Expected objects to be the same.
    Passed in:
    (table: 0x1be77c80) {
      [1] = 'notification'
      [2] = 'wait'
     *[3] = {
       *[1] = 3 } }
    Expected:
    (table: 0x1be77d10) {
      [1] = 'notification'
      [2] = 'wait'
     *[3] = {
       *[1] = 4 } }
    stack traceback:
      test/functional/core/job_spec.lua:606: in function <test/functional/core/job_spec.lua:583
2019-09-03 16:14:29 +02:00
Justin M. Keyes
a00eb23c27 test/wildmode_spec: fix flaky test
[  ERROR   ] test/functional\ui\wildmode_spec.lua @ 84: 'wildmenu' is preserved during :terminal activity
    test\functional\ui\screen.lua:587: Row 1 did not match.
    Expected:
      |*:sign                    |
      |*define    place          |
      |*jump      undefine       |
      |*list      unplace        |
      |*:sign ^                   |
    Actual:
      |*0: !terminal             |
      |*                         |
      |*^                         |
      |*~                        |
      |*                         |
    stack traceback:
        test\functional\ui\screen.lua:587: in function '_wait'
        test\functional\ui\screen.lua:370: in function 'expect'
        test/functional\ui\wildmode_spec.lua:22: in function 'expect_stay_unchanged'
        test/functional\ui\wildmode_spec.lua:103: in function <test/functional\ui\wildmode_spec.lua:84>
2019-09-03 16:14:29 +02:00
Justin M. Keyes
7233433f65 test/job_spec: improve visibility of flaky test
Test sometimes fails on macOS CI:

    FAILED  test/functional/core/job_spec.lua: jobs jobwait will run callbacks while waiting
    test/functional/core/job_spec.lua:606: Expected objects to be the same.
    Passed in:
    (table: 0x1be77c80) {
      [1] = 'notification'
      [2] = 'wait'
     *[3] = {
       *[1] = 3 } }
    Expected:
    (table: 0x1be77d10) {
      [1] = 'notification'
      [2] = 'wait'
     *[3] = {
       *[1] = 4 } }
    stack traceback:
      test/functional/core/job_spec.lua:606: in function <test/functional/core/job_spec.lua:583

Change the test to check if all jobs are starting, not only exiting.
2019-09-03 16:14:29 +02:00
Justin M. Keyes
03be64ce2a
Merge #10921 from janlazo/vim-8.0.1768
vim-patch:8.0.{1768,1806},8.1.{46,1063}
2019-09-03 04:49:30 -07:00
Daniel Hahler
dcc8fcf0b9 tests: assert:set_parameter('TableFormatLevel', 100) #10925
luassert uses 3 by default, which is often not enough.

Instead of documenting how to increase it, let's use a more fitting
(sane) default of 100 levels.
2019-09-03 04:29:49 -07:00
Daniel Hahler
d000f02bc0
vim-patch.sh: fix "unbound variable" error with Bash < 4.4 [ci skip] (#10917)
Ref: https://github.com/neovim/neovim/pull/10888#issuecomment-526774032
2019-09-03 10:12:02 +02:00
Jan Edmund Lazo
7199f0b3b3
vim-patch:8.1.1063: insufficient testing for wildmenu completion
Problem:    Insufficient testing for wildmenu completion.
Solution:   Extend the test case. (Dominique Pelle, closes vim/vim#4182)
37db642083
2019-09-03 00:07:23 -04:00
Jan Edmund Lazo
c0cb7585cc
vim-patch:8.1.0046: loading a session file fails if 'winheight' is big
Problem:    Loading a session file fails if 'winheight' is a big number.
Solution:   Set 'minwinheight' to zero at first.  Don't give an error when
            setting 'minwinheight' while 'winheight' is a big number.
            Fix using vertical splits. Fix setting 'minwinwidth'.
            (closes vim/vim#2970)
1c3c10492a
2019-09-02 19:54:06 -04:00
Jan Edmund Lazo
02f126a275
vim-patch:8.0.1806: InsertCharPre causes problems for autocomplete
Problem:    InsertCharPre causes problems for autocomplete. (Lifepillar)
Solution:   Check for InsertCharPre before calling vpeekc(). (Christian
            Brabandt, closes vim/vim#2876)
39de952577
2019-09-02 18:40:56 -04:00
Jan Edmund Lazo
07b209b1fe
vim-patch:8.0.1768: SET_NO_HLSEARCH() used in a wrong way
Problem:    SET_NO_HLSEARCH() used in a wrong way.
Solution:   Make it a function. (suggested by Dominique Pelle,
            closes vim/vim#2850)
451fc7b954
2019-09-02 18:40:56 -04:00
Björn Linse
6434a0bf99
Merge pull request #10920 from bfredl/asyncfail
api: make try_end clean-up after an exception properly.
2019-09-02 23:02:58 +02:00
Björn Linse
7e07efaff4 api: make try_end clean-up after an exception properly. Fixes #10809
Otherwise `force_abort` will cause an emsg() higher on the stack
to be converted to an exception, even though it is outside any
try/catch.
2019-09-02 23:01:16 +02:00
Justin M. Keyes
d3c17d50d8
Merge #10918 from janlazo/vim-8.0.1697
vim-patch:8.0.{1697,1729}
2019-09-02 11:28:12 -07:00
Jan Edmund Lazo
4a60818071
vim-patch:8.0.1729: no comma after last enum item
Problem:    No comma after last enum item.
Solution:   Add a few commas to check if this works for all compilers.  Also
            add a few // comments.
ea3ece405a
2019-09-02 12:19:10 -04:00
Jan Edmund Lazo
55c66d6c19
vim-patch:8.0.1697: various tests are still a bit flaky
Problem:    Various tests are still a bit flaky.
Solution:   Increase the default wait time to five seconds.
769e9d21ac
2019-09-02 12:00:33 -04:00
Björn Linse
cb339ca0fb
Merge pull request #10913 from bfredl/nomsgsep
screen: fixes for `set display-=msgsep`, fixes #10912
2019-09-02 13:32:25 +02:00
Björn Linse
66f4e8aee0 screen: initialize screen properly with early set display-=msgsep
Currently `nvim -u NORC --cmd "set display-=msgsep"` will still allocate the
message grid and remove it just afterwards. While inefficient, we must
make sure update_screen() re-validates the default_grid completely when
this happens.

Fix some invalid logic: don't reallocate msg_grid on resize when the grid is not
used.

Elide a too early ui_flush() on startup, which caused an invalid cursor
position to be used.
2019-09-02 12:39:03 +02:00
Justin M. Keyes
099445cc07
Merge #10804 'CI/OpenBSD: functional tests' 2019-09-01 22:56:41 -07:00
Jan Edmund Lazo
7bb029eeef vim-patch:8.0.0858: check if job terminal is running #10908
Problem:    Can exit while a terminal is still running a job.
Solution:   Consider a buffer with a running job like a changed file.
eb44a68b42
2019-09-01 22:54:49 -07:00
Justin M. Keyes
ead39d6ce6 test/uname(): always lowercase 2019-09-01 22:49:33 -07:00
Justin M. Keyes
7d20907724 test/OpenBSD: skip some tests
Temporary workaround to unblock CI for OpenBSD.
2019-09-01 22:49:33 -07:00
Justin M. Keyes
605f05f635 test: shell-test.c: flush all streams 2019-09-01 22:49:33 -07:00
Justin M. Keyes
78ec7981c8 screen.lua: dump payload on handler failure
For debugging failures like:

    test/functional/helpers.lua:240: test/functional/ui/screen.lua:898:
    bad argument #1 to 'unpack' (table expected, got number)

    test/functional/helpers.lua:240: test/functional/ui/screen.lua:708:
    attempt to index local 'item' (a number value)

ref #10804
2019-09-01 22:49:33 -07:00
Justin M. Keyes
c062149d5b test: "can have two timers": retry()
ref #10768
2019-09-01 22:49:33 -07:00
Edd Barrett
b64af88c84 CI/OpenBSD: run functional tests
Adapt some tests for OpenBSD:

- scrollback_spec:
  - seq(1) is not available on OpenBSD: we'd use jot(1).
  - Instead use a (hopefully) portable awk(1) snippet.
- channels_spec
- job_spec
- tui_spec
2019-09-01 22:49:33 -07:00
Justin M. Keyes
299331490e
API: nvim_buf_set_lines: handle 'nomodifiable' #10910 2019-09-01 22:04:20 -07:00
Jan Edmund Lazo
5f23a3dbcf vim-patch:8.0.1653: screen dump is made too soon (#10911)
Problem:    Screen dump is made too soon.
Solution:   Wait until the ruler is displayed. (Ozaki Kiichi, closes vim/vim#2755)
1834d37396
2019-09-02 06:24:34 +02:00
Justin M. Keyes
d1bed81ad8 PVS/V547: Expression is always false
ll_get_or_alloc_list() never fails because OOM is an abort condition.
2019-09-02 04:50:22 +02:00
Björn Linse
fb19aeeb33 API: make nvim_win_set_option() set window-global, not buffer-local #9110
NB: the `!(flags & SOPT_GLOBAL)` exception is for 'statusline'.
Because `:set statusline=...` sets the global value for _all_ windows,
`:setlocal` is the best we can do there. This is a one-of-a-kind option
that doesn't work like any other option.
2019-09-01 19:38:50 -07:00
Justin M. Keyes
b10d703213
Merge #10896 'paste: one undo-block' 2019-09-01 19:12:13 -07:00
Justin M. Keyes
8560bafc6c paste: redraw at end
Attempt to fix test failure since 976c6667e1 removed per-chunk redraw:

  ERROR test/functional/terminal/tui_spec.lua: TUI paste: cmdline-mode inserts 1 line
  test/functional/terminal/tui_spec.lua:367: in function <test/functional/terminal/tui_spec.lua:360
  Expected:
    |*foo                                               |
    |*                                                  |
    |{4:~                                                 }|
    |{4:~                                                 }|
    |{5:[No Name] [+]                                     }|
    |:"line 1{1:"}                                         |
    |{3:-- TERMINAL --}                                    |
  Actual:
    |*                                                  |
    |*{4:~                                                 }|
    |{4:~                                                 }|
    |{4:~                                                 }|
    |{5:[No Name] [+]                                     }|
    |:"line 1{1:"}                                         |
    |{3:-- TERMINAL --}                                    |
2019-09-02 03:34:01 +02:00
Justin M. Keyes
976c6667e1 paste: one undo-block per stream
- All "chunks" in a paste-stream should form a single undo-block. Side
  effect of 7a85792884 was to create an undo-block for each chunk.
- Also: remove old :redraw force logic, irrelevant after 7a85792884.
2019-09-02 02:27:13 +02:00
Jan Edmund Lazo
938be1e0ab vim-patch:8.0.1534: C syntax test fails in gvim #10909
Problem:    C syntax test fails when using gvim
Solution:   Force running in a terminal.  Check that 'background' is correct
            even when $COLORFGBG is set.
b7ea7cb8e4
2019-09-01 17:00:50 -07:00