Page 1 of 1

Close last tab in 2nd pane should hide 2ndpane (insted of showing tab cannot be closed)

Posted: 21 Jun 2022 14:23
by Yogui
When closing the last tab in 2nd pane do hide the 2nd pane (insted of showing cannot be closed message box)

May be add an option "close pane instead of last tab" in the Configuration "Tabs and Panes" > "Dual Pane"

Re: Close last tab in 2nd panel to close panel (insted of showing cannot be closed)

Posted: 21 Jun 2022 17:09
by RalphM
It is a dual pane file manager and each pane has at least one tab.

Re: Close last tab in 2nd pane should hide 2ndpane (insted of showing tab cannot be closed)

Posted: 22 Jun 2022 00:40
by Yogui
Thanks RalpM,
I corrected the post grammar panel for pane
and close for hide

The wish is that:
closing the last tab in 2nd pane will hide the 2nd pane (leaving the tab as part of the 2nd pane that can shown again)
(insted of showing tab cannot be closed message box)

Re: Close last tab in 2nd pane should hide 2ndpane (insted of showing tab cannot be closed)

Posted: 22 Jun 2022 07:51
by Evolve
If you close your tabs with a middle-click (mouse wheel) as I do (don't even have [x] close button on them), then you can assign a script that will do what you want. Here is how.

Tools - Configuration - General - Custom Event Action - Clicking on Tabs - Middle-click on tab
In "Action" select "Run script", in "Script" type:

Code: Select all

load 'close_tab';
Press OK.
File - Save Settings.
Then go to XY scripts folder (you can get there by typing <xyscripts> in the address bar and pressing enter) and create a script file close_tab.xys containing this script:

Code: Select all

 $num_of_tabs = tab("get", "index", -1);
 $pane = get("pane");
 if ($pane == 2 && $num_of_tabs == 1 ){
		#802;
		#800;
	} else {
		tab("close",,indexatpos());
	}

Re: Close last tab in 2nd pane should hide 2ndpane (insted of showing tab cannot be closed)

Posted: 22 Jun 2022 09:14
by Yogui
Awsome :appl:

I wanted this for a while as I keep closing the tab and msgbox... before properly closing the pane :roll:

Re: Close last tab in 2nd pane should hide 2ndpane (insted of showing tab cannot be closed)

Posted: 14 Dec 2023 05:43
by Yogui
A small update, after updating to version 25.3 the script stopped working
as the tab("get", "index") needed -1 parameter removed fixed
updated script below, thanks!!

Code: Select all

 if (get("pane") == 2 && tab("get", "index") == 1 )
	{
		#802;
		#800;
	} else {
		tab("close",,indexatpos());
	}

Re: Close last tab in 2nd pane should hide 2ndpane (insted of showing tab cannot be closed)

Posted: 29 Nov 2025 07:25
by Yogui
A small update, I realized that tab("get", "c") is the correct way to count the tabs
updated script below, thanks!!

Code: Select all

if (get("pane") == 2 && tab("get", "c") == 1 )
	{
		#802;
		#800;
	} else {
		tab("close",,indexatpos());
	}