Commit Graph

9049 Commits

Author SHA1 Message Date
Nikolai Aleksandrovich Pavlov
bf1b1ea6ee lua/executor: Fix crash when printing empty string (#7157) 2017-08-13 17:37:35 +02:00
Sebastian Parborg
1f9c139fd3 tui: fix DECSCUSR logic #6997
Fix linuxvt cursor shape codes
Fix konsole cursor_shapes (even when inside tmux)
Do not trust old VTE terminal lies

Closes #6978
Closes #7002
Closes #7049
2017-08-13 01:13:28 +02:00
Justin M. Keyes
d42547f322 Merge #7088 from justinmk/vimpatches 2017-08-12 21:44:12 +02:00
Justin M. Keyes
c87dbadc44 vim-patch:8.0.0235
Problem:    Memory leak detected when running tests for diff mode.
Solution:   Free p_extra_free.

b031c4ea04
2017-08-12 18:28:38 +02:00
Justin M. Keyes
7dc5e8fb8b oldtest: cannot :set term in Nvim 2017-08-12 17:39:07 +02:00
Justin M. Keyes
a0c7e35eee vim-patch:8.0.0524
Problem:    Folds are messed up when 'encodin' is "utf-8".
Solution:   Also set the fold character when it's not multi-byte.

8da1e6cedf
2017-08-12 17:39:07 +02:00
Justin M. Keyes
cddd4e613e vim-patch:8.0.0518
Closes #7086

Problem:    Storing a zero byte from a multi-byte character causes fold text
            to show up wrong.
Solution:   Avoid putting zero in ScreenLines. (Christian Brabandt,
            closes vim/vim#1567)

c6cd8409c2
2017-08-12 17:39:07 +02:00
Justin M. Keyes
49b671f8f1 vim-patch:8.0.0290 vim-patch:8.0.0394
vim-patch:8.0.0290: cursor positioning wrong if wide character wraps
Problem:    If a wide character doesn't fit at the end of the screen line, and
            the line doesn't fit on the screen, then the cursor position may
            be wrong. (anliting)
Solution:   Don't skip over wide character. (Christian Brabandt, closes vim/1408)

vim-patch:8.0.0394
Problem:    Tabs are not aligned when scrolling horizontally and a Tab doesn't
            fit. (Axel Bender)
Solution:   Handle a Tab as a not fitting character. (Christian Brabandt)
            Also fix that ":redraw" does not scroll horizontally to show the
            cursor.  And fix the test that depended on the old behavior.

abc39ab642
2017-08-12 17:39:07 +02:00
Justin M. Keyes
c747b53f84 vim-patch:8.0.0311
Problem:    Linebreak tests are old style.
Solution:   Turn the tests into new style. Share utility functions. (Ozaki
            Kiichi, closes vim/vim#1444)

544d3bc9f0
2017-08-12 17:39:06 +02:00
Justin M. Keyes
b7320471de vim-patch:8.0.0128
Problem:    Display test fails on MS-Windows.
Solution:   Set 'isprint' to "@".

7089237885
2017-08-12 17:39:06 +02:00
Justin M. Keyes
1bcb3ed0e2 vim-patch:8.0.0126
Problem:    Display problem with 'foldcolumn' and a wide character.
            (esiegerman)
Solution:   Don't use "extra" but an allocated buffer. (Christian Brabandt,
            closes vim/vim#1310)

6270660611
2017-08-12 17:39:06 +02:00
Justin M. Keyes
df02f9cc37 vim-patch:8.0.0090 fix breakindent bug
(original Vim commit-message is bogus)

6c896867c4
2017-08-12 17:39:06 +02:00
James McCoy
f2fd5afb48 Merge pull request #7150 from jamessan/cid-166184
coverity/166184: Check length of str, not term
2017-08-11 12:24:45 -04:00
James McCoy
9edf00bddf coverity/166184: Check length of str, not term
32396b5879 add length checks to
TERMINAL_FAMILY/STARTS_WITH to ensure memcmp() wouldn't read past the
end of the string.  However, "term" was copy/pasted from TERMINAL_FAMILY
so STARTS_WITH() was unnecessarily reading the, potentially NULL, term
variable.
2017-08-11 10:30:38 -04:00
James McCoy
320b57311f Merge pull request #7143 from jamessan/log_callstack_to_file
log: Add log_callstack_to_file()
2017-08-11 10:02:51 -04:00
KunMing Xie
b7e84de7d2 vim-patch:8.0.0165 (#7132)
Problem:    Ubsan warns for integer overflow.
Solution:   Swap two conditions. (Dominique Pelle)

f446b48ff0
2017-08-10 04:20:55 +02:00
Justin M. Keyes
de1084f3c4 Merge #7140 'os_stat: return ENOENT on NULL fname' 2017-08-10 03:59:43 +02:00
Justin M. Keyes
7ae744b93d buf_write(): handle NULL fname on non-unix 2017-08-10 03:43:38 +02:00
James McCoy
ac055d677a os_stat: return ENOENT on NULL filename arg
Closes #4370

Explication:

    In the backtrace in #4370, we see that `buf_write()` was called with
    non-NULL `fname` and `sfname` arguments, but they've since _become_
    NULL.

    #7  0x00000000004de09d in buf_write (buf=0x1dee040, fname=0x0, fname@entry=0x1e985b0 "/home/sean/src/github.com/snczl/virta/pkg/meld/segment.go",
                                         sfname=0x0, sfname@entry=0x1ddfa60 "segment.go", start=1, end=72, eap=eap@entry=0x7ffc6b032e60, append=0,
                                         forceit=0, reset_changed=1, filtering=0)
    at /home/travis/build/neovim/bot-ci/build/neovim/src/nvim/fileio.c:2576

    This is most likely due to the code that restores those values from
    `buf`, which happens just before the fatal call to `os_fileinfo`

    ```c
        /*
         * The autocommands may have changed the name of the buffer, which may
         * be kept in fname, ffname and sfname.
         */
        if (buf_ffname)
          ffname = buf->b_ffname;
        if (buf_sfname)
          sfname = buf->b_sfname;
        if (buf_fname_f)
          fname = buf->b_ffname;
        if (buf_fname_s)
          fname = buf->b_sfname;
    ```

    It's worth noting that at this point `ffname` is still non-NULL, so
    it _could_ be used.  However, our current code is purely more strict
    than Vim in this area, which has caused us problems before (e.g.,
    `getdigits()`).  The commentary for `struct file_buffer` clearly
    indicate that all of `b_ffname`, `b_sfname`, and `b_fname` may be
    NULL:

    ```c
      /*
       * b_ffname has the full path of the file (NULL for no name).
       * b_sfname is the name as the user typed it (or NULL).
       * b_fname is the same as b_sfname, unless ":cd" has been done,
       *		then it is the same as b_ffname (NULL for no name).
       */
      char_u      *b_ffname;        /* full path file name */
      char_u      *b_sfname;        /* short file name */
      char_u      *b_fname;         /* current file name */
    ```

    Vim directly calls `stat(2)` which, although it is annotated to tell
    the compiler that the path argument is non-NULL, does handle a NULL
    pointer by returning a `-1` value and setting `errno` to `EFAULT`.
    This satisfies Vim's check, since it treats any `-1` return from
    `stat(2)` to mean the file doesn't exist (at least in this code
    path).

    Note that Vim's mch_stat() implementations on win32 and solaris
    clearly cannot accept NULL `name`. But the codepaths that call
    mch_stat will NULL `name` tend to be unix-only (eg: u_read_undo)!
2017-08-10 00:56:07 +02:00
Justin M. Keyes
085102fadf Merge #7134 from justinmk/oldtest-tmpdir 2017-08-09 23:36:48 +02:00
James McCoy
dac216cf8e Merge pull request #7135 from justinmk/buf_write
buf_write(): wrong argument to os_fileinfo_hardlinks()
2017-08-09 16:40:12 -04:00
James McCoy
17eb20b22e log: Add log_callstack_to_file()
This makes it trivial to log the callstack to, e.g., stderr, which can
simplify debug cycles.
2017-08-09 13:30:34 -04:00
James McCoy
f7e99fd8b0 oldtest: test_cmdline: Complete "Xtestf" so "Xtest-tmpdir" isn't matched 2017-08-09 11:02:35 -04:00
Justin M. Keyes
9854fc4657 oldtest: use TMPDIR 2017-08-09 11:02:15 -04:00
Justin M. Keyes
9506ee0370 buf_write(): wrong argument to os_fileinfo_hardlinks
This was broken in ye olde refactor from 2014:
e85fe0957d

References #4370
2017-08-09 10:45:17 +02:00
KunMing Xie
e13b4a21ca vim-patch:8.0.0149 (#7127)
Problem:    ":earlier" and ":later" do not work after startup or reading the
            undo file.
Solution:   Use absolute time stamps instead of relative to the Vim start
            time. (Christian Brabandt, Pavel Juhas, closes vim/vim#1300, closes
            vim/vim#1254)

cbd4de44e8
2017-08-08 03:32:47 +02:00
KunMing Xie
2753d61e4c vim-patch:8.0.0111 (#7090)
Problem:    The :history command is not tested.
Solution:   Add tests. (Dominique Pelle)

eebd84eb94
2017-08-06 23:42:52 +02:00
ckelsel
120d1b80c9 vim-patch:8.0.0147 #7121
Problem:    searchpair() does not work when 'magic' is off. (Chris Paul)
Solution:   Add \m in the pattern. (Christian Brabandt, closes vim/vim#1341)

6e450a5754
2017-08-06 23:25:49 +02:00
KunMing Xie
644fa6537c vim-patch:8.0.0143 (#7120)
Problem:    Line number of current buffer in getbufinfo() is wrong.
Solution:   For the current buffer use the current line number. (Ken Takata)

f845b87f2b
2017-08-06 23:04:50 +02:00
KunMing Xie
d1f0b5aa5d vim-patch:8.0.0137 (#7119)
Problem:    When 'maxfuncdepth' is set above 200 the nesting is limited to
            200. (Brett Stahlman)
Solution:   Allow for Ex command recursion depending on 'maxfuncdepth'.

777b30f827
2017-08-06 23:03:08 +02:00
lonerover
36ceb9397c vim-patch:8.0.0086 (#7118)
Problem:    Cannot add a comment after ":hide". (Norio Takagi)
Solution:   Make it work, add a test. (Hirohito Higashi)

2256c99471
2017-08-06 23:00:19 +02:00
Justin M. Keyes
5bec94652c Merge #7110 from justinmk/preserve-wildmenu 2017-08-06 04:25:55 +02:00
Justin M. Keyes
3827d5bc71 input: skip dialogs if no UI is active
Treat dialogs in the same way as "silent mode" (`nvim -es`).

References #1984
References #3901
2017-08-06 04:22:45 +02:00
Justin M. Keyes
d801ce70c1 win_defs.h: redefine RGB macro after undefining
Before this change, if os_defs.h was included after macros.h then
win_defs.h would undefine our own RGB macro.

vim-patch:8.0.0146
2017-08-06 02:51:49 +02:00
Justin M. Keyes
50c8f19d61 build: silence maybe-uninitialized warning
False positive. From C:\msys64\mingw64\bin\gcc.exe (appveyor CI)
2017-08-06 02:51:49 +02:00
Justin M. Keyes
30996359ef clint: allow starting brace after enum 2017-08-06 02:51:49 +02:00
Justin M. Keyes
efb0aca0ee test/helpers: disable powershell logo/banner message 2017-08-06 02:51:48 +02:00
Justin M. Keyes
a31482db4d terminal: block redraw during c_CTRL-D
Unlike the normal wildmenu, the CTRL-D wild-list is not restored by
statusline redraw. (Semantics: ^D is controlled by 'wildoptions' option,
so it's in the "wild..." family.)

TODO: externalize the c_CTRL-D wild-list.
2017-08-05 21:32:34 +02:00
Justin M. Keyes
c695443727 win_redr_status(): skip if wildmenu is showing
This might be too coarse, but it passes all tests ...

A more nuanced approach might be: only skip the windows whose
statuslines are overwritten by the wildmenu.

Closes #2255
Closes #7108

vim-patch:8.0.0710 N/A because of the changes in this commit.
2017-08-05 21:32:34 +02:00
KunMing Xie
55c0401dfd vim-patch:8.0.0134 (#7109)
Problem:    Null pointer access reported by UBsan.
Solution:   Check curwin->w_buffer is not NULL. (Yegappan Lakshmanan)

c4bfedabe0

src/nvim/ex_cmds.c have been merged by someone. while version.c remain unmerged.
2017-08-05 04:17:30 +02:00
Justin M. Keyes
37dd5ded7c Merge #7111 from justinmk/unrevert
Unrevert 	vim-patch:8.0.0133
2017-08-05 00:17:59 +02:00
Justin M. Keyes
678e87b90a test/oldtest: avoid delete() on files used by a subprocess
This should avoid the hangs observed in the TSAN build on travis CI.

TODO: Find the root cause ...
2017-08-04 22:48:26 +02:00
Justin M. Keyes
92101947fe test: job_spec.lua: disable shada in test instance 2017-08-04 22:25:39 +02:00
KunMing Xie
348229b1d3 vim-patch:8.0.0133 (#7107)
Problem:    "2;'(" causes ml_get errors in an empty buffer.  (Dominique Pelle)
Solution:   Check the cursor line earlier.

fe38b494ff
2017-08-04 22:25:39 +02:00
James McCoy
36a91c790e Merge pull request #7116 from lonerover/vim-8.0.0081
vim-patch:8.0.0081
2017-08-04 10:32:47 -04:00
lonerover
0c3f4f3921 fix lint error 2017-08-04 21:47:40 +08:00
lonerover
99aeb607f4 vim-patch:8.0.0081
Problem:    Inconsistent function names.
Solution:   Rename do_cscope to ex_cscope.  Clean up comments.

d4db7719bd
2017-08-04 20:36:36 +08:00
Justin M. Keyes
5cc4ea38c0 Merge #7105 from justinmk/doc-tui 2017-08-03 10:13:43 +02:00
Justin M. Keyes
8160a0e042 Revert "vim-patch:8.0.0133 (#7107)"
This reverts commit eb40b7ec40.

The change caused this error on QuickBuild:

    INFO  - # test/functional/core/job_spec.lua @ 668: pty process teardown does not prevent/delay exit. #4798 #4900
    INFO  - not ok 321 - pty process teardown does not prevent/delay exit. #4798 #4900
    INFO  - # test/functional/core/job_spec.lua @ 668
    INFO  - # Failure message: ./test/functional/ui/screen.lua:302: Row 1 did not match.
    INFO  - # Expected:
    INFO  - # |* |
    INFO  - # |[Process exited 0] |
    INFO  - # | |
    INFO  - # | |
    INFO  - # | |
    INFO  - # |-- TERMINAL -- |
    INFO  - # Actual:
    INFO  - # |*E575: Error while reading ShaD|
    INFO  - # |a file: mark entry at position|
    INFO  - # | 92 has invalid line number |
    INFO  - # |Press ENTER or type command to|
    INFO  - # | continue |
    INFO  - # |-- TERMINAL -- |
    INFO  - #
    INFO  - # To print the expect() call that would assert the current screen state, use
    INFO  - # screen:snaphot_util(). In case of non-deterministic failures, use
    INFO  - # screen:redraw_debug() to show all intermediate screen states.
    INFO  - # stack traceback:
    INFO  - #     ./test/functional/ui/screen.lua:302: in function 'wait'
    INFO  - #     ./test/functional/ui/screen.lua:216: in function 'expect'
    INFO  - #     test/functional/core/job_spec.lua:677: in function <test/functional/core/job_spec.lua:668>
2017-08-03 09:31:05 +02:00
Justin M. Keyes
29f44aab5a doc: Remove/relocate win32 notes. 2017-08-03 00:29:51 +02:00