Commit Graph

1043 Commits

Author SHA1 Message Date
ZyX
af7ff808c7 eval: Fix overflow in error message in f_json_decode 2016-04-18 02:48:20 +03:00
ZyX
4f8b686435 documentation,functests: State that UTF-8-only support is intentional 2016-04-18 02:48:20 +03:00
ZyX
c129f6cfaf eval/decode: Accept \r as space character 2016-04-18 02:48:20 +03:00
ZyX
d06c2a1b18 eval/decode: Do not overflow when parsing -
Also makes if’s less nested.
2016-04-18 02:48:20 +03:00
ZyX
515fea1ef0 eval/decode: Reject even more numbers
Rejects leading zeroes and numbers like 1.e+5 (decimal dot with missing number 
with signed exponent).
2016-04-18 02:48:20 +03:00
ZyX
9c543f2e24 eval/decode: Reject more numbers, accept 1e5 2016-04-18 02:48:20 +03:00
ZyX
032ac502ff eval/decode: Do not loose high surrogates followed by high surrogates 2016-04-18 02:48:20 +03:00
ZyX
eb806c9620 eval/decode: Make sure that error messages do not cause overflow 2016-04-18 02:48:20 +03:00
ZyX
52c6cc2189 eval/decode: Make sure that parsing strings does not overflow 2016-04-18 02:48:20 +03:00
ZyX
224d7df630 eval/decode: Make sure that blank input does not crash Neovim 2016-04-18 02:48:20 +03:00
ZyX
394830631f eval/decode: Make sure that U+00C3 is parsed correctly 2016-04-18 02:48:20 +03:00
ZyX
b725f6b428 functests: Make sure that json functions are tested with C messages 2016-04-18 02:48:20 +03:00
ZyX
4eb5d05f01 eval/decode: Avoid overflow when parsing incomplete null/true/false
Note: second test does not crash or produce asan errors, even though it should.
2016-04-18 02:48:20 +03:00
ZyX
4a29995fe7 eval/decode: Rename brackets in error messages
U+007D is officially RIGHT CURLY BRACKET.
U+005D is officially RIGHT SQUARE BRACKET.
2016-04-18 02:48:20 +03:00
ZyX
942e0b338c encode: Handle incomplete surrogates like \uSURR\uOTHR properly 2016-04-18 02:48:20 +03:00
ZyX
406562ac6d encode: Fail to dump NaN and infinity
Thanks to vim/vim#654
2016-04-18 02:48:20 +03:00
ZyX
2f67786796 eval: Rename json* functions to json_* 2016-04-18 02:48:20 +03:00
ZyX
f1ced96c28 api: Replace set_var(name, NIL) with del_var(name) 2016-04-18 02:47:13 +03:00
ZyX
f0bd4a1494 eval/encode: Fix invalid UTF-8 strings handling:
1. Do not allow reading past buffer end when creating error messages.
2. Fix surrogate pairs range, avoid magic constants.
2016-04-18 02:47:13 +03:00
ZyX
77776b09c6 eval/encode: Fix writing strings starting with NL to list
Error [found][1] by oni-link.

[1]: https://github.com/neovim/neovim/pull/4131/files#r52239384
2016-04-18 02:47:13 +03:00
ZyX
569e404622 eval/encode: Fix non-utf-8 &encoding handling, add tests 2016-04-18 02:46:34 +03:00
ZyX
d4106f6df3 shada: Make sure that NIL and EXT values can also be parsed back
Note: currently they are both *dumped*, but parsing them produces an error. This
is inappropriate: variables should either be skipped with error message when
dumping or should be read back properly.

It also appears that I did not have test for “has wrong variable value type”
error, so nothing got removed from errors_spec.
2016-04-18 02:46:34 +03:00
ZyX
0aa3e7b7ce eval: Port parts of 7.4.1267 that are not already present 2016-04-18 02:46:34 +03:00
ZyX
b7cb8f0597 eval: Make assert_true and assert_false accept v:true and v:false 2016-04-18 02:45:49 +03:00
ZyX
6167ce6df2 eval: Remove v:none
To get v:none back just rever this commit. This will not make json*() functions
compatible with Vim though.
2016-04-18 02:45:49 +03:00
ZyX
e303ea8a19 eval/decode: Add support for special maps
Special dictionaries representing map are created when encountering duplicate
key or when key is empty or contains NUL.

Also checks that values are separated by a comma/colon properly.
2016-04-18 02:45:49 +03:00
ZyX
2c378fdfaf eval/decode: Parse strings with NUL to special dictionaries 2016-04-18 02:45:49 +03:00
ZyX
5814e29cdb eval/decode: Fix surrogate pairs processing 2016-04-18 02:45:49 +03:00
ZyX
ea82270d30 eval/decode: Fail on control and invalid unicode characters 2016-04-18 02:45:49 +03:00
ZyX
cddd7d47c3 eval/decode: Make msgpackparse() function use new v: vars 2016-04-18 02:45:49 +03:00
ZyX
e213ba1506 eval: Add jsondecode() function 2016-04-18 02:45:49 +03:00
ZyX
f5c35ba109 functests/msgpack: Test dumping special nil and bool dicts 2016-04-18 02:44:03 +03:00
ZyX
6e5498c3e3 runtime/msgpack: Add support for special values 2016-04-18 02:44:03 +03:00
ZyX
d70a322c40 eval: Add special variables v:false, v:null, v:none 2016-04-18 02:44:03 +03:00
ZyX
18903bd9b8 eval: Add special variable type 2016-04-18 02:44:03 +03:00
ZyX
68e58444b4 eval: Add jsonencode() function
Ref #3471
2016-04-18 02:44:03 +03:00
ZyX
c3efad5398 functests(msgpack): Fix location of one of the tests 2016-04-18 02:44:03 +03:00
ZyX
f21cb425fb functests(msgpack): Fix test names 2016-04-18 02:44:03 +03:00
Justin M. Keyes
4043725991 Merge pull request #4574 from oni-link/fix.utfc_ptr2char_len
mbyte.c: Fix invalid memory access in utfc_ptr2char_len
2016-04-17 16:59:14 -04:00
oni-link
cd00aa6ae4 mbyte_spec.lua: Fix indentation 2016-04-17 21:07:42 +02:00
oni-link
a8fec15899 mbyte_spec.lua: Fix wording 2016-04-17 21:07:22 +02:00
KillTheMule
e6e843ebc0 Make completion_spec.lua more robust
Having a tags file in the calling directory of make test would make this test
fail, so disable tag file completion for it. Disable all other options except the
current buffer, to, applying the principle of least surprise.
2016-04-16 22:40:43 +02:00
oni-link
cfe4352897 mbyte.c: Unittest for utfc_ptr2char_len() 2016-04-15 21:17:33 +02:00
Justin M. Keyes
523ff9c55c test: defaults_spec.lua 2016-04-15 02:23:27 -04:00
Justin M. Keyes
54188cddde test: move server_spec.lua
Old layout was too granular, we do not need a server/ folder.
2016-04-15 02:23:27 -04:00
Björn Linse
01eafc0c17 tests: fix indeterministic oldfiles! test 2016-04-14 18:11:39 +02:00
Thiago de Arruda
c18d5917e3 Update lua client to 0.0.1-24
The new version of the lua client uses libmpack as a backend, and some test
scripts had to be updated to reflect that.
2016-04-13 09:21:32 -03:00
Thiago de Arruda
584b8eddb4 Mark cursor_spec.lua indeterministic test as pending 2016-04-11 23:07:52 -03:00
Thiago de Arruda
f5f11b9e2f Remove indeterminism in oldfiles_spec.lua
If Nvim is in a "Press ENTER..." screen before the `get_vvar()` call, the test
will hang.
2016-04-11 23:07:52 -03:00
Thiago de Arruda
704f3dd855 Synchronize shada reset helper with other functional tests 2016-04-11 23:07:52 -03:00
Justin M. Keyes
bf2c2b34cf Merge pull request #4357 from jbradaric/vim-7.4.1105
vim-patch:7.4.1105
2016-04-09 14:14:55 -04:00
Shougo Matsushita
d227c843bf complete: noinsert/noselect should not set 'modified'. #4509 2016-04-09 13:36:37 -04:00
Charles Joachim
55844eee10 buffer.c: change return type to bool
Co-authored-by: Wayne Rowcliffe (@war1025)
2016-04-03 15:39:33 -04:00
Björn Linse
8eb8ebf905 tests: update tests to use [gs]et_lines instead of [gs]et_line_slice 2016-04-01 11:29:51 +02:00
Björn Linse
f3645e422f api/buffer: add tests for buffer_[gs]et_lines 2016-04-01 11:29:51 +02:00
Björn Linse
51c7818d42 api/buffer: introduce buffer_[gs]et_lines with new indexing convention.
-1 is index past the end, and -2 is the index of the last element.
This eliminates the need for include_start/include_end.

