diff options
| author | Kujtim Hoxha <[email protected]> | 2025-04-04 15:05:48 +0200 |
|---|---|---|
| committer | Kujtim Hoxha <[email protected]> | 2025-04-04 15:05:48 +0200 |
| commit | fa5840cf7524c85a90679ce257e34a1558b145f7 (patch) | |
| tree | d7a201b79a263d0a4174f10f8fae9c4e257ca310 /internal | |
| parent | 1d467dfda339623847bd4f86065dce794fb39ef3 (diff) | |
| download | opencode-fa5840cf7524c85a90679ce257e34a1558b145f7.tar.gz opencode-fa5840cf7524c85a90679ce257e34a1558b145f7.zip | |
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 <[email protected]>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/tui/components/dialog/permission.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/internal/tui/components/dialog/permission.go b/internal/tui/components/dialog/permission.go index ec8491898..085744dda 100644 --- a/internal/tui/components/dialog/permission.go +++ b/internal/tui/components/dialog/permission.go @@ -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) |
