Skip to content

Commit 6b8fc8a

Browse files
committed
Change variable order in Python try snippets
By changing the code inside the try block to $0 it is possible to wrap the action region with a try/except block when yas-wrap-around-region is set to t.
1 parent fd92455 commit 6b8fc8a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

snippets/python-mode/try

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
# key: try
44
# --
55
try:
6-
$1
7-
except ${2:Exception}:
8-
$0
6+
$0
7+
except ${1:Exception}:
8+
$2

snippets/python-mode/tryelse

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# key: try
44
# --
55
try:
6-
$1
7-
except $2:
8-
$3
6+
$0
7+
except $1:
8+
$2
99
else:
10-
$0
10+
$3

0 commit comments

Comments
 (0)