Commit Graph

84 Commits

Author SHA1 Message Date
Holger Rapp
64a023a7ec Towards using an internal buffer for all snippet updates. (#973) 2018-04-14 17:59:48 +02:00
Zhong Liu
f4304d59cc fix bug when vim option 'selection' is 'exclusive' (#883)
here is a vim option ``selection``.
if the value is `exclusive`, the mark `'>` is one more then real visual selection.
so var `ebyte` or `ec` must subtract 1.

and that is not a windows bug.
because gvim on windows sourced `$VIMRUNTIME\mswin.vim` by default.
the line 17 of `mswin.vim` execute `:behave mswin` will change option `selection` to `exclusive`.

more deailt in issue #863
2018-04-11 10:19:45 +02:00
Holger Rapp
36f5618745 Removed unnedded code. (#963)
As I am reading the code, this branch can never be taken.
2018-04-09 16:37:33 +02:00
Holger Rapp
b11b397d65 Eur symbol is translated in EUR instead of EU. 2018-04-01 21:22:37 +02:00
Holger Rapp
6ee724a1ce
Enable testing for python3 too. (#955)
This gives us back testing parity to before CI broke - and hooray, all tests still pass!
2018-04-01 20:50:03 +02:00
Holger Rapp
539c557680
Move travis testing into docker for better consistency. (#950)
This now only tests python2 on Vim 7.4, 8.0 and git. No Neovim (that has been broken for a long time anyways) and no longer any python3 testing. But hey, we have green tests again!
2018-04-01 00:56:34 +02:00
Holger Rapp
3515cb6c13 Adapt to the new way that tmux wants unicode be send.
This fixes most unicode using test-cases.
2018-03-30 22:03:36 +02:00
Marius Gedminas
b48d3ca2ab Fix Vim version checks in tests
has_patch(214) is meaningless if you don't pay attention to the
major/minor version: 7.4.214 != 8.0.214.
2016-09-16 23:48:54 +03:00
Stanislav Seletskiy
aaa89bf0d6 actions: do not break cursor on single line change 2016-04-27 22:29:50 +06:00
Egor Kovetskiy
2e62906c33 allow specify context using special header 2016-04-13 17:37:58 +06:00
Stanislav Seletskiy
5d4094b2bb quick and dirty fix tests for vanilla vim 2016-04-13 17:28:17 +06:00
Stanislav Seletskiy
3a3e56a987 grant access to visual to context and actions
Grants access to:

* context match condition for context snippets (via snip.visual_text and
    snip.visual_mode);

* pre/post actions (via same variable);

* context match condition to (!) lastly selected placeholder, so it is
    possible now to use autotrigger snippets, that are activated by
    simply typing letter while tabstop is selected;

* python interpolations to lastly selected placeholder;
2016-03-29 21:25:27 +06:00
Stanislav Seletskiy
059c9a9da2 Merge pull request #679 from SirVer/overwrite-tabstops-from-py-interpolation
Overwrite tabstops from py interpolation
2016-03-29 21:18:25 +06:00
Stanislav Seletskiy
7536ac9002 tabstops can be overwritten from interpolation
It adds new type of flexibility, where just entered text can be
dynamically modified if some conditions are satisfied (e.g. dynamically
add line wraps).
2016-03-28 12:21:09 +06:00
marius
ed40bebabf Add test cases for conditional transformations
and make sure it does not break the desired behaviour
2016-02-24 14:25:43 +01:00
Stanislav Seletskiy
25882e95cd add testcase for #658 2016-02-13 20:42:38 +06:00
dNItro
4b27b7152d Testcase added! 2016-01-25 04:25:15 -08:00
Stanislav Seletskiy
5a2dcc5cbf disable tests in vanilla vim for #616 2015-12-09 19:59:50 +06:00
Stanislav Seletskiy
45e3775c18 fix #616: update state on edit w/o cursor move
UltiSnips tracks changes in buffer and apply user changes only on
CursorMoved event. So, if placeholder is replaced completely by using
<BS>, CursorMoved is not triggered and internal snippet representation
is not updated, causing placeholder boundaries go out-of-sync.

Fixed by triggering text objects sync forcefully if change without
cursor move is detected.
2015-12-08 13:40:31 +06:00
Holger Rapp
9c73ce948a Fix a unicode bug in python3.
Fixes #609
2015-11-21 07:54:35 -08:00
Stanislav Seletskiy
6ea78e525c fix last jump $0 placeholder using post_expand
Last jump didn't work when post_expand action modifies char next to
snippet end.
2015-11-06 16:25:28 +06:00
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