mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
Remove duplicate function
ResizeConfirmationPanel and resizeConfirmationPanel were identical, get rid of one of them.
This commit is contained in:
parent
34d7afc0e9
commit
ccc620e5fc
1 changed files with 2 additions and 23 deletions
|
@ -169,7 +169,7 @@ func (self *ConfirmationHelper) prepareConfirmationPanel(
|
|||
suggestionsView.Subtitle = ""
|
||||
}
|
||||
|
||||
self.ResizeConfirmationPanel()
|
||||
self.resizeConfirmationPanel()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ func (self *ConfirmationHelper) CreatePopupPanel(ctx goContext.Context, opts typ
|
|||
textArea := confirmationView.TextArea
|
||||
textArea.Clear()
|
||||
textArea.TypeString(opts.Prompt)
|
||||
self.ResizeConfirmationPanel()
|
||||
self.resizeConfirmationPanel()
|
||||
confirmationView.RenderTextArea()
|
||||
} else {
|
||||
self.c.ResetViewOrigin(confirmationView)
|
||||
|
@ -317,27 +317,6 @@ func (self *ConfirmationHelper) getSelectedSuggestionValue() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
func (self *ConfirmationHelper) ResizeConfirmationPanel() {
|
||||
suggestionsViewHeight := 0
|
||||
if self.c.Views().Suggestions.Visible {
|
||||
suggestionsViewHeight = 11
|
||||
}
|
||||
panelWidth := self.getPopupPanelWidth()
|
||||
prompt := self.c.Views().Confirmation.Buffer()
|
||||
wrap := true
|
||||
if self.c.Views().Confirmation.Editable {
|
||||
prompt = self.c.Views().Confirmation.TextArea.GetContent()
|
||||
wrap = false
|
||||
}
|
||||
panelHeight := getMessageHeight(wrap, prompt, panelWidth) + suggestionsViewHeight
|
||||
x0, y0, x1, y1 := self.getPopupPanelDimensionsAux(panelWidth, panelHeight)
|
||||
confirmationViewBottom := y1 - suggestionsViewHeight
|
||||
_, _ = self.c.GocuiGui().SetView(self.c.Views().Confirmation.Name(), x0, y0, x1, confirmationViewBottom, 0)
|
||||
|
||||
suggestionsViewTop := confirmationViewBottom + 1
|
||||
_, _ = self.c.GocuiGui().SetView(self.c.Views().Suggestions.Name(), x0, suggestionsViewTop, x1, suggestionsViewTop+suggestionsViewHeight, 0)
|
||||
}
|
||||
|
||||
func (self *ConfirmationHelper) ResizeCurrentPopupPanel() error {
|
||||
c := self.c.CurrentContext()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue