This is revert of 59e02d8

Adds comment describing what is it for to do not remove it later.
Merge branch 'fix-rename-broken-by-code-removal'

Removed code was actually not useless, it guaranteed correct cursor
repositioning.