Use cursor buffer position instead of screen position

Fixes #6