reduce code
set text select index to the end
Merge pull request #1 from wenhuix/master

push modify to CRC version