mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-28 16:02:01 +03:00
Support selecting file range in patch builder
test: add move_range_to_index test: add toggle_range
This commit is contained in:
committed by
Jesse Duffield
parent
9b2a5f636a
commit
510f9a1ae1
@ -80,7 +80,18 @@ func (self *CommitFileTreeViewModel) GetSelectedItemId() string {
|
||||
}
|
||||
|
||||
func (self *CommitFileTreeViewModel) GetSelectedItems() ([]*CommitFileNode, int, int) {
|
||||
panic("Not implemented")
|
||||
if self.Len() == 0 {
|
||||
return nil, 0, 0
|
||||
}
|
||||
|
||||
startIdx, endIdx := self.GetSelectionRange()
|
||||
|
||||
nodes := []*CommitFileNode{}
|
||||
for i := startIdx; i <= endIdx; i++ {
|
||||
nodes = append(nodes, self.Get(i))
|
||||
}
|
||||
|
||||
return nodes, startIdx, endIdx
|
||||
}
|
||||
|
||||
func (self *CommitFileTreeViewModel) GetSelectedItemIds() ([]string, int, int) {
|
||||
|
Reference in New Issue
Block a user