1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-04 03:48:07 +02:00

return nil when no file selected

This commit is contained in:
Jesse Duffield 2020-08-17 19:24:22 +10:00
parent 88d329c52a
commit 08e039bea9

View File

@ -22,7 +22,7 @@ import (
func (gui *Gui) getSelectedFile() *commands.File {
selectedLine := gui.State.Panels.Files.SelectedLine
if selectedLine == -1 {
return &commands.File{}
return nil
}
return gui.State.Files[selectedLine]