fix formatting
rename GetSpan to GetTextSpan
implemented one level undo
fix warnings