code: def cursor_position_changed(self):
          
          log.debug("cursor_position_changed")
  
          cur = self.textCursor()
          log.debug(cur.position())
          log.debug(cur.selectedText())
          if len(cur.selectedText()) == 0:
              cur.select(QtGui.QTextCursor.WordUnderCursor)
              self.setTextCursor(cur)
docs: Used to detect when cursor change position and to auto select word
             underneath it