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

fix 3 bugs #2082

Merged
merged 4 commits into from
Jan 13, 2023
Merged

fix 3 bugs #2082

merged 4 commits into from
Jan 13, 2023

Conversation

wlsnx
Copy link
Contributor

@wlsnx wlsnx commented Jan 11, 2023

  1. pub fn split(direction: SplitDirection, rect: &PaneGeom) -> Option<(PaneGeom, PaneGeom)> {
    let space = match direction {
    SplitDirection::Vertical => rect.cols,
    SplitDirection::Horizontal => rect.rows,
    };
    if let Some(p) = space.as_percent() {
    let first_rect = match direction {
    SplitDirection::Vertical => PaneGeom {
    cols: Dimension::percent(p / 2.0),
    ..*rect
    },

    first_rect.cols.inner == 1.
    Between split_vertically() and relayout(), there is a change_size() call. New pane usually has a frame,so get_content_columns() returns 0, change_size() is skipped.
    However if you set pane_frames false and vertically split the right most pane, get_content_columns() returns 1.change_size() calls drain_until(1) for each row.
    Finally, drain_until(1) discard first widechar and all characters behind it.

  2. ZELLIJ_SOCK_DIR.join(name) should be a valid filename in directory ZELLIJ_SOCK_DIR,so name cannot equals to "." or "..", as well as contains '/'.

  3. zellij -s '' Session name cannot be empty. Please provide a specific session name.
    zellij attach --create '' Panic occured: called Result::unwrap() on an Err value: Os { code: 98, kind: AddrInUse, message: "Address already in use" }

@imsnif
Copy link
Member

imsnif commented Jan 11, 2023

Hey @wlsnx - thanks for looking into these. I do not understand the user facing impact of 1. Can you please explain it from the point of view of the user? What bug is this solving?

@wlsnx
Copy link
Contributor Author

wlsnx commented Jan 11, 2023

https://www.youtube.com/watch?v=E95MuYAxYnM
After split vertically, wide characters (Chinese, emojis, etc.) disappeared.

@wlsnx
Copy link
Contributor Author

wlsnx commented Jan 11, 2023

@imsnif This happens only if you set pane_frames false and vertically split the right most pane.

@wlsnx wlsnx temporarily deployed to cachix January 13, 2023 14:57 — with GitHub Actions Inactive
@imsnif
Copy link
Member

imsnif commented Jan 13, 2023

Great work on all of these, @wlsnx ! I added a comment to the drain_until function to explain the new conditional.

@imsnif imsnif merged commit f07c1af into zellij-org:main Jan 13, 2023
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.

2 participants