Commit Graph

563 Commits

Author SHA1 Message Date
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
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
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