mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
allow toggling tree view for commit files panel
This commit is contained in:
@ -850,20 +850,13 @@ func (gui *Gui) handleToggleDirCollapsed() error {
|
||||
|
||||
func (gui *Gui) handleToggleFileTreeView() error {
|
||||
// get path of currently selected file
|
||||
node := gui.getSelectedFileChangeNode()
|
||||
path := ""
|
||||
if node != nil {
|
||||
path = node.Path
|
||||
}
|
||||
path := gui.getSelectedPath()
|
||||
|
||||
gui.State.FileChangeManager.ToggleShowTree()
|
||||
|
||||
if path != "" {
|
||||
gui.State.FileChangeManager.ExpandToPath(path)
|
||||
}
|
||||
|
||||
// find that same node in the new format and move the cursor to it
|
||||
if path != "" {
|
||||
gui.State.FileChangeManager.ExpandToPath(path)
|
||||
index, found := gui.State.FileChangeManager.GetIndexForPath(path)
|
||||
if found {
|
||||
gui.filesListContext().GetPanelState().SetSelectedLineIdx(index)
|
||||
|
Reference in New Issue
Block a user