Fix result and cursor placement in editor upon 'print-it'

This should fix #219.