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

feat: adapt to https://github.com/sxyazi/yazi/pull/1257 #4

Merged
merged 1 commit into from
Jul 15, 2024
Merged

Conversation

sxyazi
Copy link
Contributor

@sxyazi sxyazi commented Jul 15, 2024

Note that the latest main branch is required

@Rolv-Apneseth
Copy link
Owner

Oh nice, I haven't been keeping up with the latest changes so hadn't noticed the breaking change. I'll merge this and make a note in the readme, thank you. If you ever want to just move this to yazi-rs/plugins just let me know, this is all you anyway.

@Rolv-Apneseth Rolv-Apneseth merged commit f386ea3 into Rolv-Apneseth:main Jul 15, 2024
@Rolv-Apneseth
Copy link
Owner

Rolv-Apneseth commented Jul 15, 2024

Actually @sxyazi, I see Manager is also removed now. How would I go about updating this snippet?

function Manager:render(area)
    local chunks = self:layout(area)

    local bar = function(c, x, y)
        x, y = math.max(0, x), math.max(0, y)
        return ui.Bar(
            ui.Rect({
                x = x,
                y = y,
                w = ya.clamp(0, area.w - x, 1),
                h = math.min(1, area.h),
            }),
            ui.Bar.TOP
        ):symbol(c)
    end

    return ya.flat({
        -- Borders
        ui.Bar(chunks[1], ui.Bar.RIGHT)
            :symbol(THEME.manager.border_symbol)
            :style(THEME.manager.border_style),
        ui.Bar(chunks[3], ui.Bar.LEFT)
            :symbol(THEME.manager.border_symbol)
            :style(THEME.manager.border_style),

        bar("", chunks[1].right - 1, chunks[1].y),
        bar("", chunks[1].right - 1, chunks[1].bottom - 1),
        bar("", chunks[2].right, chunks[2].y),
        bar("", chunks[2].right, chunks[1].bottom - 1),

        -- Parent
        Parent:render(chunks[1]:padding(ui.Padding.xy(1))),
        -- Current
        Current:render(chunks[2]:padding(ui.Padding.y(1))),
        -- Preview
        Preview:render(chunks[3]:padding(ui.Padding.xy(1))),
    })
end

Edit: nvm, think I got it by adapting that full border plugin

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