fixed text selection with --flatten