@@ -60,6 +60,9 @@ type permissionDialogCmp struct {
60 cachedContent string
60 cachedContent string
61 contentDirty bool
61 contentDirty bool
63+ positionRow int // Row position for dialog
64+ positionCol int // Column position for dialog
63 keyMap KeyMap
66 keyMap KeyMap
@@ -446,6 +449,9 @@ func (p *permissionDialogCmp) render() string {
446 p.contentViewPort.SetHeight(contentHeight)
449 p.contentViewPort.SetHeight(contentHeight)
447 p.contentViewPort.SetContent(contentFinal)
450 p.contentViewPort.SetContent(contentFinal)
452+ p.positionRow = p.wHeight / 2
453+ p.positionRow -= (contentHeight + 9) / 2
449 var contentHelp string
455 var contentHelp string
450 if p.supportsDiffView() {
456 if p.supportsDiffView() {
451 contentHelp = help.New().View(p.keyMap)
457 contentHelp = help.New().View(p.keyMap)
@@ -509,7 +515,10 @@ func (p *permissionDialogCmp) SetSize() tea.Cmd {
509 if oldWidth != p.width || oldHeight != p.height {
515 if oldWidth != p.width || oldHeight != p.height {
510 p.contentDirty = true
516 p.contentDirty = true
512−
518+ p.positionRow = p.wHeight / 2
519+ p.positionRow -= p.height / 2
520+ p.positionCol = p.wWidth / 2
521+ p.positionCol -= p.width / 2
513 return nil
522 return nil
@@ -529,9 +538,5 @@ func (p *permissionDialogCmp) ID() dialogs.DialogID {
530// Position implements PermissionDialogCmp.
539// Position implements PermissionDialogCmp.
531func (p *permissionDialogCmp) Position() (int, int) {
540func (p *permissionDialogCmp) Position() (int, int) {
532− row := (p.wHeight / 2) - 2 // Just a bit above the center
541+ return p.positionRow, p.positionCol