Update main.js

When no text is selected the word at the current cursor position will be selected. This way there is no need anymore to select the word to search for, simply putting the cursor somewhere in the word is sufficient.