Fix KTextEditorHelpers::extractCursor
Add unit tests. Fixes project file quick open again.
Regression introduced by 8ff872e