Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize xpns_organize_panes #185

Merged
merged 12 commits into from Apr 6, 2023
Merged

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.

bin/xpanes Outdated Show resolved Hide resolved
@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
182 checks passed
@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.

None yet

2 participants