From 9777b6ec4070a7e4874c82c06e8bbcf96eab8022 Mon Sep 17 00:00:00 2001 From: Enno Date: Mon, 2 Apr 2018 16:10:23 -0300 Subject: [PATCH] document IsExpandable() to check if snippet is expandable without expanding (#957) Solves https://github.com/SirVer/ultisnips/pull/790#issuecomment-377808784 --- doc/UltiSnips.txt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/doc/UltiSnips.txt b/doc/UltiSnips.txt index c5857bc..d945240 100644 --- a/doc/UltiSnips.txt +++ b/doc/UltiSnips.txt @@ -47,8 +47,9 @@ UltiSnips *snippet* *snippets* *UltiSnips* 5. UltiSnips and Other Plugins |UltiSnips-other-plugins| 5.1 Existing Integrations |UltiSnips-integrations| 5.2 Extending UltiSnips |UltiSnips-extending| -6. Helping Out |UltiSnips-helping| -7. Contributors |UltiSnips-contributors| +6. FAQ |UltiSnips-FAQ| +7. Helping Out |UltiSnips-helping| +8. Contributors |UltiSnips-contributors| This plugin only works if 'compatible' is not set. {Vi does not have any of these features} @@ -1791,7 +1792,18 @@ contact us on github if you integrate UltiSnips with your plugin so it can be listed in the docs. ============================================================================= -6. Helping Out *UltiSnips-helping* +6. FAQ *UltiSnips-FAQ* + +Q: Do I have to call UltiSnips#ExpandSnippet() to check if a snippet is + expandable ? Is there instead an analog of neosnippet#expandable ? +A: Yes there is, try + + function UltiSnips#IsExpandable() + return !empty(UltiSnips#SnippetsInCurrentScope()) + endfunction + +============================================================================= +7. Helping Out *UltiSnips-helping* UltiSnips needs the help of the Vim community to keep improving. Please consider joining this effort by providing new features or bug reports. @@ -1805,7 +1817,7 @@ You can contribute by fixing or reporting bugs in our issue tracker: https://github.com/sirver/ultisnips/issues ============================================================================= -7. Contributors *UltiSnips-contributors* +8. Contributors *UltiSnips-contributors* UltiSnips has been started and maintained from Jun 2009 - Dec 2015 by Holger Rapp (@SirVer, SirVer@gmx.de). It is now maintained by Stanislav Seletskiy