Re: [code] MMB click on tab bar (FR)

From: Mitchell <m.att.foicica.com>
Date: Thu, 12 Sep 2019 16:58:46 -0400 (EDT)

Hi Lukas,

On Wed, 11 Sep 2019, Procházka Lukáš Ing. wrote:

> Hello Mitchell,
>
> many editors allow to close the active document clicking by the middle mouse
> button (MMB) on the document tab.
>
> Would it be possible to generate an event when user clicks by MMB on the tab
> bar, witch an additional info about buffer being clicked?
>
> (This is just a feature request, not necessary needs to be implemented.)

Yes, it would be possible to generate such an event. Right now, *src/textadept.c*'s `t_tabbuttonpress()` function discards any button clicks except for right-click. You'd want to allow for middle-clicks and then emit a new event into Textadept's Lua state, something like:

   lL_event(lua, "tab_middle_clicked", LUA_TNUMBER, page_num + 1, -1);

where `page_num` is the page you determine was clicked (code that can help is in `t_tabbuttonpress()`).

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Thu 12 Sep 2019 - 16:58:46 EDT

This archive was generated by hypermail 2.2.0 : Fri 13 Sep 2019 - 06:47:38 EDT