From 5aaeae5e85331dfcacbfb957f1e3bffe413f647e Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Sat, 22 Mar 2014 11:28:44 +0100 Subject: [PATCH] Do not delete child that is already gone. Fixes #154 --- pythonx/UltiSnips/text_objects/_base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pythonx/UltiSnips/text_objects/_base.py b/pythonx/UltiSnips/text_objects/_base.py index feb014c..0809bb9 100644 --- a/pythonx/UltiSnips/text_objects/_base.py +++ b/pythonx/UltiSnips/text_objects/_base.py @@ -350,10 +350,11 @@ class EditableTextObject(TextObject): child._parent = None self._children.remove(child) - # If this is a tabstop, delete it + # If this is a tabstop, delete it. Might have been deleted already if + # it was nested. try: del self._tabstops[child.number] - except AttributeError: + except (AttributeError, KeyError): pass class NoneditableTextObject(TextObject):