Commit Graph

191 Commits

Author SHA1 Message Date
Michael Henry
99e8842ca5 A "clearsnippets" feature
=========================

It's difficult for the user to control which of the default
bundled snippets are active in his environment.  The
'runtimepath' variable must be set to the root of the ultisnips
installation, which brings in all of the bundled snippets.
Though the user may individually override the definition of the
bundled snippets using the "!" flag, the method has a couple of
problems:

- There's no way to remove a snippet, only to override it (and
  each snippet must be overridden individually).
- The "!" flag currently doesn't remove the overridden snippets
  from the "list snippets" command.

It might be considered a feature that "!" doesn't actually
remove the snippets from the "list snippets" command, though
perhaps that's an unintended effect.  In any case, it would be
more convenient to allow the user to selectively remove the
bundled snippets from his environment.

A patch is provided in the following branch to address these problems:
http://code.launchpad.net/~drmikehenry/ultisnips/clearsnippets

The branch's primary purpose is the addition of a
"clearsnippets" command that may be placed in a user's
~/.vim/UltiSnips/ft.snippets file.  The user may clear all
lower-priority snippet for that file type with the line:

  clearsnippets

Alternatively, he may clear individual snippets by listing their
triggers:

  clearsnippets trigger1 trigger2

A few changes were made to the testing system as part of the
incorporation of this new feature.  These changes include:

- The "extends" directive is now supported on multiple lines
  throughout file.

- A completely empty .snippets file is now possible.

- The test.py scripts now handles most of the vim setup,
  simplifying the running of the tests.  The invocation of Vim
  now reduces to:

    vim -u NONE

  Instructions for running the tests are included at top of
  test.py, where they should be more visible to interested
  users; UltiSnips.vim now just points to test.py's
  instructions.

- A new function vim_quote() encodes an arbitrary string into a
  singly-quoted Vim string, with embedded quotes escaped.
- SnippetsFileParser() now allows file_data to be passed
  directly for unit testing, avoiding the need to create files
  in the filesystem for test purposes.
- A new _error() function reports errors to the user.  At
  runtime, this function uses :echo_err in general, but also can
  append error text to current buffer to check for expected
  errors during unit tests.
- Added error checks to snippets file parsing, along with unit
  tests for the parsing.
- Increased retries from 2 to 4 (on my system, occasionally the
  timing still causes tests to fail).
2009-09-08 20:15:10 -04:00
Holger Rapp
4948c5f7f7 Applied Michael Henrys patch for w option 2009-08-30 20:39:27 +02:00
Holger Rapp
441d0d21cf Applied patch by Michael Henry to fix a bug that ultisnips doesn't exit at ts zero 2009-08-30 20:15:06 +02:00
Holger Rapp
eafbe00a56 Applied suggested patch by Michael Henry to fix problem with tab not being accepted even though ultisnips does nothing with it 2009-08-30 20:04:17 +02:00
Holger Rapp
995404e2f0 Fixed typo. Reported by m.d. 2009-08-30 19:50:58 +02:00
Michael Henry
66ba0686d9 Snippet mode is now exited after final tabstop zero is encountered. 2009-08-25 19:18:06 -04:00
Michael Henry
9a19e9c573 Fixed problem with tab being ignored on failed snippet expansion. 2009-08-24 06:28:54 -04:00
Michael Henry
66d35419a4 Added support for snippet option "w" for word-boundary triggers. 2009-08-23 18:44:19 -04:00
Holger Rapp
4721cb0a9b Stabilized another test by making it muuuuch slower 2009-08-17 17:33:28 +02:00
Holger Rapp
f6de9346ba Cleaned up java snippets 2009-08-17 17:29:06 +02:00
Holger Rapp
40a0b46435 Fixed a bug with escaping of twopoints in conditional replaces 2009-08-17 17:20:19 +02:00
Holger Rapp
1dea8be42e Updated changelog 2009-08-16 23:50:00 +02:00
Holger Rapp
405521caad Cleaned up TCL snippets 2009-08-16 20:58:08 +02:00
Holger Rapp
3cf98270de Implemented listing of current snippets following the suggestion of jceb. This patch took another route than his suggestion, but should be functional equivalent 2009-08-16 20:55:08 +02:00
Holger Rapp
de9e35b8f7 Fixed stupid bug introduced in last revision 2009-08-16 18:50:14 +02:00
Holger Rapp
a96a6a31c9 Made trigger description include trigger by default. Patch suggested by jceb 2009-08-16 16:44:50 +02:00
Holger Rapp
c1462f3a02 _SnippetDictionary is no longer derived from dict since it makes no longer sense with the i option 2009-08-16 16:42:32 +02:00
Holger Rapp
cd0b859b62 Implemented i option (inword snippet expansion) along the line of the patch by jceb, also added his test cases 2009-08-16 16:34:54 +02:00
Holger Rapp
f5610ae451 Added a contributors section to the help file 2009-08-16 16:07:34 +02:00
Holger Rapp
f4515daeee Fixed bug 411010 2009-08-09 15:00:20 +02:00
Holger Rapp
43e60ebd57 Added support for extends keyword. With this it is simple to make inheritance trees of snippets for file types 2009-08-02 11:57:43 +02:00
Holger Rapp
1236d0ab86 Refactored parsing of Snippets files a bit to make it easier to extend the syntax 2009-08-02 11:29:42 +02:00
Holger Rapp
5eaed114db Fixed 407144. Also added test cases for it 2009-08-02 10:35:23 +02:00
Holger Rapp
4d550b4b90 Small cleanup in tm_objc. Not completed 2009-08-01 11:27:22 +02:00
Holger Rapp
1aa73e8306 Fixed a small bug while printing out non ascii chars 2009-07-30 20:03:56 +02:00
Holger Rapp
fdb6622073 Fixed test case for expandtab. Expected functionality has changed in the last commit 2009-07-30 19:52:42 +02:00
Holger Rapp
ac163993a9 Fixed expandtabs. Was broken at the beginning of the line. Now it is broken in the middle of the line 2009-07-30 08:08:36 +02:00
Holger Rapp
51f462bbde Replaced space indent through tab indent in snippets. This is more logical now that expandtab is adhered to 2009-07-29 22:46:11 +02:00
Holger Rapp
22804a2cbb Cleaned up HTML snippets 2009-07-29 19:29:28 +02:00
Holger Rapp
8fb1412791 - fixed a bug related to indentexpr. vim just has too many options
- expandtab and ts options are now taken into consideration when expanding tabs
2009-07-29 09:49:44 +02:00
Holger Rapp
274ef83833 Fixed bug #405502. Also added a test case for it 2009-07-28 08:04:53 +02:00
Holger Rapp
24ce06515d Finally fixed #404819 2009-07-27 16:59:04 +02:00
Holger Rapp
cb458a0ce7 Attemp to work around SuperTabs <tab> claiming when installed in the home vim folder 2009-07-27 09:51:09 +02:00
Holger Rapp
e5058084c3 Fixed a missing self; a bug that slipped the tests 2009-07-26 23:03:59 +02:00
Holger Rapp
2f28d0ebb5 Fixed bug #404822 with a patch by jceb. 2009-07-26 17:42:40 +02:00
Holger Rapp
39fdc55a58 Unified hdr to #! 2009-07-24 16:43:32 +02:00
Holger Rapp
8c7c82dafd Added img link 2009-07-24 16:42:16 +02:00
Holger Rapp
5ee8b842eb Fixed some bugs related to char escaping in snippet definitions. fixes #401687 2009-07-22 12:08:21 +02:00
Holger Rapp
a76165c147 Fixed a backslash in printf and fprintf snippets 2009-07-21 18:03:39 +02:00
Holger Rapp
242d9f8664 Pushed version to 1.1. Prepare a release 2009-07-21 10:33:40 +02:00
Holger Rapp
d0a50ae9d2 Made trigger keys configurable. Added support for setting forward jump and expand to the same key 2009-07-21 10:21:05 +02:00
Holger Rapp
9292919205 Fixed rwprop now... maybe 2009-07-20 21:25:01 +02:00
Holger Rapp
ebc685232e Fixed rwprop 2009-07-20 21:22:31 +02:00
Holger Rapp
9c3456e3c5 Cleaned perl snippets up 2009-07-20 07:51:35 +02:00
Holger Rapp
954e579d7b Fixed README 2009-07-20 07:42:21 +02:00
Holger Rapp
f0d55cad19 Cleaned sh snippets up 2009-07-20 07:40:11 +02:00
Holger Rapp
46db06a901 Cleaned vim snippets up 2009-07-20 07:29:45 +02:00
Holger Rapp
5a1b36e6aa Splitted c snippets into c and c++ 2009-07-20 07:25:02 +02:00
Holger Rapp
11c20ee093 Beefed converter script a bit. Still an ugly hack. Imported HTML and CSS snippets from Textmate 2009-07-19 22:53:25 +02:00
Holger Rapp
c3dff61ef1 Fixed a small bug with string escaping in transformations. Went over the c snippets from TextMate, reworked them to work without any shell code (for compatibility sake) 2009-07-19 17:12:57 +02:00