Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Converting outer gaps into side-specific gaps, also allowing outer/horizontal/vertical (squashed) #249

Merged
merged 1 commit into from
Nov 5, 2018

Conversation

cameronleger
Copy link
Contributor

Single-commit version of #211

@cameronleger cameronleger force-pushed the feature-54-all-squash branch 4 times, most recently from 2ee8960 to 5f91513 Compare November 4, 2018 17:49
Copy link
Owner

@Airblader Airblader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look fine now, thank you! Also thanks for squashing the commits. The last minor thing would be to actually rephrase the commit message to something useful (a oneliner is enough). You don't need to open new PRs, you can just force push onto an existing one. This should do the trick, assuming you're on the branch of your PR:

git commit --amend -m"Implement separately configurable outer gaps on each edge"
git push --force

Drop me a message when you did that and we can finally merge this. I appreciate your patience :-)

@cameronleger
Copy link
Contributor Author

No problem! I've force pushed this branch multiple times with success. In past cases GH wouldn't even let me force push to some complex branches, so I assumed it wouldn't work here; I should've tried!

src/commands.c Outdated
} else if (!strcmp(type, "outer")) {
CMD_GAPS(outer, inner);
CMD_GAPS(inner);
} else if (!strcmp(type, "top") || !strcmp(type, "vertical") || !strcmp(type, "outer")) {
Copy link
Owner

@Airblader Airblader Nov 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I'm just stumbling across this… this logic here isn't correct anymore, is it? When using "vertical", only the "top" one will be set. Since it's else-ifs, the bottom one will never be set. This mistake is on me due to my review comment, sorry. We need to split these cases up entirely into a single strcmp per conditional and call CMD_GAPS multiple times for the combined ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, good catch. I only briefly looked at that code and took your suggestion as is. I made sure it built, but I didn't restart my entire X Session to test it 😶 Let me do that now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just pushed that change. Since the additional CMD_GAPS are now in the same scope, I pulled out the declaration of current_value and reset.

Copy link
Owner

@Airblader Airblader Nov 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be better if we instead used the generally recommend pattern for macros:

#define …      \
  do {         \
    // …       \
  } while (0)  \

That way we also don't have any scoping issues and this is how most i3 macros work as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I put them back and made that change.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for the patience. I think we are finally done now. Waiting for Travis to come back OK, then I'll merge it.

@Airblader Airblader merged commit dad7677 into Airblader:gaps-next Nov 5, 2018
@Airblader
Copy link
Owner

We've done it. :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants