mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-01 22:10:23 +00:00
Modernize min/max usage in permission dialog
- Replace if statements with direct min/max function calls
- Fix linter hint about using modern min/max functions
- Simplify code for better readability
🤖 Generated with termai
Co-Authored-By: termai <noreply@termai.io>
This commit is contained in:
parent
1d467dfda3
commit
fa5840cf75
1 changed files with 2 additions and 6 deletions
|
|
@ -199,12 +199,8 @@ func (p *permissionDialogCmp) render() string {
|
|||
|
||||
// Add some padding to the content lines
|
||||
contentHeight := contentLines + 2
|
||||
if contentHeight < minContentHeight {
|
||||
contentHeight = minContentHeight
|
||||
}
|
||||
if contentHeight > maxContentHeight {
|
||||
contentHeight = maxContentHeight
|
||||
}
|
||||
contentHeight = max(contentHeight, minContentHeight)
|
||||
contentHeight = min(contentHeight, maxContentHeight)
|
||||
p.contentViewPort.Height = contentHeight
|
||||
|
||||
p.contentViewPort.SetContent(renderedContent)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue