Commit Graph

1259 Commits

Author SHA1 Message Date
Holger Rapp
7f64510a7e Link to the Vimcasts about UltiSnips.
[ci skip]
2015-07-18 18:05:36 +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
Holger Rapp
992e094638 Add a warning about changing the buffer in autocommands. 2015-07-13 07:14:54 +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
29d7080d64 Do not set up inner state if it is already setup.
This makes _(setup|teardown)_inner_state symmetric.
2015-07-12 20:05:33 +02:00
Holger Rapp
33db8b4ab0 Update pathogen installation instructions.
Fixes #501.
2015-07-11 18:48:44 +02:00
Holger Rapp
324a4f8ffc Support regexp trigger ending in whitespace.
Fixes #178.
2015-07-11 18:11:19 +02:00
Holger Rapp
6b12b11411 Only set autocommands when there are snippets.
This speeds up cursor movement when there is no snippet activated.

Fixes #518.
2015-07-11 17:11:04 +02:00
Holger Rapp
2ed217a059 Remove deprecated functions like a boss. 2015-07-11 16:36:09 +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
b13015d47a Remove sys.path manipulations.
They were only needed for < 7.4 Vims which are no longer supported.
2015-07-11 14:18:53 +02:00
Holger Rapp
5f75dde205 Remove snipMate compatibility script.
The engine does not use this and it should therefore live in
vim-snippets.
2015-07-11 13:39:39 +02:00
Holger Rapp
9822193e4e Make scripts actually executable. 2015-07-03 22:03:08 +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
5590f9b7be Merge pull request #522 from blueyed/use-vim-current-buffer
VimBuffer: use vim.current.buffer.number instead of vim.eval
2015-07-01 21:08:16 +02:00
Daniel Hahler
8c257e24e0 VimBuffer: use vim.current.buffer.number instead of vim.eval
This should be more performant.
2015-06-27 18:23:46 +02:00
Holger Rapp
c3a0924b77 Require Vim 7.4 in preparation of removal of compatibility features. 2015-06-11 07:53:47 +02:00
Holger Rapp
de70b1ed5d Exit snippets when entering/exiting command window.
Fixes #510.
2015-06-11 07:22:00 +02:00
Holger Rapp
3806a69874 Fix improper use of augroup in ftdetect. 2015-06-01 21:12:19 +02:00
Ye Ding
2fb8820ff4 A backward compatible solution 2015-05-27 18:33:58 +09:00
Ye Ding
00d50c3ae3 Remove augroup block
`augroup END` in filetype detection scripts can enclose 'filetypedetect'
group unexpectedly, makes following ftdetect auto commands be defined in
default autogroup.
2015-05-27 14:21:53 +09:00
Holger Rapp
188e00f7b8 Merge pull request #493 from cwahbong/fold-fix
Fix folding for snippet files.
2015-05-11 20:22:47 +02:00
cwahbong
ca19772315 Fix folding for snippet files. 2015-05-04 14:16:09 +08:00
Holger Rapp
ab1cc1afac Remove documentation for using the same trigger for jump and expand. 2015-05-01 14:36:41 +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
2f355c233f another little fix in documentation 2015-04-29 22:25:21 +06: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
4ab4c1df4b Do not use --interface anymore. 2015-04-22 10:01:58 +02:00
Holger Rapp
1bf07737be Make sure tmux is available before starting any test. 2015-04-22 09:55:31 +02: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
Holger Rapp
2c15427b10 Merge pull request #482 from blueyed/check-python-support-for-UltiSnipsUsePythonVersion
Verify python support for UltiSnipsUsePythonVersion
2015-04-22 05:58:52 +02:00
Stanislav Seletskiy
87c3a7ba43 fix UltiSnipFunc test 2015-04-19 11:40:00 +06:00
Stanislav Seletskiy
709f8dc93f minor doc fix and new cursor variable 2015-04-19 11:08:14 +06:00
Stanislav Seletskiy
9861a6e6c3 typo fix in docs 2015-04-19 11:08:14 +06:00
Stanislav Seletskiy
66bc2e8f6e documentation, pull-requests fixes 2015-04-19 11:08:14 +06:00
Stanislav Seletskiy
0beefd4a19 fix context match on False value 2015-04-19 11:06:03 +06:00
Stanislav Seletskiy
ed8cf49115 fix tests 2015-04-19 11:06:03 +06:00
Stanislav Seletskiy
b3aec07053 proof of concept for context snips 2015-04-19 11:04:57 +06:00
Daniel Hahler
800a54da17 bootstrap: use WarningMsg with python warning message 2015-04-18 22:56:57 +02:00
Daniel Hahler
ac42c83a70 bootstrap: verify that g:UltiSnipsUsePythonVersion is available
Without this, UltiSnips will throw a lot of errors in case it's not
available.

This does not look at `g:UltiSnipsNoPythonWarning`, because it is not
auto-detected, but provided by the user's config.
2015-04-18 22:56:09 +02:00