vim7 (and lower): mousem=popup_setpos problems

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

vim7 (and lower): mousem=popup_setpos problems

Mikołaj Machowski
Hello,


When doing mapping

:map <C-LeftMouse> :popup Buffers<cr>

with setting
set mousem=popup_setpos
or
set mousem=popup

Popup menu is called on cursor position, not place of mouse click.

Looks like it is the cause always when redefining map for calling popup
menu. Even simple

map <RightMouse> :popup File<cr>

Has the same unexpected behaviour.

m.

--
LaTeX + Vim = http://vim-latex.sourceforge.net/
Vim-list(s) Users Map: (last change 15 May)
 http://skawina.eu.org/mikolaj/vimlist
CLEWN - http://clewn.sf.net

Reply | Threaded
Open this post in threaded view
|

Re: vim7 (and lower): mousem=popup_setpos problems

Bram Moolenaar

Mikolaj Machowski wrote:

> When doing mapping
>
> :map <C-LeftMouse> :popup Buffers<cr>
>
> with setting
> set mousem=popup_setpos
> or
> set mousem=popup
>
> Popup menu is called on cursor position, not place of mouse click.
>
> Looks like it is the cause always when redefining map for calling popup
> menu. Even simple
>
> map <RightMouse> :popup File<cr>
>
> Has the same unexpected behaviour.

The 'mousemodel' option is used for the default behavior of the mouse
buttons, not for mappings.

You can sort-of do it by including <LeftMouse> in your mapping:

        :map <RightMouse> <LeftMouse>:popup File<CR>

Only problem is that :popup always uses the cursor position, not the
mouse coordinates.  Changing that requires doing it for every
system-specific GUI, thus that is not a quick hack.  But I'll see what I
can do...

--
hundred-and-one symptoms of being an internet addict:
10E. You start counting in hex.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///