Skip to content

feat: do not kill side buffers in vsplit, if there's enough space #110

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

Closed
shortcuts opened this issue Dec 31, 2022 · 0 comments · Fixed by #145
Closed

feat: do not kill side buffers in vsplit, if there's enough space #110

shortcuts opened this issue Dec 31, 2022 · 0 comments · Fixed by #145
Assignees
Labels
enhancement New feature or request in progress When an issue is being working on

Comments

@shortcuts
Copy link
Owner

Describe the problem

Suggested here and here

killing buffers should only be done when there's not enough space on the screen, even in vsplit.

Describe the solution

  • side buffers are still present on vsplit with big windows
  • side buffers are disabled when there's not enough space to host more than 2 main windows

something like this: winwidth > ((padding * 2) + widthmain + (widthvsplit * nbvsplit))

@shortcuts shortcuts added enhancement New feature or request in progress When an issue is being working on labels Dec 31, 2022
@shortcuts shortcuts self-assigned this Dec 31, 2022
shortcuts added a commit that referenced this issue Jan 1, 2023
## 📃 Summary

contributes to #110

This PR aims at making the state more consistent, but also to remove
some redundancy in the internal methods.

- [x] remove redundant methods
- [x] properly spread state to global object
- [x] fix typos
- [x] expose external methods instead of internal ones
- [ ] update `split` state implementation to hold many `split` windows

There's no behavioral impact.
shortcuts added a commit that referenced this issue Jan 19, 2023
## 📃 Summary

supersede #113
closes #110

This PR aims at keeping the side buffers open while entering in vsplit.
The goal is to be able to make the side buffer resizes until there's no
space left so we can close them, and re-create them along the way.

- [x] resize side buffers until there's no more space left
- [x] nvim default behaviors of split/vsplit is kept intact
- [x] vsplit tests
- [x] split tests
- [x] vsplit + split tests
- [x] cleanup code
- [x] leverage init instead of resize

## 📸 Preview

|before|after|
|------|------|
| <img width="1280" alt="Screenshot 2023-01-19 at 21 43 43"
src="https://user-images.githubusercontent.com/20689156/213555565-2f5eb639-8675-4b80-b329-f60463e8f24e.png">
| <img width="1280" alt="Screenshot 2023-01-19 at 21 42 28"
src="https://user-images.githubusercontent.com/20689156/213555361-11b85fba-4aeb-4a11-8d89-cdd144352a79.png">
|
| <img width="1280" alt="Screenshot 2023-01-19 at 21 45 46"
src="https://user-images.githubusercontent.com/20689156/213555908-06f65d5d-3dc9-446a-9304-cb085a605303.png">
| <img width="1280" alt="Screenshot 2023-01-19 at 21 45 29"
src="https://user-images.githubusercontent.com/20689156/213555873-3abfdb61-5d0b-4e1e-b1c8-96fc3167a8ae.png">
|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress When an issue is being working on
Projects
None yet
1 participant