Fix cursor movement after trigger insertion

Fix for issue #220.