Thursday, March 4, 2010

Re: Unexpected behaviour of File browser in multi-windows environment

Matt Wozniski wrote:
On Tue, Mar 2, 2010 at 2:43 PM, Charles Campbell <Charles.E.Campbell@nasa.gov> wrote:   
Bram M came up with a modified test for determining if a mouseclick took place on the status line.  It seems to work; I've installed it into netrw v137e (http://mysite.verizon.net/astronaut/vim/index.html#NETRW).     
 For the sake of posterity, what was that method?  I'd rather not have to download two copies of netrw, extract them to seperate dirs, and diff them just to find out.  ;-)  ~Matt    

" 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$')        (modified test)
let lastline   = line('$')     ___________^____________
                              /                        \
if mouse_lnum >= wlastline + 1 || v:mouse_win != winnr()
 " appears to be a status bar leftmouse click
 return
endif


Chip Campbell


No comments:

Post a Comment