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

Panic in vsplit, goto_file_vsplit (Tree::recalculate) #9877

Closed
trink opened this issue Mar 15, 2024 · 4 comments · Fixed by #10620
Closed

Panic in vsplit, goto_file_vsplit (Tree::recalculate) #9877

trink opened this issue Mar 15, 2024 · 4 comments · Fixed by #10620
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@trink
Copy link
Contributor

trink commented Mar 15, 2024

Set the terminal size, so the number of splits to cause the failure is
consistent.

stty rows 24 cols 80
hx test_document.txt

Test Document

a
b
c
d
e
f
g
h
i

Steps to Reproduce

  1. % # select_all
  2. Alt-s # split_selection_on_newline
  3. Ctrl-W F # goto_file_vsplit

Release

thread 'main' panicked at 'index out of bounds: the len is 1920 but the index is 1920', helix-tui/src/buffer.rs:517:17

Debug

thread 'main' panicked at 'attempt to subtract with overflow', helix-view/src/tree.rs:407:50

Description

The window area height calculation goes negative (overflows) when there are more windows than will fit in the display area.

Related Bugs and PRs

#1084 #4642

@trink trink changed the title Panic in vsplit, goto_file (Tree::recalculate) Panic in vsplit, goto_file_vsplit (Tree::recalculate) Mar 15, 2024
@kirawi kirawi added A-helix-term Area: Helix term improvements C-bug Category: This is a bug labels Mar 15, 2024
@pascalkuthe
Copy link
Member

this is a duplicate of #1083

@pascalkuthe pascalkuthe closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 2024
@l4l
Copy link
Contributor

l4l commented Apr 28, 2024

Actually it is not duplicate. The tabs have sufficient space for that: 10 tabs -> 80pxs.

@pascalkuthe
Copy link
Member

hmm but that other issue is not about "crash when there is not enough space to render all splits" but just "opening a large number of vsplits causes a crash" so the exact number doesn't matter. And your patch also fixes that issue too so its really the same thing.

@l4l
Copy link
Contributor

l4l commented Apr 28, 2024

#1083 still reproduces with my patch if nums of tabs > pixel width. I think the proper fix for it is #4642

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants