mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-21 12:16:54 +02:00
fix: fix initial scroll position of edit box
This commit is contained in:
parent
ef82f39431
commit
3ada4dde12
@ -122,6 +122,7 @@ func (gui *Gui) prepareConfirmationPanel(
|
|||||||
gui.Views.Confirmation.Wrap = !opts.Editable
|
gui.Views.Confirmation.Wrap = !opts.Editable
|
||||||
gui.Views.Confirmation.FgColor = theme.GocuiDefaultTextColor
|
gui.Views.Confirmation.FgColor = theme.GocuiDefaultTextColor
|
||||||
gui.Views.Confirmation.Mask = runeForMask(opts.Mask)
|
gui.Views.Confirmation.Mask = runeForMask(opts.Mask)
|
||||||
|
_ = gui.Views.Confirmation.SetOrigin(0, 0)
|
||||||
|
|
||||||
gui.findSuggestions = opts.FindSuggestionsFunc
|
gui.findSuggestions = opts.FindSuggestionsFunc
|
||||||
if opts.FindSuggestionsFunc != nil {
|
if opts.FindSuggestionsFunc != nil {
|
||||||
@ -133,6 +134,7 @@ func (gui *Gui) prepareConfirmationPanel(
|
|||||||
suggestionsView.Title = fmt.Sprintf(gui.c.Tr.SuggestionsTitle, gui.c.UserConfig.Keybinding.Universal.TogglePanel)
|
suggestionsView.Title = fmt.Sprintf(gui.c.Tr.SuggestionsTitle, gui.c.UserConfig.Keybinding.Universal.TogglePanel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gui.resizeConfirmationPanel()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,8 @@ func (gui *Gui) resizeConfirmationPanel() {
|
|||||||
}
|
}
|
||||||
panelWidth := gui.getConfirmationPanelWidth()
|
panelWidth := gui.getConfirmationPanelWidth()
|
||||||
prompt := gui.Views.Confirmation.Buffer()
|
prompt := gui.Views.Confirmation.Buffer()
|
||||||
panelHeight := gui.getMessageHeight(true, prompt, panelWidth) + suggestionsViewHeight
|
wrap := !gui.Views.Confirmation.Editable
|
||||||
|
panelHeight := gui.getMessageHeight(wrap, prompt, panelWidth) + suggestionsViewHeight
|
||||||
x0, y0, x1, y1 := gui.getConfirmationPanelDimensionsAux(panelWidth, panelHeight)
|
x0, y0, x1, y1 := gui.getConfirmationPanelDimensionsAux(panelWidth, panelHeight)
|
||||||
confirmationViewBottom := y1 - suggestionsViewHeight
|
confirmationViewBottom := y1 - suggestionsViewHeight
|
||||||
_, _ = gui.g.SetView(gui.Views.Confirmation.Name(), x0, y0, x1, confirmationViewBottom, 0)
|
_, _ = gui.g.SetView(gui.Views.Confirmation.Name(), x0, y0, x1, confirmationViewBottom, 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user