diff --git a/src/dfmt.d b/src/dfmt.d
index 60f4f6e..0631085 100644
--- a/src/dfmt.d
+++ b/src/dfmt.d
@@ -541,7 +541,8 @@ private:
             else if (current.type == tok!")")
             {
                 if (peekIs(tok!"identifier") || (index + 1 < tokens.length
-                    && isKeyword(tokens[index + 1].type)))
+                    && (isKeyword(tokens[index+1].type)
+                     || tokens[index+1].type == tok!"@")))
                 {
                     writeToken();
                     if (space_afterwards)
diff --git a/tests/catchExceptionNested.d b/tests/catchExceptionNested.d
new file mode 100644
index 0000000..bddfd10
--- /dev/null
+++ b/tests/catchExceptionNested.d
@@ -0,0 +1,31 @@
+class U0 : Exception {
+    this() @safe pure nothrow { super("U0 error message"); }
+}
+ 
+class U1 : Exception {
+    this() @safe pure nothrow { super("U1 error message"); }
+}
+ 
+void foo() {
+    import std.stdio;
+ 
+    foreach (immutable i; 0 .. 2) {
+        try {
+            i.bar;
+        } catch (U0) {
+            "Function foo caught exception U0".writeln;
+        }
+    }
+}
+ 
+void bar(in int i) @safe pure {
+    i.baz;
+}
+ 
+void baz(in int i) @safe pure {
+    throw i ? new U1 : new U0;
+}
+ 
+void main() {
+    foo;
+}
diff --git a/tests/catchExceptionNested.d.ref b/tests/catchExceptionNested.d.ref
new file mode 100644
index 0000000..22d8d26
--- /dev/null
+++ b/tests/catchExceptionNested.d.ref
@@ -0,0 +1,49 @@
+class U0 : Exception
+{
+    this() @safe pure nothrow
+    {
+        super("U0 error message");
+    }
+
+}
+
+class U1 : Exception
+{
+    this() @safe pure nothrow
+    {
+        super("U1 error message");
+    }
+
+}
+
+void foo()
+{
+    import std.stdio;
+
+    foreach (immutable i; 0 .. 2)
+    {
+        try
+        {
+            i.bar;
+        }
+        catch(U0)
+        {
+            "Function foo caught exception U0".writeln;
+        }
+    }
+}
+
+void bar(in int i) @safe pure
+{
+    i.baz;
+}
+
+void baz(in int i) @safe pure
+{
+    throw i ? new U1 : new U0;
+}
+
+void main()
+{
+    foo;
+}