mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-24 11:14:23 +01: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user