Commit Graph

1275 Commits

Author SHA1 Message Date
Stanislav Seletskiy
5a663116f5 edge case: anon snip in pre-action 2015-07-29 20:08:49 +06:00
Stanislav Seletskiy
1e771de603 fix tests 2015-07-29 20:08:49 +06:00
Stanislav Seletskiy
ba774c39ca review fixes 2015-07-29 20:08:49 +06:00
Stanislav Seletskiy
8958b71341 add docs to the buffer proxy object 2015-07-29 20:08:49 +06:00
Stanislav Seletskiy
bc29e23226 VimBufferHelper -> VimBufferProxy 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
7ead6fa178 detect buffer changes via changedtick 2015-07-29 20:08:34 +06:00
Stanislav Seletskiy
760fd25e47 fix python3 compatibility 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
5c211b0e79 Clear up pathogen installation instructions.
Closes #535.
2015-07-27 09:22:05 +02:00
Holger Rapp
34679be7ae Updated ChangeLog.
[ci skip]
2015-07-21 14:29:50 +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
e058d1d400 Added waffle.io badge. 2015-07-18 22:57:19 +02:00
Holger Rapp
c68c9dd745 Add a webhook for gitter.im. 2015-07-18 22:53:41 +02:00
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