Commit Graph

7799 Commits

Author SHA1 Message Date
ZyX
ed3115bd26 executor: Make sure it works with API values 2017-03-27 00:11:25 +03:00
ZyX
a4dc8de073 *: Silence linter 2017-03-27 00:11:25 +03:00
ZyX
f551df17f3 viml/executor: Directly generate typval_T values
Note: this will *still* crash when using API in cases similar to the one
described in first commit. Just it needs different code to reproduce.
2017-03-27 00:11:24 +03:00
ZyX
e7bbd8256b eval: Add luaeval function
No tests yet, no documentation update, no :lua* stuff, no vim module.

converter.c should also work with typval_T, not Object.

Known problem: luaeval("1", {}) results in

    PANIC: unprotected error in call to Lua API (attempt to index a nil value)

Ref #3823
2017-03-27 00:11:24 +03:00
lonerover
f9a31e9850 vim-patch:7.4.2349 (#6368)
Problem:    Valgrind reports using uninitialzed memory. (Dominique Pelle)
Solution:   Check the length before checking for a NUL.

2321ca2a78
2017-03-26 19:04:57 +02:00
Yichao Zhou
43a99f77a8 highlight: :match should override 'list' (#6343)
Closes #4946
2017-03-26 13:04:20 +02:00
Justin M. Keyes
cf202b74db build: Do not ref libuv CMake target if USE_BUNDLED_LIBUV=OFF. (#6363)
CMake Warning: The dependency target "libuv" of target "luv-static" does
not exist. (CMP0046)

Closes #6355
2017-03-26 00:22:15 +01:00
Daniel Hahler
b60e5c85ad cmake: USE_BUNDLED_X instead of X_USE_BUNDLED (#6357) 2017-03-25 23:02:20 +01:00
Anmol Sethi
a346cb1d58 man.vim: call s:error in man#read_page (#6362)
The comment is incorrect, s:error does need to be called. I thought the
call was unnecessary because it didn't show any message for me but I had
shortmess+=F which was hiding the message.
2017-03-25 22:43:25 +01:00
Matthew Malcomson
098e91400e refactor: Remove allow_keys global (#6346)
* The allow_keys global is unused in nvim, remove it

* clint
2017-03-25 15:43:19 +01:00
Justin M. Keyes
0cd829161a Merge #6221 2017-03-25 00:16:33 +01:00
Justin M. Keyes
90ac8b09f5 fold.c: uppercase macros 2017-03-25 00:15:31 +01:00
James McCoy
d094a36e7c Merge pull request #6350 from jamessan/vim-8.0.0250
vim-patch:8.0.0250
2017-03-24 16:43:01 -04:00
James McCoy
2a6d44ca52 vim-patch:8.0.0250
Problem:    When virtcol() gets a column that is not the first byte of a
            multi-byte character the result is unpredictable. (Christian
            Ludwig)
Solution:   Correct the column to the first byte of a multi-byte character.
            Change the utf-8 test to new style.

0c0590d982

Closes #6269
2017-03-24 15:11:51 -04:00
Justin M. Keyes
38274051c0 Merge pull request #6323 from justinmk/vimpatches 2017-03-24 18:30:35 +01:00
Tommy Allen
a62ec4eb98 health.vim: tmux: Try -qvg and -qvgs (#6348) 2017-03-24 01:38:01 +01:00
Justin M. Keyes
7214d0bc84 XXX: ex_tabonly(): aucmd_win is not part of the window list.
During free_all_mem, somehow ex_tabonly() may free aucmd_win. But it
isn't fully destroyed (maybe autocmd_busy?). When win_free_all() tries
to free aucmd_win directly, it double-frees the sub-fields.

Tried unnsuccessfully to work around this by invoking `:tabonly!` with
autocmds disabled:

    diff --git a/src/nvim/memory.c b/src/nvim/memory.c
    index 58c01fbe7a12..91c845e94d22 100644
    --- a/src/nvim/memory.c
    +++ b/src/nvim/memory.c
    @@ -565,9 +565,9 @@ void free_all_mem(void)
       /* Close all tabs and windows.  Reset 'equalalways' to avoid redraws. */
       p_ea = false;
       if (first_tabpage->tp_next != NULL)
    -    do_cmdline_cmd("tabonly!");
    +    do_cmdline_cmd("noautocmd tabonly!");
       if (firstwin != lastwin)
    -    do_cmdline_cmd("only!");
    +    do_cmdline_cmd("noautocmd only!");

       /* Free all spell info. */
       spell_free_all();
2017-03-23 23:47:20 +01:00
Matthew Malcomson
a6c9c91841 vim-patch:8.0.0407 : filtering folds with marker method not tested
Problem:    Filtering folds with marker method not tested.
Solution:   Also set 'foldmethod' to "marker".
2017-03-23 15:55:57 +00:00
Matthew Malcomson
308a953e0b Fix wrap-around in 32 bit 2017-03-23 14:37:47 +00:00
Matthew Malcomson
b2b88423aa Robustly handle folds during a :move command
In order to re-order marks according to the :move command, do_move()
uses mark_adjust() in a non-standard manner. The non-standard action is
that it moves some marks *past* other marks. This doesn't matter for
marks, but mark_adjust() calls foldMarkAdjust() which simply changes
fold starts and lengths and doesn't have enough information to know that
other folds have to be checked and reordered.

The array of folds for each window are assumed to be in order of
increasing line number, and if this gets broken some folds can get
"lost".

There has been a previous patch to avoid this problem by deleting and
recalculating all folds in the window, but this comes at the cost of
closing all folds when executing :move, and doesn't cover the case of
manual folds.
This patch adds a new function foldMoveRange() specifically for the
:move command that handles reordering folds as well as simply moving
them. Additionally, we allow calling mark_adjust_nofold() that does the
same as mark_adjust() but doesn't affect any fold array.

Calling mark_adjust_nofold() should be done in the same manner as
calling mark_adjust(), but according changes to the fold arrays must be
done seperately by the calling function.

vim-patch:8.0.0457
vim-patch:8.0.0459
vim-patch:8.0.0461
vim-patch:8.0.0465
2017-03-23 14:37:47 +00:00
Jurica Bradarić
06ed7a189b vim-patch:7.4.2329 (#6341)
Problem:    Error for min() and max() contains %s. (Nikolay Pavlov)
Solution:   Pass the function name. (closes vim/vim#1040)

26b84339fd
2017-03-23 08:54:01 +01:00
raichoo
44e75eba30 vim-patch:7.4.2161 (#6340)
Problem:    Expression test fails without conceal feature.
Solution:   Only check "conceal" with the conceal feature.

7ab6defcaf
2017-03-22 21:57:20 +01:00
Björn Linse
f7aa1bfde6 Merge pull request #6335 from bfredl/mbyte_dead
mbyte: remove dead code
2017-03-22 19:49:07 +01:00
Justin M. Keyes
c398402f12 vim-patch:8.0.0307
Problem:    Asan detects a memory error when EXITFREE is defined. (Dominique
            Pelle)
Solution:   In getvcol() check for ml_get_buf() returning an empty string.
            Also skip adjusting the scroll position.  Set "exiting" in
            mch_exit() for all systems.

955f198fc5
2017-03-22 18:43:01 +01:00
Justin M. Keyes
830b31683e vim-patch:8.0.0502
Problem:    Coverity complains about possible NULL pointer.
Solution:   Add an assert(), let's see if this works on all systems.

a37ffaa5e0
2017-03-22 18:43:01 +01:00
Justin M. Keyes
41bffeacff vim-patch:8.0.0331
Problem:    Restoring help snapshot accesses freed memory. (Dominique Pelle)
Solution:   Don't restore a snapshot when the window closes.

343b8c0429
2017-03-22 18:43:01 +01:00
Justin M. Keyes
54f31187ba vim-patch:8.0.0482
Problem:    The setbufvar() function may mess up the window layout. (Kay Z.)
Solution:   Do not check the window to be valid if it is NULL.

2c90d51123
2017-03-22 18:43:01 +01:00
Justin M. Keyes
f58a593cea vim-patch:8.0.0483
Problem:    Illegal memory access when using :all. (Dominique Pelle)
Solution:   Adjust the cursor position right after setting "curwin".

f79225ed4f
2017-03-22 18:43:01 +01:00
Justin M. Keyes
2b32053559 test/legacy: Test_three_windows: rtp for :help 2017-03-22 18:43:00 +01:00
Justin M. Keyes
51bc9f243a ex_tabnext: Disallow "+NN" arg.
Need to do this explicitly because our implementation of getdigits() is
slightly different.
2017-03-22 18:43:00 +01:00
Justin M. Keyes
33858ccb9b vim-patch:8.0.0485
Problem:    Not all windows commands are tested.
Solution:   Add more tests for windows commands. (Dominique Pelle,
            closes vim/vim#1575) Run test_autocmd separately, it interferes with
            other tests.  Fix tests that depended on side effects.

4520d440c5
2017-03-22 18:43:00 +01:00
Justin M. Keyes
01bf78971c vim-patch:8.0.0172
Problem:    The command selected in the command line window is not executed.
            (Andrey Starodubtsev)
Solution:   Save and restore the command line at a lower level. (closes vim/vim#1370)

1d669c233c
2017-03-22 18:43:00 +01:00
Justin M. Keyes
b82e3358e0 vim-patch:8.0.0083
Problem:    Using freed memory with win_getid(). (Domenique Pelle)
Solution:   For the current tab use curwin.

8e63905263
2017-03-22 18:43:00 +01:00
Justin M. Keyes
9c8540edfd vim-patch:8.0.0159
References #5406

Problem:    Using a NULL pointer when using feedkeys() to trigger drawing a
            tabline.
Solution:   Skip drawing a tabline if TabPageIdxs is NULL. (Dominique Pelle)
            Also fix recursing into getcmdline() from the cmd window.

c695cec469
2017-03-22 18:43:00 +01:00
Justin M. Keyes
f06a691326 vim-patch:8.0.0037
Problem:    Get E924 when switching tabs. ()
Solution:   Use win_valid_any_tab() instead of win_valid(). (Martin Vuille,
            closes vim/vim#1167, closes vim/vim#1171)

0a9046fbcb
2017-03-22 18:43:00 +01:00
Justin M. Keyes
a24c6cc6a8 get_tabpage_arg: satisfy clang warning
vim-patch:8.0.0266
2017-03-22 18:43:00 +01:00
Justin M. Keyes
7e23ce6b4f lint 2017-03-22 18:42:59 +01:00
Justin M. Keyes
0f3afdaa1b vim-patch:8.0.0259
Problem:    Tab commands do not handle count correctly. (Ken Hamada)
Solution:   Add ADDR_TABS_RELATIVE. (Hirohito Higashi)

2f72c70657
2017-03-22 18:42:59 +01:00
Justin M. Keyes
386a5f379b test/legacy: Makefile Add missing tests
These tests aren't in test_alot.vim, so they need to be added to the
Makefile or they won't be run.
2017-03-22 18:42:59 +01:00
Justin M. Keyes
c99514c2a4 test/legacy: Run test_match, test_tabpage isolated
These are failing when run as a batch. Most likely some Vim runtime
patch fixed something, but we don't have it yet. Just isolate them for
now.

Also test_matchadd_conceal_utf8 (it's not there in Vim tree, either).
2017-03-22 18:42:59 +01:00
Justin M. Keyes
78a4c73cf0 vim-patch:7.4.2339
Problem:    Tab page test fails when run as fake root.
Solution:   Check 'buftype' instead of 'filetype'. (James McCoy, closes vim/vim#1042)

100f5c90f4
2017-03-22 18:42:59 +01:00
Justin M. Keyes
89abed7d85 vim-patch:8.0.0032
Problem:    Tests may change the input file when something goes wrong.
Solution:   Avoid writing the input file.

3e8474dd50
2017-03-22 18:42:59 +01:00
Justin M. Keyes
cd9fc4627e vim-patch:8.0.0049
Problem:    When a match ends in part of concealed text highlighting, it might
            mess up concealing by resetting prev_syntax_id.
Solution:   Do not reset prev_syntax_id and add a test to verify. (Christian
            Brabandt, closes vim/vim#1092)

2f97912800
2017-03-22 18:42:59 +01:00
Justin M. Keyes
5ee211770d vim-patch:8.0.0033
Problem:    Cannot use overlapping positions with matchaddpos().
Solution:   Check end of match. (Ozaki Kiichi) Add a test (Hirohito Higashi)

a6c27ee6db
2017-03-22 18:42:58 +01:00
Justin M. Keyes
929859ed81 vim-patch:7.4.2355
Problem:    Regexp fails to match when using "\>\)\?". (Ramel)
Solution:   When a state is already in the list, but addstate_here() is used
            and the existing state comes later, add the new state anyway.

16b3578f35
2017-03-22 18:42:58 +01:00
Justin M. Keyes
53ccd07fa1 lint 2017-03-22 18:42:58 +01:00
Justin M. Keyes
b0e34497b3 test/legacy: fix test_autocmd.vim
vim-patch:8.0.0487
2017-03-22 18:42:58 +01:00
Justin M. Keyes
2e9c1a9c4a vim-patch:8.0.0178
Problem:    test_command_count may fail when a previous test interferes, seen
            on MS-Windows.
Solution:   Run it separately.

9b73c4a215
2017-03-22 18:42:58 +01:00
Justin M. Keyes
10f6624f65 vim-patch:7.4.2328
Problem:    Crash when BufWinLeave autocmd goes to another tab page.
            (Hirohito Higashi)
Solution:   Make close_buffer() go back to the right window.
2017-03-22 18:42:56 +01:00
Justin M. Keyes
4a2e6f460d vim-patch:7.4.2341
Problem:    Tiny things.  Test doesn't clean up properly.
Solution:   Adjust comment and white space. Restore option value.
2017-03-22 18:42:17 +01:00