1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-25 22:32:13 +02:00

improve merge conflict flow

This commit is contained in:
Jesse Duffield
2022-01-26 01:20:19 +11:00
parent ce3bcfe37c
commit c8cc18920f
17 changed files with 396 additions and 232 deletions

View File

@@ -86,6 +86,16 @@ func (self *FileTreeViewModel) GetItemAtIndex(index int) *FileNode {
return self.tree.GetNodeAtIndex(index+1, self.collapsedPaths) // ignoring root
}
func (self *FileTreeViewModel) GetFile(path string) *models.File {
for _, file := range self.files {
if file.Name == path {
return file
}
}
return nil
}
func (self *FileTreeViewModel) GetIndexForPath(path string) (int, bool) {
index, found := self.tree.GetIndexForPath(path, self.collapsedPaths)
return index - 1, found