    private boolean handleKey0(KeyStroke key) {
        if (currentMode != null) {
            KeyMap map = currentMode.resolveKeyMap(keyMapProvider);
            if (map != null) {
                boolean inMapping = keyStrokeTranslator.processKeyStroke(map, key);
                if (inMapping) {
                    Queue<RemappedKeyStroke> resultingKeyStrokes =
                        keyStrokeTranslator.resultingKeyStrokes();
                    if(currentMode.getName() == InsertMode.NAME) {
                    	if(resultingKeyStrokes.isEmpty()) {
                    		return currentMode.handleKey(key);
                    	}
                    	else if(keyStrokeTranslator.numUnconsumedKeys() > 0) {
                    		for(int i=0; i < keyStrokeTranslator.numUnconsumedKeys(); i++) {
	                    		currentMode.handleKey(new RemappedKeyStroke(new SimpleKeyStroke(SpecialKey.BACKSPACE), false));
                    		}
                    	}
                    	else {
                    		return currentMode.handleKey(key);
                    	}
                    }
                    while (!resultingKeyStrokes.isEmpty()) {
                        RemappedKeyStroke next = resultingKeyStrokes.poll();
                        if (next.isRecursive()) {
                            handleKey(next);
                        } else {
                            currentMode.handleKey(next);
                        }
                    }
                    return true;
                }
            }
            return currentMode.handleKey(key);
        }
        return false;
    }

    private boolean handleKey0(KeyStroke key) {
        if (currentMode != null) {
            KeyMap map = currentMode.resolveKeyMap(keyMapProvider);
            if (map != null) {
                boolean inMapping = keyStrokeTranslator.processKeyStroke(map, key);
                if (inMapping) {
                    Queue<RemappedKeyStroke> resultingKeyStrokes =
                        keyStrokeTranslator.resultingKeyStrokes();
                    if(currentMode.getName() == InsertMode.NAME) {
                    	if(resultingKeyStrokes.isEmpty()) {
                    		return currentMode.handleKey(key);
                    	}
                    	else if(keyStrokeTranslator.numUnconsumedKeys() > 0) {
                    		for(int i=0; i < keyStrokeTranslator.numUnconsumedKeys(); i++) {
	                    		currentMode.handleKey(new RemappedKeyStroke(new SimpleKeyStroke(SpecialKey.BACKSPACE), false));
                    		}
                    	}
                    	else {
                    		while(resultingKeyStrokes.size() > 1) {
                    			resultingKeyStrokes.remove();
                    		}
                    	}
                    }
                    while (!resultingKeyStrokes.isEmpty()) {
                        RemappedKeyStroke next = resultingKeyStrokes.poll();
                        if (next.isRecursive()) {
                            handleKey(next);
                        } else {
                            currentMode.handleKey(next);
                        }
                    }
                    return true;
                }
            }
            return currentMode.handleKey(key);
        }
        return false;
    }
