On Sat, 21 Oct 2006 at 1:59pm, Bram Moolenaar wrote: > > Hari Krishna Dara wrote: > > > When maps for mouse clicks are executed, can we have the location (in > > the form of line and column number) made available through v: variables? > > I just observed that getchar() works even with mouse clicks, but this is > > almost useless without knowing where the user clicked. Capturing mouse > > clicks along with <expr> maps or getchar() can do wonders if the mouse > > click position is also available. > > Good point, getchar() should somehow make the position of the click > available. > > It's not that easy, since the click could be in any of the windows. I > suppose we need: > v:mouse_window > v:mouse_column > v:mouse_line > > The position could be in screen columns and lines, or in text column and > line. I suppose text position is more useful. You wouldn't need the > position of a click halfway a tab, right?
For most purposes the window and text position is all that matters, but there can be some interesting possibilities if clicks outside any buffer (such as at the command-line the way inputlist() works) can also be made available (using something like v:mouse_region that can have "window", "tab", "cmdline"). -- Thank you, Hari __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com