I am using vim 8.2 in terminal with mouse support (mouse=a) and trying to define a custom mapping for <C-LeftMouse>. The mapping itself works but the problem is that vim stops setting cursor position at the mouse click with Ctrl button pressed.
Specifically, I map <C-LeftMouse> to a command that adds the word under cursor to the search history and highlights it. After clicking, the cursor position will not change and the highlighted word will be one at the old cursor position. So, I have to first do <LeftMouse> click to change the cursor position and then <C-LeftMouse> to execute my command with the new position.
I tried mapping my command to <C-LeftRelease> but in that case <C-LeftMouse> is kept mapped to the default action ("CTRL-]") which leads to jumping to a tag if it is found.
I thought about writing a function to position the cursor and execute my custom command but I am afraid it may be not trivial (I would like also to be able to click to a different window, as in the default behavior).
Is there a way to keep vim positioning the cursor automatically after assigning commands to mouse events?