Skip to content

optimize xpns_organize_panes#185

Merged
greymd merged 12 commits intogreymd:masterfrom
ReDTerraN:optimizeorgpanes
Apr 6, 2023
Merged

optimize xpns_organize_panes#185
greymd merged 12 commits intogreymd:masterfrom
ReDTerraN:optimizeorgpanes

Conversation

@ReDTerraN
Copy link
Contributor

Instead of calling global ${TMUX_XPANES_EXEC} multiple times, we combine the layout commands into a single local $layout_command string variable and execute it in a single call to ${TMUX_XPANES_EXEC} at the end of the script.

This can should save some overhead and improve readability.

Since ${_args_num} is an integer, it is more efficient to use arithmetic evaluation with (( )) instead of the [[ ]] test operator. So I have changed it to (( _args_num > 1 )).

Please have a look at the commit and make sure its working as intended.

Cheers

@ReDTerraN
Copy link
Contributor Author

Looks like its not working as expected, I will look into this later this week.

@ReDTerraN ReDTerraN marked this pull request as draft April 5, 2023 20:11
@ReDTerraN
Copy link
Contributor Author

I found the issue, me preventing globbing and word splitting with double quotation marks made my input not work correctly.
As this is the exception that SC2086 talk about of what we are doing here, (building command line) and combined we are safe that this output will not be contaminated, I have disabled the check here.

@ReDTerraN ReDTerraN requested a review from greymd April 6, 2023 08:27
@ReDTerraN ReDTerraN marked this pull request as ready for review April 6, 2023 08:29
@greymd greymd merged commit 92d9709 into greymd:master Apr 6, 2023
@greymd
Copy link
Owner

greymd commented Apr 6, 2023

Approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants