Skip to content

Conversation

@rflandau
Copy link

@rflandau rflandau commented Jun 16, 2025

Describe your changes

This PR corrects didSelectFile()'s logical precendence. Currently, m.Path's nil check is included in the truth value of isDir && m.DirAllowed rather than being a separate truth value. This is due to Go considering logical AND to have a higher precedence than logical OR (source).

Related issue/discussion: N/A

Tests/Steps To Reproduce

You can recreate this issue without any Bubble Tea infrastructure. Here is a trivial example:

func main() {
	path := ""
	fmt.Printf("%v <-- Current\n", true || false && path != "")
	fmt.Printf("%v <-- After This PR\n", (true || false) && path != "")
}

Will result in:

$ go run main.go 
true <-- Current
false <-- After This PR

Checklist before requesting a review

  • I have read CONTRIBUTING.md
  • I have performed a self-review of my code

@rflandau rflandau requested a review from bashbunni as a code owner June 16, 2025 20:52
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.

1 participant