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

Bug fix: Reconfigure tree properly after closing view. #10004

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

useche
Copy link
Contributor

@useche useche commented Mar 25, 2024

This patch merges the last child of a container node to the parent. This avoids the bug where uneven spaced Views would be created. To reproduce:

  1. vsplit
  2. split
  3. quit
  4. vsplit

With this patch the bug cannot be seen anymore.

@archseer
Copy link
Member

Great to have this fixed! Can you add an unit test with the scenario above? Should be enough to simply assert the tree structure is as expected after the operations

@the-mikedavis the-mikedavis added C-bug Category: This is a bug S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 26, 2024
@kirawi kirawi added S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 26, 2024
@the-mikedavis the-mikedavis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from a maintainer. labels Mar 26, 2024
@useche
Copy link
Contributor Author

useche commented Mar 27, 2024

Great to have this fixed! Can you add an unit test with the scenario above? Should be enough to simply assert the tree structure is as expected after the operations

I'm trying to put my tests in helix-term/tests/test/splits.rs, but I don't know how to run them. cargo test is not running those tests. Any suggestion?

@useche
Copy link
Contributor Author

useche commented Mar 27, 2024

Great to have this fixed! Can you add an unit test with the scenario above? Should be enough to simply assert the tree structure is as expected after the operations

I'm trying to put my tests in helix-term/tests/test/splits.rs, but I don't know how to run them. cargo test is not running those tests. Any suggestion?

Found it: cargo test --features integration

@archseer
Copy link
Member

Oh not an integration test, an unit test is enough. See the bottom of view.rs file

This patch merges the last child of a container node to the parent. This
avoids the bug where uneven spaced Views would be created. To reproduce:
1. `vsplit`
2. `split`
3. `quit`
4. `vsplit`

With this patch the bug cannot be seen anymore.
@useche
Copy link
Contributor Author

useche commented Mar 27, 2024

Oh not an integration test, an unit test is enough. See the bottom of view.rs file

Done. I couldn't find a way to check the structure of the tree with the public API, but I was able to check the width is even between views.

@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 27, 2024
@pascalkuthe pascalkuthe merged commit 190fbf6 into helix-editor:master Apr 2, 2024
6 checks passed
Desdaemon pushed a commit to Desdaemon/helix that referenced this pull request Apr 3, 2024
This patch merges the last child of a container node to the parent. This
avoids the bug where uneven spaced Views would be created. To reproduce:
1. `vsplit`
2. `split`
3. `quit`
4. `vsplit`

With this patch the bug cannot be seen anymore.
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
This patch merges the last child of a container node to the parent. This
avoids the bug where uneven spaced Views would be created. To reproduce:
1. `vsplit`
2. `split`
3. `quit`
4. `vsplit`

With this patch the bug cannot be seen anymore.
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
This patch merges the last child of a container node to the parent. This
avoids the bug where uneven spaced Views would be created. To reproduce:
1. `vsplit`
2. `split`
3. `quit`
4. `vsplit`

With this patch the bug cannot be seen anymore.
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
This patch merges the last child of a container node to the parent. This
avoids the bug where uneven spaced Views would be created. To reproduce:
1. `vsplit`
2. `split`
3. `quit`
4. `vsplit`

With this patch the bug cannot be seen anymore.
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
This patch merges the last child of a container node to the parent. This
avoids the bug where uneven spaced Views would be created. To reproduce:
1. `vsplit`
2. `split`
3. `quit`
4. `vsplit`

With this patch the bug cannot be seen anymore.
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 20, 2024
This patch merges the last child of a container node to the parent. This
avoids the bug where uneven spaced Views would be created. To reproduce:
1. `vsplit`
2. `split`
3. `quit`
4. `vsplit`

With this patch the bug cannot be seen anymore.
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
This patch merges the last child of a container node to the parent. This
avoids the bug where uneven spaced Views would be created. To reproduce:
1. `vsplit`
2. `split`
3. `quit`
4. `vsplit`

With this patch the bug cannot be seen anymore.
Vulpesx pushed a commit to Vulpesx/helix that referenced this pull request Jun 7, 2024
This patch merges the last child of a container node to the parent. This
avoids the bug where uneven spaced Views would be created. To reproduce:
1. `vsplit`
2. `split`
3. `quit`
4. `vsplit`

With this patch the bug cannot be seen anymore.
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
This patch merges the last child of a container node to the parent. This
avoids the bug where uneven spaced Views would be created. To reproduce:
1. `vsplit`
2. `split`
3. `quit`
4. `vsplit`

With this patch the bug cannot be seen anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants