 			} else {
 				indent = 0
 			}
-			if inSwitch {
+			if inSwitch && char == "}" {
 				switchCount -= 1
 				if switchCount == 0 {
 					inSwitch = false

				target = target.predecessor()
			}
		}
		if modify {
			target = target.successor()
		}

		return target
	}

	func checkCursorStart() {

		return (retString, retString.nsRangeFromRange(range))
	}

	func getPosition(start: String.Index) -> String.Index {
		var cursor = start // range position
		var diff = 0

		while strIndex > cursor {
