I use Sublime Text on a Mac and I have
"show_tab_close_buttons": false
but I still need a quick way to close individual tab without using the keyboard. Is it possible to bind the double click for this somehow?
I use Sublime Text on a Mac and I have
"show_tab_close_buttons": false
but I still need a quick way to close individual tab without using the keyboard. Is it possible to bind the double click for this somehow?
I tried this:
[
{
"button": "button1", "count": 2,
"press_command": "close"
}
]
This closes the tab if I double-click in the main area. But how to make it close the tab when I double-click the tab control instead?
ChatGPT created the following plugin, but it doesn’t work:
import sublime
import sublime_plugin
class CloseTabOnDoubleClick(sublime_plugin.EventListener):
def on_text_command(self, view, command_name, args):
if command_name == "drag_select" and args and args.get("event"):
event = args["event"]
if event.get("count", 1) == 2: # Detect double-click
window = view.window()
if window:
window.run_command("close")
return None # Prevent the default action
return None
Any ideas why?
I don’t think there is a way for a plugin to detect when a tab is clicked on, I think your choices are to:
- middle click on the tab to close it
The problem is that I don’t understand how it can be simulated on MacBook’s touchpad. It seems it is not possible.