Allow the handling of out-of-bounds to be configurable.
2016-04-01 11:29:51 +02:00
James McCoy
7558f42f7d vim-patch:7.4.1654
Problem:    Crash when using expand('%:S') in a buffer without a name.
Solution:   Don't set a NUL. (James McCoy, closes vim/vim#714)

52c6eaffd4
2016-03-30 08:30:35 -04:00
James McCoy
62c0d99474 vim-patch:7.4.1652
Problem:    Old style test for fnamemodify().
Solution:   Turn it into a new style test.

610cc1b9b3
2016-03-30 08:30:35 -04:00
James McCoy
e4d1bf7177 vim-patch:7.4.1643
Problem:    Terminating file name has side effects.
Solution:   Restore the character. (mostly by James McCoy, closes vim/vim#713)

d4caf5c16a
2016-03-30 08:30:35 -04:00
James McCoy
5f0c76b243 vim-patch:7.4.1641
Problem:    Using unterminated string.
Solution:   Add NUL before calling vim_strsave_shellescape(). (James McCoy)

5ca84ce4aa
2016-03-30 08:30:35 -04:00
Justin M. Keyes
5730ad9376 Merge pull request #4461 from bfredl/pum_k_event
K_EVENT should not hide the popupmenu
2016-03-18 16:39:57 -04:00
Björn Linse
5aa0159f01 edit.c: K_EVENT should not hide the popupmenu
Nor should K_FOCUSGAINED and K_FOCUSLOST.
2016-03-17 13:26:51 +01:00
Justin M. Keyes
5a9d3be54c test: minor changes 2016-03-17 00:21:48 -04:00
Shougo Matsushita
77a7ca458b 'shortmess': Add "F" flag. #4446
Add "Don't give the file editing message" flag in shortmess option.

Add the UI tests by @fmoralesc
Fix the changes for Vim 7.4.1570
2016-03-17 00:07:38 -04:00
Justin M. Keyes
e7485ab1c9 Merge pull request #2877 from lucc/test88
test: Migrate legacy test 88.
2016-03-10 10:16:44 -05:00
Lucas Hoffmann
316d38d98c tests: Update migrated legacy test 88 for patch 7.4.639.
The patch was merged into master at d25a59f4.
2016-03-09 23:55:16 +01:00
Lucas Hoffmann
925c020a1b tests: Modernize legacy test 88. 2016-03-09 23:55:13 +01:00
Lucas Hoffmann
87c208a43f tests: Migrate legacy test 88. 2016-03-09 23:54:26 +01:00
Anmol Sethi
0b468fd0cf complete: disable folding when completing
Fixes vim/vim#643
2016-03-09 10:04:15 -05:00
Thiago de Arruda
96af115c71 Normalize nan/-nan in plugin/msgpack_spec.lua
-NaN doesn't exist in the IEEE 754 spec, it is a hardware-specific detail
abstracted away by luajit(and not by lua or nvim), so there's no need to test
it.  Normalize all tests that involve -nan so the suite will be compatible with
both Lua and Luajit.
2016-03-07 13:08:48 -03:00
Thiago de Arruda
34a1bc1a46 Remove goto statement in lua code.
`goto` is another luajit extension not compatible with 5.1.
2016-03-07 03:58:35 -03:00
Thiago de Arruda
c6ec148f2d Rewrite hexadecimal escape sequences as decimal in lua strings
The hexadecimal notation is a Luajit extension which is not compatible with Lua
5.1. While Lua 5.2 does support hexadecimal sequences, it is better to target
Lua 5.1 for maximum compatibility with Luajit(which has fully compatible with
5.1 API/ABI).
2016-03-07 03:58:35 -03:00
Thiago de Arruda
35d8d10a6a Remove dependency on ffi module 2016-03-07 03:58:29 -03:00
watiko
6d2ed7c0eb tests: Migrate legacy test tagcase 2016-03-06 00:32:58 +09:00
Marco Hinz
67eeb8a798 Tests: check error messages from set{qf,loc}list() 2016-03-02 15:09:39 +01:00
Marco Hinz
a528d56ba0 Tests: add autocmd_spec.lua 2016-03-02 12:37:50 +01:00
Marco Hinz
d9e631f1b5 Tests: clean up tabnew_spec.lua 2016-03-02 12:37:50 +01:00
watiko
29a1807de8 tests: Migrate legacy test sort 2016-03-02 17:32:24 +09:00
watiko
313810ccad vim-patch:7.4.1143
Problem:    Can't sort on floating point numbers.
Solution:   Add the "f" flag to ":sort".  (Alex Jakushev)  Also add the "f"
            flag to sort().

f7edf40448
2016-03-02 17:32:24 +09:00
watiko
d5904160d7 tests: Migrate legacy test searchpos 2016-03-02 16:41:09 +09:00
Justin M. Keyes
badf227e6f Merge pull request #4319 from watiko/vim-7.4.952
vim-patch:7.4.952
2016-03-02 01:31:45 -05:00
Marco Hinz
be7d6ba6c1 Trigger TabNew before TabEnter 2016-03-01 21:52:37 +01:00
Marco Hinz
6bfd88dec1 Tests: add function_spec.lua 2016-03-01 17:07:18 +01:00
Björn Linse
1dd986562f Merge pull request #4304 from bfredl/yank
Add v:event variable and TextYankPost autocommand
2016-02-29 16:09:28 +01:00
Björn Linse
2359f6f144 TextYankPost: add information to v:event and update tests 2016-02-29 16:07:50 +01:00
Björn Linse
7ab9ff88e6 eval: add v:event, which will contain data events want to propagate to their receivers.
Add helper functions dict_clear and dict_set_keys_readonly.
2016-02-29 16:06:41 +01:00
Marco Hinz
88da85a3cd Tests: fix according to lualint 2016-02-29 13:48:59 +01:00
Shougo Matsushita
f2ae5a9cc0 Add TextYankPost and TextDeletePost autocmds
Reviewed by @watiko

Ported from de53ab72c8
2016-02-29 13:21:59 +01:00
Justin M. Keyes
0c2ba7554f Merge pull request #3900 from ZyX-I/inf-nan-string
Make it possible to eval() all floating-point values dumped by string()
2016-02-28 11:48:54 -05:00
ZyX
0409cfded5 functests: Improve screen:expect error reporting 2016-02-28 08:15:52 +03:00
ZyX
a16d4a2b62 functests: Make test more robust 2016-02-28 08:12:55 +03:00
ZyX
712f057ed9 functests: Make sure that setting scrollback size works from TermOpen 2016-02-28 07:34:36 +03:00
ZyX
b32396170f main: Make using :edit term:// run TermOpen event
Ref #4306
2016-02-28 04:54:23 +03:00
Jurica Bradaric
11cf3680e4 vim-patch:7.4.1105
Problem:    When using slices there is a mixup of variable name and namespace.
Solution:   Recognize variables that can't be a namespace. (Hirohito Higashi)

9bbf63dbf8
2016-02-27 18:29:16 +01:00
Marco Hinz
b6170db1a1 Avoid internal errors with setloclist()
All syntastic users experienced this problem:

  E685: Internal error: get_tv_string_buf()

It's reproducable with:

  :call setloclist(0, [''])

So, not given optional arguments to setloclist() lead to some fields not
inizilied and the code took the wrong branches.
2016-02-26 18:52:17 +01:00
Lucas Hoffmann
1e7c6380fe tests: Migrate legacy test breakindent. 2016-02-25 17:15:09 +01:00
Marco Hinz
97324c96a4 Tests: add errorlist_spec.lua 2016-02-25 12:50:17 +01:00
Lucas Hoffmann
2ced866925 tests: Migrate legacy test 68. 2016-02-24 22:21:25 +01:00
Marco Hinz
9a3b7fa906 Tests: fix according to lualint 2016-02-24 01:42:38 +01:00
Björn Linse
06b9d2a6f2 bufhl: add tests for adding and clearing highlights 2016-02-23 21:29:01 +01:00
watiko
f0add77de5 vim-patch:7.4.952
Problem:    'lispwords' is tested in the old way.
Solution:   Make a new style test for 'lispwords'.

6cd1345307
2016-02-22 22:47:18 +09:00
Justin M. Keyes
99d4c8c29c keymap: Support <D-...> (super/command key).
Adds support for:
  - api:vim_input("<D-a>")
  - ":nnoremap <C-D-S-...>" and permutations thereof

UIs must capture the modifier and send it as "<D-...>" to vim_input().

Note: Before this commit, any arbitrary ":nnoremap <{foo}-{bar}>"
mapping could already be invoked with feedkeys("\<{foo}-{bar}>"). This
commit supports "D-" as a modifier that can be combined with "C-", "A-",
"S-" in any order.

For non-GUI (terminal) support, user must:
  :set <D-a>={CSI sequence}
then send the {CSI sequence} from their terminal. But this does not work
yet (regression #2204).

Closes #2190
2016-02-22 02:41:40 -05:00
Justin M. Keyes
95230ec702 Merge pull request #4267 from watiko/vim-7.4.932
vim-patch:7.4.{926,932,933}
2016-02-22 01:10:50 -05:00
Justin M. Keyes
73676ad37b Merge pull request #4262 from watiko/vim-7.4.893
vim-patch:7.4.{891,893,912}
2016-02-22 01:02:18 -05:00
Justin M. Keyes
6395dd64a4 Merge pull request #4167 from lucc/test11
tests: migrate legacy test 11
2016-02-21 23:49:36 -05:00
Justin M. Keyes
dd4b661dbd Merge pull request #4243 from lucc/test36
tests: Migrate legacy test 36.
2016-02-21 23:47:15 -05:00
Marco Hinz
6732f0193a Tests: check <abuf> from TermClose 2016-02-21 02:39:01 +01:00
Lucas Hoffmann
1b8caf3d75 test: charsearch: Fix error/typo in legacy test.
Error was reported upstream in vim/vim#650, fixed in 7.4.1366.
Typo was fixed upstream in 7.4.1041.
2016-02-20 10:52:02 -05:00
Lucas Hoffmann
76c9bd00d0 tests: Migrate legacy charsearch test. 2016-02-20 07:53:37 +01:00
Justin M. Keyes
00347ec781 Merge pull request #4240 from jbradaric/vim-7.4.888
vim-patch:7.4.888
2016-02-19 04:06:29 -05:00
Jurica Bradaric
560a346d57 vim-patch:7.4.844 #4228
Problem:    When '#' is in 'isident' the is# comparator doesn't work.
Solution:   Don't use vim_isIDc(). (Yasuhiro Matsumoto)

37a8de17d4
2016-02-17 03:59:58 -05:00
watiko
4f3ea0379e vim-patch:7.4.932
Problem:    test_utf8 has confusing dummy command.
Solution:   Use a real command instead of a colon.

8f08dab18d
2016-02-16 00:18:42 +09:00
watiko
3680332325 vim-patch:7.4.926
Problem:    Completing the longest match doesn't work properly with multi-byte
            characters.
Solution:   When using multi-byte characters use another way to find the
            longest match. (Hirohito Higashi)

4f8fa1633c
2016-02-16 00:15:52 +09:00
watiko
ade2298735 vim-patch:7.4.912
Problem:    Wrong indenting for C++ constructor.
Solution:   Recognize ::.  (Anhong)

e01f4f86ce
2016-02-15 21:08:22 +09:00
watiko
72d5a88af5 vim-patch:7.4.893
Problem:    C indenting is wrong below a "case (foo):" because it is
            recognized as a C++ base class construct.  Issue #38.
Solution:   Check for the case keyword.

d1b15dec4d
2016-02-15 19:13:15 +09:00
watiko
1eeadd7098 test: Fix lint error 2016-02-15 11:05:17 +01:00
watiko
9bd8fcde1e test: Add test cases to legacy test autocmd_option 2016-02-15 11:05:17 +01:00
watiko
2d5cba630c vim-patch:7.4.891
Problem:    Indentation of array initializer is wrong.
Solution:   Avoid that calling find_start_rawstring() changes the position
            returned by find_start_comment(), add a test. (Hirohito Higashi)

089af18d1f
2016-02-15 19:02:52 +09:00
Justin M. Keyes
baee9fe286 Merge pull request #4220 from watiko/vim-7.4.792
vim-patch:7.4.792
2016-02-15 03:55:23 -05:00
Lucas Hoffmann
109d53b7b9 test: Migrate legacy test 36.
The test was split into several blocks reusing the same input file.  As it is
complicated to send text in different encodings and with control characters
from the test suite to nvim and back the results are written to a temp file
and loaded into the test from there.
2016-02-15 09:25:49 +01:00
Lucas Hoffmann
291715286b test: Migrate legacy test 11.
Some parts of the test depend on gzip(1).  They are skipped if gzip is not
available.

Some `:write` and `:edit` commands produce messages and "hit enter" prompts
that had to be treated with an extra `feed('<C-L>')`.  In the original test
file this was not neccessary because it was `:source!`ed.
2016-02-15 09:09:16 +01:00
Justin M. Keyes
1e995ea2fd Merge #4140 'vim-patch:7.4.771'. 2016-02-15 01:48:30 -05:00
Justin M. Keyes
69234f4a76 test: search_mbyte_spec: minor cleanup
mbyte.vim, small.vim are not relevant to migrated legacy tests.
2016-02-15 01:47:43 -05:00
Justin M. Keyes
e0ca30553b Merge pull request #4166 from lucc/legacy/command_count
tests: Migrate legacy test command_count.
2016-02-15 01:10:15 -05:00
Justin M. Keyes
364d764889 Merge #2674 2016-02-13 15:22:12 -05:00
Justin M. Keyes
7567afbbe5 test: completion_spec: minor edits 2016-02-13 15:21:28 -05:00
Jun T
edbc97225d test: shada_spec: resolve symlink
If the build directory path has symlinks in it, 'make functionaltest'
fails at shada_spec.lua:177 because readme_fname has symlink but
nvim resolves the symlink when writing it into the shada file.
2016-02-12 00:03:39 +09:00
Justin M. Keyes
adb73b6025 Merge pull request #4204 from watiko/vim-7.4.915
vim-patch:7.4.{749,915}
2016-02-11 03:45:08 -05:00
watiko
51c3e0aa80 vim-patch:7.4.929
Problem:    "gv" after paste selects one character less if 'selection' is
            "exclusive".
Solution:   Increment the end position. (Christian Brabandt)

d29c6fea94
2016-02-11 15:13:30 +09:00
watiko
663e1ed158 vim-patch:7.4.743
Problem:    "p" in Visual mode causes an unexpected line split.
Solution:   Advance the cursor first. (Yukihiro Nakadaira)

c004bc2726
2016-02-11 15:13:30 +09:00
watiko
4a0e10fb2c vim-patch:7.4.734
Problem:    ml_get error when using "p" in a Visual selection in the last
            line.
Solution:   Change the behavior at the last line. (Yukihiro Nakadaira)

d009e86826
2016-02-11 15:13:30 +09:00
watiko
b137ebdd17 tests: Migrate legacy test match_conceal 2016-02-11 15:08:31 +09:00
Jurica Bradaric
f19e4dd1df vim-patch:7.4.834
Problem:    gettabvar() doesn't work after Vim start. (Szymon Wrozynski)
Solution:   Handle first window in tab still being NULL. (Christian Brabandt)

7e47d1ac6a
2016-02-09 20:21:26 +01:00
Jurica Bradaric
a9a25fda42 vim-patch:7.4.755
Problem:    It is not easy to count the number of characters.
Solution:   Add the skipcc argument to strchars(). (Hirohito Higashi, Ken
            Takata)

641e48c224
2016-02-09 01:36:29 -05:00
watiko
69e5427be1 vim-patch:7.4.915
Problem:    When removing from 'path' and then adding, a comma may go missing.
            (Malcolm Rowe)
Solution:   Fix the check for P_ONECOMMA. (closes #471)

174674743d
2016-02-09 14:44:53 +09:00
Justin M. Keyes
827e267800 Merge pull request #4175 from watiko/vim-7.4.700
vim-patch:7.4.700
2016-02-07 01:33:01 -05:00
Justin M. Keyes
d9cada146f Merge pull request #4157 from watiko/vim-7.4.694
vim-patch:7.4.{662,694}
2016-02-05 10:02:38 -05:00
watiko
3cf8ad6f48 tests: Add test case for legacy test 45 2016-02-05 14:09:03 +09:00
Lucas Hoffmann
86c5696c27 tests: Migrate legacy test 45. 2016-02-05 13:55:27 +09:00
Lucas Hoffmann
ad83cd82e1 tests: Simplify migrated legacy test. 2016-02-04 19:25:07 +01:00
Lucas Hoffmann
c1b0c45bee tests: Fix migrated legacy test.
The test involves argument and buffer numbers.  Therefore it was necessary to
use a custom testing session to ensure that the initial buffer corresponds to
an argument.
2016-02-04 19:23:47 +01:00
Lucas Hoffmann
153fe65c01 tests: Migrate legacy test command_count. 2016-02-04 19:20:59 +01:00
watiko
4cbe52b3a3 tests: Migrate legacy test textobjects 2016-02-03 21:56:22 +09:00
Justin M. Keyes
79a6983c0c ui: revert "gui_running" hack
Plugins (YCM, dispatch.vim) use gui_running to decide behavior; so do
some colorschemes. Up to now, nvim lied about gui_running for the
benefit of colorschemes and the detriment of all _other_ plugins that
check this condition. That's counterproductive: a user employs at most
_one_ colorscheme but may use many other plugins which expect the Vim
legacy semantics of gui_running.

Moreover, colorschemes usually don't _need_ to check gui_running: they
can instead set cterm{fg,bg} and gui{fg,bg} in the same :highlight call.

It is reasonable for users who want "true color" to modify their
colorscheme once (or request upstream to do so) in order to avoid
running into quirks in any other plugins.

Closes #2782
2016-02-03 01:21:59 -05:00
Marco Hinz
3d15cab29d Tests: fix according to lualint 2016-02-02 20:23:12 +01:00
ZyX
610b48c5b0 functests: Add string() function tests 2016-02-02 00:54:00 +03:00
ZyX
b2ea083eeb eval: Return different values when dividing by zero
Fixes #3263
2016-02-02 00:54:00 +03:00
ZyX
ad5cb87d7a eval: Add +tablineat feature 2016-02-01 21:40:46 +03:00
ZyX
3f314d40be functests: Improve tabline click tests 2016-02-01 21:40:46 +03:00
Jurica Bradaric
63a12e1e2d Remove unused variables from the test. 2016-02-01 08:54:13 +01:00
Jurica Bradaric
696adeb0f6 Use before_each instead of setup in the test. 2016-02-01 08:52:38 +01:00
Justin M. Keyes
be1d5a61be Merge pull request #4129 from jbradaric/vim-7.4.745
vim-patch:7.4.{745,746,747,748}
2016-02-01 02:49:27 -05:00
Jurica Bradaric
02cf813eff Add test files for patch 7.4.771.
vim-patch:efcabd6892ad89a4585fb77aa94c3b1802b784ab
2016-02-01 08:48:36 +01:00
Jurica Bradaric
59ef994f8f vim-patch:7.4.741 #4121
Problem:    When using += with ":set" a trailing comma is not recognized.
            (Issue 365)
Solution:   Don't add a second comma. Add a test. (partly by Christian
            Brabandt)

a7b7b1cef9
2016-02-01 02:28:51 -05:00
Justin M. Keyes
99067b7e56 Merge pull request #4113 from jbradaric/vim-7.4.709
vim-patch:7.4.709
2016-02-01 02:16:29 -05:00
watiko
fa924f4604 tests: Migrate legacy test increment. 2016-02-01 03:47:09 +09:00
watiko
a5f361e470 vim-patch:7.4.1027
Problem:    No support for binary numbers.
Solution:   Add "bin" to nrformats. (Jason Schulz)

887c1fea4a
2016-02-01 03:47:08 +09:00
watiko
7fc996abf6 vim-patch:7.0212
Add missing test case (test59's test 8-8).

8fd89f0fe7
0b23879827
2016-02-01 03:44:46 +09:00
Jurica Bradaric
f8ad215d25 vim-patch:7.4.745
Problem:    The entries added by matchaddpos() are returned by getmatches()
            but can't be set with setmatches(). (Lcd)
Solution:   Fix setmatches(). (Christian Brabandt)

0fce425772
2016-01-30 12:16:32 +01:00
Justin M. Keyes
8f22031708 Merge pull request #4117 from watiko/vim-7.4.963
Vim 7.4.{639,753,949,963}
2016-01-29 20:41:03 -05:00
solawing
fd14f64e26 tests: add always complete test 2016-01-29 22:03:30 +08:00
Justin M. Keyes
4c960c3d78 Merge #3077 'test_eval' 2016-01-29 00:23:53 -05:00
Justin M. Keyes
41f6a10a9b test: eval_spec.lua: minor cleanup 2016-01-29 00:20:47 -05:00
Justin M. Keyes
aa17b4b4bc vim-patch:7.4.1137
Problem:    Illegal memory access when using :copen and :cclose.
Solution:   Avoid that curbuf is invalid. (suggestion by Justin M. Keyes)
            Add a test.

62ef797496
2016-01-28 23:56:58 -05:00
Justin M. Keyes
73e83e8566 Merge pull request #4096 from justinmk/coverity125476
coverity/125476: RI: Null pointer dereference
2016-01-28 17:00:49 -05:00
Jurica Bradaric
a31f9161b0 vim-patch:7.4.709
Problem:    ":tabmove" does not work as documented.
Solution:   Make it work consistently.  Update documentation and add tests.
            (Hirohito Higashi)

40ce3a4e1f
2016-01-28 18:25:25 +01:00
watiko
db51ff10f4 vim-patch:7.4.963
Problem:    test_listlbr_utf8 sometimes fails.
Solution:   Don't use a literal multibyte character but <C-V>uXXXX. Do not
            dump the screen highlighting. (Christian Brabandt, closes #518)

1c57fe8b94
2016-01-28 20:52:41 +09:00
watiko
8721e1fe08 vim-patch:7.4.949
Problem:    When using 'colorcolumn' and there is a sign with a fullwidth
            character the highlighting is wrong. (Andrew Stewart)
Solution:   Only increment vcol when in the right state. (Christian Brabandt)

32a214e78d
2016-01-28 20:52:41 +09:00
watiko
8771e84db7 vim-patch:7.4.753
Problem:    Appending in Visual mode with 'linebreak' set does not work
            properly.  Also when 'selection' is "exclusive". (Ingo Karkat)
Solution:   Recalculate virtual columns. (Christian Brabandt)

74db34cc91
2016-01-28 20:52:41 +09:00
watiko
d25a59f4d0 vim-patch:7.4.639
Problem:    Combination of linebreak and conceal doesn't work well.
Solution:   Fix the display problems. (Christian Brabandt)

8fc6bc7126
2016-01-28 20:52:40 +09:00
oni-link
db77b7bc9e file_pat_to_reg_pat(): handle empty string. 2016-01-28 00:46:38 -05:00
Justin M. Keyes
894fcb778e glob2regpat(): handle empty string. 2016-01-27 22:19:50 -05:00
Lucas Hoffmann
e78fc534dd tests: Migrate recent patches of legacy eval test.
As the work of this migration did take quite some time, some changes where
made in master after this branch was started.  These are ported to the new
test file.
2016-01-27 12:54:45 +01:00
Lucas Hoffmann
4b13cbc76d tests: Comments and typos after review.
Helped-by: Justin M. Keyes <justinkz@gmail.com>
2016-01-27 12:52:13 +01:00
Lucas Hoffmann
fb3a6b925b tests: Resurrect unused part of legacy eval test.
The old test_eval.in file did a `:wq` on line 168.  The following 60 lines
where not used and there was no expected output for them in test_eval.ok.
This test code is now used in several test cases in the new test file.
2016-01-27 12:48:20 +01:00
Lucas Hoffmann
c13dc2b762 tests: Split converted eval test into it() blocks. 2016-01-27 12:43:53 +01:00
Lucas Hoffmann
8cfef01193 tests: Debug converted eval test. 2016-01-27 12:40:41 +01:00
Lucas Hoffmann
3571fdac6f tests: Migrate legacy eval test. 2016-01-27 12:37:56 +01:00
Justin M. Keyes
765d394f18 vim-patch:ac809999
ac80999985
2016-01-27 03:20:07 -05:00
Lucas Hoffmann
91a1680205 tests: Improve test 83 and add pending() call.
If nvim was compiled without `has("iconv")` this test is skipped.
2016-01-25 09:51:39 +01:00
Lucas Hoffmann
66f89ae321 tests: Migrate legacy test 83. 2016-01-25 09:39:59 +01:00
Justin Gassner
50c4c56967 vim-patch:dbcf19d
Add test files for patch 7.4.680.

dbcf19dc49
2016-01-23 15:33:31 +01:00
Justin M. Keyes
bcbcf235f6 Merge pull request #4012 from jbradaric/vim-7.4.729
vim-patch:7.4.729
2016-01-21 02:35:15 -05:00
Justin M. Keyes
8887ccffa6 Merge pull request #4049 from watiko/vim-7.4.616
vim-patch:7.4.616
2016-01-21 02:05:40 -05:00
Justin M. Keyes
542c79f20d test: printf_spec: fix missing setup
before_each(clear) is required to init the test harness for single-test
runs, and also to ensure a known environment for each test.
2016-01-21 01:34:56 -05:00
Justin M. Keyes
9eb6a44564 Merge #3916 "Add support for binary numbers". 2016-01-21 01:34:36 -05:00
watiko
5fa082fa85 tests: Migrate legacy test 39. 2016-01-21 14:05:02 +09:00
Björn Linse
4618307a6c job control: add tests for 'jobpid' and 'detach' 2016-01-20 11:09:29 +01:00
Jurica Bradaric
a118abca77 Add eol to listchars for mouse specification tests
This is consistent with VIM behavior. When showing a visual selection,
VIM only extends it past the last character if eol is in listchars (even
if nolist is set).
2016-01-19 08:47:49 +01:00
Justin M. Keyes
1a958345e2 Merge pull request #3981 from watiko/vim-7.4.991
Vim 7.4.9{78,80,81,91}
2016-01-17 22:51:06 -05:00
Seth Jackson
a7ade5c832 misc: UNIX => Unix #4022
Although UNIX is a registered trademark of The Open Group, it doesn't
really matter whether we refer to these systems as UNIX, Unix, or
Unix-like. So, for consistency, refer to them collectively as Unix.

Related:
http://www.greens.org/about/unix.html
http://www.unixica.com/html/unixunix.html
2016-01-16 18:34:31 -05:00
Jason Schulz
7ad3f077dc Add support for binary numbers 2016-01-15 18:21:06 -08:00
watiko
6f88dca92d tests: Migrate legacy test cdo. 2016-01-15 23:50:04 +09:00
Michael Reed
729064af5f test: sys/fcntl.h -> fcntl.h
POSIX.1-2008[1] says that the latter should be used, and all of our
supported platforms would seem to support this scheme, apparently even
Windows[2].

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html
[2]: https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx
2016-01-14 23:36:58 -05:00
watiko
b1b8759fc3 vim-patch:7.4.614
Problem:    There is no test for what patch 7.4.601 fixes.
Solution:   Add a test. (Christian Brabandt)

d7ce7a9ad2
2016-01-14 12:22:45 +09:00
Justin M. Keyes
8eeda7169a terminal: less babysitting of mapped_ctrl_c
process_interrupts() checks get_real_state() so we can avoid some
housekeeping of mapped_ctrl_c in terminal-mode.
2016-01-13 02:40:57 -05:00
Shougo Matsushita
3dfbeabf35 vim-patch:7.4.569/573
vim-patch:7.4.569
vim-patch:7.4.573
Helped-by: @glts https://github.com/neovim/neovim/pull/2621

Problem:    Having CTRL-C interrupt or not does not check the mode of the
            mapping. (Ingo Karkat)
Solution:   Use a bitmask with the map mode. (Christian Brabandt)

651863c94a

Problem:    Mapping CTRL-C in Visual mode doesn't work. (Ingo Karkat)
Solution:   Call get_real_state() instead of using State directly.

5000869712
2016-01-13 01:56:36 -05:00
Justin M. Keyes
3b94756feb Merge pull request #3982 from justinmk/nohighbit
input: Do not set high-bit. Preserve META modifier.
2016-01-11 00:48:28 -05:00
Justin M. Keyes
317d5ca7b0 input: Do not set high-bit; preserve ALT modifier.
Background: Vim internally prefers to represent ALT/META chords as
single-byte keys, by setting the high bit of the key byte.
extract_modifiers() _discards_ the meta/alt modifier, but we need it for
libvterm and libtermkey.

Closes #2440
Closes #3727
Closes #2017
References #2277
References #2254

https://github.com/neovim/neovim/issues/2017#issuecomment-140423557
> We [not libtermkey] are setting the high bit for some reason

https://github.com/neovim/neovim/issues/176#issuecomment-77834715
> libvtermkey requires the leading esc to parse alt/meta

https://github.com/neovim/neovim/pull/3246#issuecomment-136328450
> A program could do better than the current logic on some terminals, by
> asking for pure 8bit mode (S8C1T) and then immediately querying the
> mode again. If the result comes back as an 8bit single-byte CSI, then
> it can presume the mode setting was successful, and now the ESC prefix
> byte won't be seen in multibyte sequences; only as an Alt- prefix or
> a real Escape key. On such a terminal, it could therefore avoid
> needing to use that waiting timeout.
2016-01-11 00:29:58 -05:00
ZyX
3b7c4093e2 shell: Unquote &shell* options before using them 2016-01-11 05:24:44 +03:00
Justin M. Keyes
c6e481cba5 portability: use portable format specifier 2016-01-10 01:34:49 -05:00
watiko
59b04d856b tests: Make helper.source() return tempname. 2016-01-10 10:44:57 +09:00
watiko
feed81f45f tests: Fix OSX's tempname issue. 2016-01-10 10:44:57 +09:00
watiko
d37dc0b314 tests: Rename 100_undo_level to 100_lispwords. 2016-01-10 10:44:57 +09:00
watiko
9c5ab23ef2 tests: Migrate legacy test undolevels. 2016-01-10 10:44:57 +09:00
watiko
d8e07deff6 tests: Migrate legacy test assert. 2016-01-10 10:44:57 +09:00
ZyX
c6f6033482 eval: Do not use msgpack#string for error messages 2016-01-07 00:54:58 +03:00
ZyX
efaf76e623 functests: Update tests 2016-01-07 00:54:57 +03:00
Björn Linse
70f6e2ce52 encoding: update tests 2016-01-02 23:22:13 +01:00
Justin M. Keyes
22a928aeac test: change CI_TARGET reference to CI
Travis defines[1] $CI for its builds, whereas $CI_TARGET is
a Neovim-specific env var from 6483a198e4
that lost prominence in d2eb4a9346.

[1] https://docs.travis-ci.com/user/environment-variables/
2016-01-01 23:58:42 -05:00
Rui Abreu Ferreira
a48508de0d test/functional: Fix api/vim_spec.lua.
On Windows the default file format is DOS i.e. newlines are \r\n
instead of \n.
2015-12-31 23:28:55 -05:00
Rui Abreu Ferreira
091e885d44 Windows: fix serverstart functional test 2015-12-31 16:07:43 -05:00
Justin M. Keyes
d8a2007d47 Merge pull request #3869 from oni-link/fix.issue.3844
helpers.c: Handle msgpack str/bin objects with length 0 correctly
2015-12-30 01:01:23 -05:00
oni-link
8373aaf44e helpers.c: Handle msgpack str/bin objects with length 0 correctly
When converting a msgpack object to a String object, strings (and byte
arrays) with length 0 are handled as errors. This is fixed by
always using the msgpack data pointer as a valid pointer. For a NULL
pointer there is nothing to copy.

Test by @snoe

Fixes #3844
2015-12-21 00:23:53 +01:00
Marco Hinz
376b973a0a Tests: fix according to lualint 2015-12-20 22:41:40 +01:00
Justin M. Keyes
e123675bcc Merge pull request #3722 from ZyX-I/fix-3721
shada: Continue dumping when variables failed to dump
2015-12-18 11:55:15 -05:00
ZyX
ea67bf808b shada: Continue dumping when variables failed to dump
Closes #3721
2015-12-18 19:29:49 +03:00
Johan Klokkhammer Helsing
3b472e55b3 vim-patch:7.4.803
Problem:    C indent does not support C11 raw strings. (Mark Lodato)
Solution:   Do not change indent inside the raw string.

f7bb86dc59
2015-12-13 13:06:48 +01:00
Johan Klokkhammer Helsing
123361f187 vim-patch:7.4.670
Problem:    Using 'cindent' for Javascript is less than perfect.
Solution:   Improve indenting of continuation lines. (Hirohito Higashi)

dcefba9934
2015-12-13 11:55:37 +01:00
Justin M. Keyes
1b6e7f9e39 test: fixeol_spec: setup/teardown
Without this cleanup, test will fail if run multiple times.
2015-12-13 00:21:11 -05:00
Justin M. Keyes
aca51f3d93 Merge #3443 'vim-patch:7.4.{785,795,898}' 2015-12-13 00:09:07 -05:00
Justin M. Keyes
cc203e4b93 Merge pull request #3753 from watiko/vim-7.4.790
Vim 7.4.{786,787,789,790}
2015-12-12 17:43:23 -05:00
watiko
a3a8df8359 tests: Improve legacy autocmd_option.
* Compare tables instead of strings
 * Add neovim specific test
2015-12-12 03:34:17 +09:00
Marco Hinz
483d4abee7 Test: remove artifacts from root directory
The tests would leave the following test files in the root directory:

    Xtest-functional-plugin-shada.shada
    Xtest-functional-plugin-shada.shada.tmp.f

Clean them up in teardown().
2015-12-01 20:46:13 +01:00
watiko
8c00c34b91 tests: Keep each autocmd_option's test in isolation. 2015-11-28 20:15:28 +09:00
watiko
d9c0293824 tests: Improve legacy test autocmd_option. 2015-11-28 17:22:53 +09:00
watiko
21956adb6e tests: Migrate legacy test autocmd_option. 2015-11-28 17:22:53 +09:00
Justin M. Keyes
b9139e009f Merge pull request #3724 from ZyX-I/fix-3635
shada: Do not save unlisted and quickfix buffers
2015-11-27 18:06:52 -05:00
Rui Abreu Ferreira
28e59cb223 Use libuv errors instead of errno in unit tests
Replaced old unit tests for errno with libuv error codes UV_ENOENT
and UV_EEXIST (for os_open and os_getperms).

Added libuv include path to test/includes compiler calls - needed
to get hold of libuv headers.
2015-11-25 23:16:37 +00:00
Felipe Morales
80cf03602e Merge pull request #3581 from ZyX-I/fix-shada
Store last search direction when writing ShaDa files
2015-11-23 23:03:29 +01:00
ZyX
b98cea909f shada: Also store last search direction
Note: it looks like viminfo files do not store search direction intentionally.
After reading viminfo file search direction was considered to be “forward”.

Note 2: all files created on earlier Neovim version will automatically receive
“forward” direction.

Fixes #3580
2015-11-23 17:08:01 +03:00
Marco Hinz
d9fbc1865b test/functional: clean up according to luacheck (part 2) 2015-11-23 13:57:21 +01:00
Marco Hinz
4a69e55f39 test/functional: clean up according to luacheck (part 1) 2015-11-23 13:57:21 +01:00
Marco Hinz
32ecd75a16 test/unit: clean up according to luacheck 2015-11-23 13:57:21 +01:00
Marco Hinz
4afd386276 test/benchmark: clean up according to luacheck 2015-11-23 13:57:21 +01:00
Marco Hinz
818f926eb0 Tests: add luacheck for linting tests
Source: https://github.com/mpeterv/luacheck
Docs:   http://luacheck.readthedocs.org/en/0.12.0/index.html

Run via "make testlint".
2015-11-23 13:57:21 +01:00
Joe Hermaszewski
6329fd420e Reorganize focus events test into individual tests
The focus event tests now live in their own `describe` block with each
test testing the handling of focus events in a single mode.
2015-11-23 13:18:27 +01:00
Joe Hermaszewski
442cd0672b Enable focus events in cmdline and terminal modes
This change adds switch cases for K_FOCUSGAINED and K_FOCUSLOST to the
input handling functions in ex_getln.c and terminal.c. The handling is
identical to what's found in edit.c (just calling apply_autocmds).

If one enters cmdline-mode by feeding `:` and sends a focuslost event (by
leaving the window for example) the text `<FocusLost>` will be inserted
into the command line. There is similar behaviour in terminal mode. This
patch corrects this behavior to fire the apropriate autocmd instead.

Fixes #3714
2015-11-23 13:18:27 +01:00
ZyX
ec8e60a055 shada: Do not save unlisted and quickfix buffers
Fixes #3635
2015-11-23 15:12:08 +03:00
Felipe Morales
321db59ca1 Merge pull request #3270 from ZyX-I/shada-support
Add plugin for editing ShaDa files
2015-11-23 00:27:18 +01:00
Johan Klokkhammer Helsing
b1d7b5294a Convert legacy test for fixeol to lua test. 2015-11-22 20:03:41 +01:00
Joe Hermaszewski
f480b38a2f Add tests for focus events 2015-11-17 22:36:28 +00:00
John Szakmeister
d4f3d819d8 Workaround the unstable ordering of v:oldfiles in some more tests.
Fixes #3676.

Reviewed-by: Marco Hinz <mh.codebro@gmail.com>
2015-11-16 08:29:45 -05:00
Justin M. Keyes
91c5135f71 Merge pull request #3339 from war1025/dev/clean_build_stl_str_hl
Clean up buffer.c build_stl_str_hl
2015-11-15 16:48:13 -05:00
Marco Hinz
ec847af48d Test: add functional/autocmd/termclose_spec.lua 2015-11-15 16:29:13 +01:00
Marco Hinz
9fcd444036 Add TermClose event
A terminal buffer now exits with: [Process exited <return value>]

You can hook into it. E.g.  :au TermClose * call feedkeys('<cr>')

Closes #2293.
2015-11-15 15:10:02 +01:00
Wayne Rowcliffe
70f6b0f338 Start adding unit tests 2015-11-11 21:19:52 -06:00
Marco Hinz
947e356cda Test: improve functional/ex_cmds/oldfiles_spec.lua
- change approach for test 1: screen:expect() instead of assert()
- use execute() instead of command()
- 2 new tests that check none and wrong input for :oldfiles!

Helped-by: @fwalch
Helped-by: @tarruda
Helper-by: @justinmk
2015-11-11 17:12:02 +01:00
Marco Hinz
dc65c8a893 Add tests for :oldfiles 2015-11-10 03:13:31 +01:00
Marco Hinz
69085113b3 Add test/functional/ex_cmds/profile_spec.lua
This adds two new tests for:

    :profile dump
    :profile stop
2015-11-10 02:49:47 +01:00
Thiago de Arruda
df37aa6115 eval: Implement dictionary change notifications 2015-11-09 09:43:30 -03:00
John Szakmeister
9499432d7f Merge pull request #3616 from jszakmeister/sort-results-shada-test
Sort oldfiles in the marks_spec tests to avoid random ordering errors.
2015-11-06 06:47:58 -05:00
John Szakmeister
a6c45d15fd Sort oldfiles in the marks_spec tests to avoid random ordering errors.
According to @ZyX-I in #3594, ordering is not important so let's use
@tarruda's fix by sorting the results.
2015-11-06 06:02:41 -05:00
ZyX
96dc38b3c8 undo: Remove incorrect NONNULL_ALL attribute
Fixes #3605
2015-11-05 23:34:48 +03:00
John Szakmeister
690df9333a Ensure a session is running before attempting to do Python detection. 2015-11-04 05:01:22 -05:00
ZyX
ae0576a472 runtime: Add shada.vim syntax file 2015-11-01 21:27:28 +03:00
ZyX
9037a180de runtime: Add [ft]plugin/shada.vim files that automatically open .shada 2015-11-01 21:27:28 +03:00
ZyX
8d9063bb2a runtime: Add autoload/shada.vim helper file
Contains most of the logic
2015-11-01 21:27:28 +03:00
ZyX
136c560023 functests: Do not run some tests if there is no -NaN 2015-11-01 21:27:27 +03:00
ZyX
00a638179d runtime: Add autoload/msgpack.vim helper file 2015-11-01 21:27:27 +03:00
Thiago de Arruda
7e8b431d3f tui: Fix abort when stdout and stderr are not tty.
The abort came from using libuv tty handle on non-tty fd. Use uv_pipe_t in these
cases. Also add simple test for this case.
2015-10-29 08:13:45 -03:00
Thiago de Arruda
e5165bae11 input: Remove CURSORHOLD key
Refactor input.c, normal.c and edit.c to use the K_EVENT special key to trigger
the CURSORHOLD event. In normal and edit mode, K_EVENT is treated as
K_CURSORHOLD, which enables better handling of arbitrary actions in those
states(eg: In normal mode the previous operator counts will be restored).

Also fix a test in vim_spec.lua. The test had a wrong assumption: cmdheight is
only used to determine when the press enter screen will be shown, not to limit
how many lines or control pagination.
2015-10-26 10:52:01 -03:00
Thiago de Arruda
e596234fc2 test: Add more TUI tests and increase timeout 2015-10-26 10:52:01 -03:00
Justin M. Keyes
0f9dea2a0e vim-patch:7.4.849
Problem:    Moving the cursor in Insert mode starts new undo sequence.
Solution:   Add CTRL-G U to keep the undo sequence for the following
            cursor movement command. (Christian Brabandt)

8b5f65a527

Closes #3492
2015-10-26 02:23:59 -04:00
Justin M. Keyes
1ca5646bb5 Merge pull request #3470 from ZyX-I/pr-3198
XDG base directory specification support
2015-10-25 22:38:23 -04:00
ZyX
e5537a935f functests: Fix tests 2015-10-23 15:56:51 +03:00
ZyX
6b17d35ff1 functests: Use . for various folder defaults in tests 2015-10-23 15:56:51 +03:00
ZyX
ec1ca54d59 functests: Do not forget about -i argument
Target: make all tests run with chmod -x ~/.config/nvim ~/.local/share/nvim.
2015-10-23 15:56:51 +03:00
ZyX
fefcc01cc1 os/fs: Allow os_mkdir_recurse directory name to end with /// 2015-10-23 14:54:11 +03:00
ZyX
b7732cceca functests: Fix 078_swapfile_recover test 2015-10-23 14:54:11 +03:00
ZyX
ea2fe52552 functests: Add test to check expected behaviour (failing) 2015-10-23 14:47:59 +03:00
ZyX
3a4a941885 shada: Fix memory leak and double free when setting both &vi and &sd 2015-10-08 22:01:12 +03:00
ZyX
1162962d8b functests: Refactor tests:
- Remove unused variables.
- Do not use helpers.nvim_feed in most cases.
- Do not use helpers.nvim and helpers.nvim_eval at all.
- Add helpers.funcs and helpers.\*meths special tables. Indexing such table 
  creates functions which call helpers.call or helpers.nvim (and similar) with 
  first argument equal to table index.
2015-10-08 22:01:12 +03:00
ZyX
2dd8e05f9f shada: Fix jump/change list merging code
Errors happens under following conditions:

1. Jump/change list is full.
2. New jump/change list item should go between some of the old ones.
2015-10-08 22:01:11 +03:00
ZyX
b8e7915596 shada: Make sure that shada-r option correctly ignores case 2015-10-08 22:01:10 +03:00
ZyX
0966e92cf4 shada: When using shada-r normalize option path 2015-10-08 22:01:10 +03:00
ZyX
7085ea07d8 functests: Move exc_exec to test.functional.helpers 2015-10-08 22:01:10 +03:00
ZyX
56a2549ff8 functests: Do not disable pattern tests
Problem that led to this skip was fixed in [#3309][1].

[1]: 0a116c828d
2015-10-08 22:01:07 +03:00
ZyX
d283e758ea shada: Fix out-of-bounds array access
It leads to a memory leak as well. May overwrite wms->jumps_size.
2015-10-08 22:01:07 +03:00
ZyX
29a3e972de shada: Fix v:hlsearch save/restore and do not write empty patterns 2015-10-08 22:01:05 +03:00
ZyX
915a298223 shada,functests: Fix v:hlsearch saving/restoring handling 2015-10-08 22:01:04 +03:00
ZyX
48ba2f0109 documentation/functests: Replace NeoVim with Neovim 2015-10-08 22:00:49 +03:00
ZyX
be45e75026 shada: Refuse to write ShaDa file when ShaDa was disabled 2015-10-08 22:00:46 +03:00
ZyX
b249529676 functests: Make one recover_spec test also use gdb or valgrind 2015-10-08 22:00:45 +03:00
ZyX
804e074096 eval,functests: Reference all additional_* items created by ShaDa 2015-10-08 22:00:45 +03:00
ZyX
369081d1c4 shada: Fix crash in hmll_insert
This problem made test64 to crash. Description of the bug: when removing entry
from history when removed entry is not the last one it puts one element to
free_entries list, but ignores free entries starting from last_free_element.

Possible solutions:
1. First working: simply populate free_entries list with entries which are still
   free, starting from last_free_element.
2. Better (wastes less CPU): after free_entries list size goes to zero (which is
   the initial value) continue using last_free_element.
3. Even better (less memory): note that element from the list is *only* removed
   before adding another one. So replace free_entries array with one item.

Also renamed last_free_element to last_free_entry: in any case most of the lines
which mention it were altered.
2015-10-08 22:00:43 +03:00
ZyX
0960e16908 functests: Disable some tests when running with address sanitizer
Ref #1350
2015-10-08 22:00:43 +03:00
ZyX
17c69258a7 shada: Use same merging code for jumps and changes 2015-10-08 22:00:39 +03:00
ZyX
74d5084139 shada,functests: Add tests for merging ShaDa data 2015-10-08 22:00:38 +03:00
ZyX
4dc3bc8fc1 shada,functests: Make sure that v:oldfiles list is reset on :rshada! 2015-10-08 22:00:37 +03:00
ZyX
830c8bd23e functests: Add a number of “generic” functional tests 2015-10-08 22:00:36 +03:00
ZyX
fd4d5521a3 shada,functests: Use special sd_reader function for skipping 2015-10-08 22:00:34 +03:00
ZyX
17b5d27d85 functests: Move wshada and sdrcmd commands to helpers 2015-10-08 22:00:34 +03:00
ZyX
1542fc221e shada,functests: Improve detection of invalid ShaDa files
It appears that large portion of non-ShaDa ASCII text files may be parsed as
a ShaDa file because it is mostly recognized as a sequence of unknown entries:
all ASCII non-control characters are recognized as FIXUINT shada objects, so
text like

    #!/bin/sh

    powerline "$@" 2>&1 | tee -a powerline

(with trailing newline) will be recognized as a correct ShaDa file containing
single unknown entry with type 0x23 (dec 35, '#'), timestamp 0x21 (dec 33, '!')
and length 0x2F (dec 47, '/') without this commit. With it parsing this entry
will fail.
2015-10-08 22:00:29 +03:00
ZyX
12a31c70c1 shada,functests: Test compatibility support
For compatibility the following things are done:

1. Items with type greater then greatest type are ignored when reading and
   copied when writing.
2. Registers with unknown name are ignored when reading and blindly copied when
   writing.
3. Registers with unknown type are ignored when reading and merged as usual when
   writing.
4. Local and global marks with unknown names are ignored when reading. When
   writing global marks are blindly copied and local marks are also blindly
   copied, but only if file they are attached to fits in the `'N` limit defined
   in &shada. Unknown local mark’s timestamp is also taken into account when
   calculating which files exactly should fit into this limit.
5. History items with unknown type are ignored when reading and blindly copied
   when writing.
6. Unknown keys found in register, local marks, global marks, changes, jumps and
   search pattern entries are read to additional_data Dictionary and dumped (of
   course, unless any of these elements were not overwritten later). It
   obviously works only for values conversible to Object type.
7. Additional elements found in replacement string and history entries are read
   to additional_elements Array and dumped (same: only if they were not
   overwritten later). Again this works only for elements conversible to Object
   type.
8. Additional elements found in variable entries are simply ignored when
   reading. When writing *new* variables they will be preserved during merging,
   but that’s all. Variable values dumped from current NeoVim session never have
   additional elements.
2015-10-08 22:00:25 +03:00
ZyX
2244db67aa shada: Do not allow empty keys 2015-10-08 22:00:22 +03:00
ZyX
56174572bc shada,documentation: Extend read error handling, handle write errors
Modifications:
- If file was not written due to write error then writing stops and temporary
  file will not be renamed.
- If NeoVim detects that target file is not a ShaDa file then temporary file
  will not be renamed.
2015-10-08 22:00:16 +03:00
ZyX
e2994a3c62 shada,functests: Test how ShaDa support code reacts on errors
Some notes:
- Replaced msgpack_unpacker usage with regular xmalloc’ed buffer. Also since
  msgpack_unpack_next (as well as msgpack_unpacker_next) is not ever going to
  return MSGPACK_UNPACK_EXTRA_BYTES this condition was checked manually.
  Function that does return this status is msgpack_unpack, but it is marked as
  obsolete.
- Zero type is checked prior to main switch in shada_read_next_item because
  otherwise check would be skipped.
- Zeroing entry at the start of shada_read_next_item makes it safer.
- dedent('') does not work.
- v:oldfiles list is only replaced with bang, if it is NULL or empty.
2015-10-08 22:00:15 +03:00
ZyX
875d287d4b functests: Test that history is still accessible after :wshada 2015-10-08 22:00:10 +03:00
ZyX
1d3823a5c9 shada: Populate v:oldfiles 2015-10-08 22:00:09 +03:00