Revert "Revert "Checks for selection after creating a link""

This reverts commit c013098ffe645cd3687c29f7dd8ce5d82cbc409b.