From a7fc95dfbeca4b770d348155ec2fc188e4534bc1 Mon Sep 17 00:00:00 2001 From: Josh Wainwright Date: Fri, 1 Aug 2014 15:48:11 +0100 Subject: [PATCH 1/3] Add VISUAL to several snippets to allow wrapping selected text --- UltiSnips/java.snippets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UltiSnips/java.snippets b/UltiSnips/java.snippets index 54ca6f3..2f9dc9b 100644 --- a/UltiSnips/java.snippets +++ b/UltiSnips/java.snippets @@ -180,13 +180,13 @@ endsnippet snippet elif "else if" else if ($1)`!p nl(snip)`{ - $0 + ${0:${VISUAL}} } endsnippet snippet el "else" w else`!p nl(snip)`{ - $0 + ${0:${VISUAL}} } endsnippet @@ -214,7 +214,7 @@ endsnippet snippet if "if" b if ($1)`!p nl(snip)`{ - $0 + ${0:${VISUAL}} } endsnippet @@ -303,7 +303,7 @@ endsnippet snippet try "try/catch" b try { - $1 + ${0:${VISUAL}} } catch(${2:Exception} ${3:e}){ ${4:e.printStackTrace();} } From ae1631ca09a5f4108bc67be7a6d5e7e8352ee249 Mon Sep 17 00:00:00 2001 From: Josh Wainwright Date: Fri, 1 Aug 2014 15:51:04 +0100 Subject: [PATCH 2/3] Correct anchor --- UltiSnips/java.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UltiSnips/java.snippets b/UltiSnips/java.snippets index 2f9dc9b..c26b6f6 100644 --- a/UltiSnips/java.snippets +++ b/UltiSnips/java.snippets @@ -303,7 +303,7 @@ endsnippet snippet try "try/catch" b try { - ${0:${VISUAL}} + ${1:${VISUAL}} } catch(${2:Exception} ${3:e}){ ${4:e.printStackTrace();} } From 437196368e394c4300271dc42bfeef6cc8436773 Mon Sep 17 00:00:00 2001 From: Josh Wainwright Date: Fri, 1 Aug 2014 16:26:29 +0100 Subject: [PATCH 3/3] Don't highlight selected text after wrapping --- UltiSnips/java.snippets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UltiSnips/java.snippets b/UltiSnips/java.snippets index c26b6f6..e8eb77c 100644 --- a/UltiSnips/java.snippets +++ b/UltiSnips/java.snippets @@ -180,13 +180,13 @@ endsnippet snippet elif "else if" else if ($1)`!p nl(snip)`{ - ${0:${VISUAL}} + $0${VISUAL} } endsnippet snippet el "else" w else`!p nl(snip)`{ - ${0:${VISUAL}} + $0${VISUAL} } endsnippet @@ -214,7 +214,7 @@ endsnippet snippet if "if" b if ($1)`!p nl(snip)`{ - ${0:${VISUAL}} + $0${VISUAL} } endsnippet @@ -303,7 +303,7 @@ endsnippet snippet try "try/catch" b try { - ${1:${VISUAL}} + $1${VISUAL} } catch(${2:Exception} ${3:e}){ ${4:e.printStackTrace();} }