code to preview mappings based on cursor position.