Tom wrote:
>
>> I see no way to know that the left mouse click occurred while on the status
>> line bar in order to avoid the file opening action
>>
>
> I find it slightly odd that a click on the the status line bar
> triggers a map in the window but there certainly is a reason for that.
> Anyway, I think you could test v:mouse_lnum < line('w$'). It seems to
> me that the value of v:mouse_lnum is one off if you click on the
> status bar.
>
That almost does it, but not entirely. It works correctly if there're
more text
lines than fit on a window; however, if there are fewer lines, it appears
that v:mouse_lnum == line('w$') == line('$') . Here's my test code:
" check if the status bar was clicked on instead of a file/directory name
call feedkeys("\<LeftMouse>")
let c= getchar()
let mouse_lnum = v:mouse_lnum
let wlastline = line('w$')
let lastline = line('$')
call Decho("v:mouse_lnum=".mouse_lnum." line(w$)=".wlastline."
line($)=".lastline)
if mouse_lnum == wlastline + 1
call Decho("appears to be a status bar leftmouse click")
" appears to be a status bar leftmouse click
return
endif
At least when it works its correct. (I'm using the Decho plugin to
support Decho, BTW)
Thank you,
Chip Campbell
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---