Bugfix: cursor placed before last character of a text inserted by code completion