mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-03 13:21:56 +02:00
slightly better
This commit is contained in:
parent
2d90e1e8ee
commit
9b42cd2214
@ -218,9 +218,7 @@ func (gui *Gui) enterCommitFile(selectedLineIdx int) error {
|
|||||||
func (gui *Gui) switchToCommitFilesContext(refName string, isStash bool, context Context, windowName string) error {
|
func (gui *Gui) switchToCommitFilesContext(refName string, isStash bool, context Context, windowName string) error {
|
||||||
// sometimes the commitFiles view is already shown in another window, so we need to ensure that window
|
// sometimes the commitFiles view is already shown in another window, so we need to ensure that window
|
||||||
// no longer considers the commitFiles view as its main view.
|
// no longer considers the commitFiles view as its main view.
|
||||||
|
gui.resetWindowForView("commitFiles")
|
||||||
window := gui.getWindowForViewName("commitFiles")
|
|
||||||
gui.State.WindowViewNameMap[window] = window
|
|
||||||
|
|
||||||
gui.State.Panels.CommitFiles.SelectedLineIdx = 0
|
gui.State.Panels.CommitFiles.SelectedLineIdx = 0
|
||||||
gui.State.Panels.CommitFiles.refName = refName
|
gui.State.Panels.CommitFiles.refName = refName
|
||||||
|
@ -34,3 +34,9 @@ func (gui *Gui) setViewAsActiveForWindow(viewName string) {
|
|||||||
func (gui *Gui) currentWindow() string {
|
func (gui *Gui) currentWindow() string {
|
||||||
return gui.getWindowForViewName(gui.currentViewName())
|
return gui.getWindowForViewName(gui.currentViewName())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (gui *Gui) resetWindowForView(viewName string) {
|
||||||
|
window := gui.getWindowForViewName(viewName)
|
||||||
|
// we assume here that the window contains as its default view a view with the same name as the window
|
||||||
|
gui.State.WindowViewNameMap[window] = window
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user