From e9474c8c82745d82ffb39ff1618a96b10f724077 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 24 Jul 2016 15:40:55 -0400 Subject: Added `events.TAB_CLICKED` event. This allows for the user to override the default switch behavior (e.g. switch to an existing split view that already has the target buffer open). Thanks to Gabriel Dubatti. --- core/ui.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/ui.lua') diff --git a/core/ui.lua b/core/ui.lua index a30b5e7a..06d68776 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -302,6 +302,10 @@ events_connect(events.BUFFER_NEW, function() buffer:private_lexer_call(SETLEXERLANGUAGE, 'text') end) +-- Switches between buffers when a tab is clicked. +events_connect(events.TAB_CLICKED, + function(index) view:goto_buffer(_BUFFERS[index]) end) + -- Sets the title of the Textadept window to the buffer's filename. local function set_title() local filename = buffer.filename or buffer._type or _L['Untitled'] -- cgit v1.2.3