Commit Graph

63 Commits

Author SHA1 Message Date
Stanislav Seletskiy
08b96cbdb2 print erroneous snippet location 2015-10-21 18:02:33 +06:00
Stanislav Seletskiy
698f2d4910 print snippet information in backtrace (fix #551) 2015-10-21 14:17:10 +06:00
Stanislav Seletskiy
47a3d18629 review fixes:
* change 'code' attr to 'snippet_code';
* change 'Executed code' header;
* code changed to for-enumerate/oneline-if idioms;
* add python stacktrace printing tests;
2015-10-21 13:35:32 +06:00
Stanislav Seletskiy
76ebfec3cf autotrigger: make snippets expand without <tab> 2015-10-09 16:00:24 +06:00
Holger Rapp
e48d8a28e5 Rollback "Merge support for auto expand."
Due to performance degradation reported in #552.

This reverts commit 490430f91d, reversing
changes made to cf2c473a8e.
2015-08-21 07:38:34 +02:00
Stanislav Seletskiy
9eb2de6c34 add test for vim<7.4.214 2015-08-13 12:01:11 +06:00
Stanislav Seletskiy
5a5de07349 neovim tests 2015-08-12 20:08:08 +06:00
Stanislav Seletskiy
a994e3286d fix py3 tests 2015-08-12 18:40:17 +06:00
Stanislav Seletskiy
61e06bbc18 add note about version and fix tests 2015-08-12 17:35:28 +06:00
Stanislav Seletskiy
878f79ffda review fixes 2015-08-12 17:22:15 +06:00
Stanislav Seletskiy
8ff84758a7 fix tests
Autotrigger is not supported for old versions of vim.
2015-08-12 17:06:56 +06:00
Stanislav Seletskiy
14ea90385b tests and docs 2015-08-03 14:41:25 +06:00
Stanislav Seletskiy
1356560f9a fix blumba test 2015-08-03 14:41:25 +06:00
Stanislav Seletskiy
f80414fac5 prototype of autotrigger 2015-08-03 14:41:25 +06:00
Stanislav Seletskiy
bdecd9a8b5 fix not cleared context 2015-07-29 20:08:49 +06:00
Stanislav Seletskiy
9649f15a9e fix buffer edits from jump action 2015-07-29 20:08:49 +06:00
Stanislav Seletskiy
5a663116f5 edge case: anon snip in pre-action 2015-07-29 20:08:49 +06:00
Stanislav Seletskiy
ba774c39ca review fixes 2015-07-29 20:08:49 +06:00
Stanislav Seletskiy
972305725f fix expan_anon in pre-action, snip object, fixes 2015-07-29 20:08:49 +06:00
Stanislav Seletskiy
191ebd8e8b migrate to snip.* namespace 2015-07-29 20:08:34 +06:00
Stanislav Seletskiy
1ca82f76f7 pre/post-expand and post-jump actions 2015-07-29 20:08:34 +06:00
Holger Rapp
67fbdb2ad8 Handle $0 in a default text like any other tabstop.
Also change timing for testing again.

Fixes #356.
2015-07-27 17:11:35 +02:00
Holger Rapp
300156642c Support $n tabstops for snipMate snippets.
Before, only ${n} tabstops were supported. Apparently snipMate changed
this behavior though, so now we support that too.

Fixes #533.
2015-07-20 15:01:49 +02:00
Holger Rapp
cd0e60bc0f Remove no longer needed langmap translation.
Vim now has the 'langnoremap' option that handles issues with mapping
much more canonical.
2015-07-18 17:33:27 +02:00
Holger Rapp
290600c027 Pass the expected python version to the tests.
This ensure that we are actually testing against the python version that
we want to test again. A few weeks ago we still had the problem that all
our python3 tests ran against system python3 which was always 3.2. This
has been fixed a while ago, but this change makes sure we do not
regress.

Also fixes a couple of NOCOM comments that I left over in one of the
last commits.
2015-07-18 12:49:23 +02:00
Holger Rapp
44db53b7b6 Even more leanient timings. 2015-07-15 08:03:05 +02:00
Holger Rapp
0be9d0f861 Even slower typing. 2015-07-14 22:53:18 +02:00
Holger Rapp
eee82219b6 More lenient typing speed for Neovim. 2015-07-14 22:29:35 +02:00
Holger Rapp
306f0ace5f Add a testing interface that works for Neovim.
- Remove support for python 3.2 to reduce number of test cases and because
  it actually fails with Neovim. It is not a supported version anyways.
- Due to Neovim not handling fast typing through the console properly
  (https://github.com/neovim/neovim/issues/2454), the typing is actually
  simulated through the Python client. We need to differentiate now if a
  keystroke is meant for the terminal or for the Vim session. Using
  neovim.input() introduces additional chances for races since inputs
  are not buffered but processed right away. This results in more
  retries for some tests.
- Neovim needs more parameters and configuration passed in through the
  test script. Added command line arguments for these.
- Skip an extra test under Neovim due to
  https://github.com/neovim/python-client/issues/128.
2015-07-14 21:58:30 +02:00
Greg Hurrell
c4ee3ecf10 Fire autocommands when setting up and tearing down inner state
It can be useful to set up mappings that apply only during expansion of
a snippet. UltiSnips does this internally with the `_setup_inner_state`
and `_teardown_inner_state` methods.

This commit adds some `User` autocommands so that users of UltiSnips can
set up their own mappings and tear them down at the same time as
`_setup_inner_state` and `_teardown_inner_state`.

This is particularly useful for people who are writing their own
expansion and jump functions using `UltiSnips#JumpForwards` and
`UltiSnips#ExpandSnippet()` and friends. Here's an example from my own
dotfiles:

- 0664b627e7
- 3740c248ee

Using this approach I've been able to get rid of Supertab and have a
more nuanced autocompletion experience that works exactly as I'd like
with YouCompleteMe.
2015-07-13 07:11:39 +02:00
Holger Rapp
324a4f8ffc Support regexp trigger ending in whitespace.
Fixes #178.
2015-07-11 18:11:19 +02:00
Holger Rapp
becab789a8 Remove bootstrap.vim. Simplify startup.
The python module is now pulled in autoload/UltiSnips.vim. This means
that parsing of the .vimrc will only map the keys and set some options -
very cheap.

Unfortunately, the autocommands set up in plugin/UltiSnips.vim pulls in
the python code basically immediately still.
2015-07-11 16:17:50 +02:00
Holger Rapp
4f65a76542 Fix testing and test against more scenarios.
Before this, we only ever ran against system python preinstalled on
travis (i.e. 2.7 and 3.2). This change makes sure that Vim is always
build and run against the correct python version in the virtual env.
Also adds mercurial (HEAD) Vim as a testing target.
This patch took me forever to get right. At least 2 months and ~200
travis runs of trial and error - there is just too much finicky going on
with the many virtual envs on travis, Vims strange build system that
does not use python-config and LD_LIBRARY_PATH loading. En plus, the
debugging insights one can glance from travis runs are rather limited.

Detailed changes:
- Uses less sudo and only outside of scripts.
- Build correct version of Vim against correct version of Python. This
  needs some LD_LIBRARY_PATH magic to make sure that Vim finds the
  correct Python libraries at runtime.
- Removes dirty hack that overwrote /usr/bin/vim with the correct Vim
  version to run. The test_all.py script now takes the Vim binary as a
  parameter.
2015-07-03 21:52:50 +02:00
Holger Rapp
d6098193ef Merge pull request #446 from seletskiy/context-snippets
New feature: Context-aware snippets
2015-05-01 14:35:19 +02:00
Stanislav Seletskiy
50bb61cdc4 another test for error reporting 2015-05-01 18:07:59 +06:00
Stanislav Seletskiy
463e68a611 fix for correct error reporting 2015-05-01 18:03:21 +06:00
Holger Rapp
9587d9daa4 Merge pull request #486 from seletskiy/enhance-undo
Add more precise undo levels (expanding, jumping)
2015-04-30 07:55:58 +02:00
Stanislav Seletskiy
099d3bcfbc Add more precise undo levels (expanding, jumping)
Breaking undo achieved through re-setting &undolevel:

    Setting the value of 'undolevels' also breaks undo. Even when the new
    value is equal to the old value.

    [:h :undoj]
2015-04-27 19:30:17 +06:00
Stanislav Seletskiy
1b3ecf4a85 priority test, docs & fmt fixes 2015-04-27 15:42:21 +06:00
Stanislav Seletskiy
904fbdecf5 review fixes 2015-04-25 21:38:22 +06:00
Holger Rapp
82ceb62887 Remove testing with GNU screen
The testing on Travis only relies on tmux which also works locally fine.
No need to support two interfaces for the same thing.
2015-04-22 09:31:07 +02:00
Stanislav Seletskiy
87c3a7ba43 fix UltiSnipFunc test 2015-04-19 11:40:00 +06:00
Holger Rapp
aeb2e24204 Disabled unite test - it seems flaky. 2015-04-18 17:33:36 +02:00
Holger Rapp
99eede1bf6 Started to test py2 and py3 on travis now.
I also learned that Vim 7.3 does not seem to be working at all anymore.
Fixes a bug that only happens with python3.
2015-04-18 17:15:05 +02:00
kawing.chiu
f9a22111f0 Fix adjacent tabstop input issue.
Previously, adjacent tabstops like $1$2 were not handled properly.
$2 could be jumped to but no text could be added. See issue #457.
2015-03-13 23:49:45 +08:00
spacewander
4d88df461f remove duplicate things in vim_test_case.py 2015-03-05 18:21:09 +08:00
Holger Rapp
56ac14840f Disable neocomplete test which fails right now. 2015-02-14 15:39:12 +01:00
Holger Rapp
09876e0084 Support for m (trim) snippet option. 2015-02-14 14:20:03 +01:00
Daniel Hahler
1a3d0ce4b3 tests: allow passing in PYTHON, and default to python2 2015-02-09 22:48:16 +01:00
Daniel Hahler
6602da89dd tests: fix duplicate method name (test_SnippetPriorities) 2015-02-09 22:48:16 +01:00