Skip to content

Built-in isSet function is returning false when a value is set #366

Description

@bashbunni

Describe the bug
Built-in isSet function is returning false when a value is set. This impacts GetBorderLeft and border rendering when setting a custom border.

To Reproduce
Add the source code to a test file, then run go test -run TestIsSet

Source Code

func TestIsSet(t *testing.T) {
	leftOnly := NewStyle().
		BorderStyle(Border{Left: "   new             "}).
		BorderForeground(Color("#FFA500"))
	got := leftOnly.isSet(borderLeftKey)
	if got != true {
		t.Fatalf("expected the left border to be set, got: %#v, but the left border is: %#v", got, leftOnly.borderStyle.Left)
	}
}

gives:

--- FAIL: TestIsSet (0.00s)
    style_test.go:550: expected the left border to be set, got: false, but the left border is: "   new             "
FAIL

Expected behavior
I would expect the borderLeftKey to be set

Additional context
This is likely related to other reported border and frame size issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions