@@ -186,6 +186,47 @@ func (gui *Gui) branchCommitsListContext() IListContext {
186186 }
187187}
188188
189+ func (gui * Gui ) subCommitsListContext () IListContext {
190+ parseEmoji := gui .Config .GetUserConfig ().Git .ParseEmoji
191+ return & ListContext {
192+ BasicContext : & BasicContext {
193+ ViewName : "branches" ,
194+ WindowName : "branches" ,
195+ Key : SUB_COMMITS_CONTEXT_KEY ,
196+ Kind : SIDE_CONTEXT ,
197+ },
198+ GetItemsLength : func () int { return len (gui .State .SubCommits ) },
199+ OnGetPanelState : func () IListPanelState { return gui .State .Panels .SubCommits },
200+ OnFocus : gui .handleSubCommitSelect ,
201+ Gui : gui ,
202+ GetDisplayStrings : func (startIdx int , length int ) [][]string {
203+ selectedCommitSha := ""
204+ if gui .currentContext ().GetKey () == SUB_COMMITS_CONTEXT_KEY {
205+ selectedCommit := gui .getSelectedSubCommit ()
206+ if selectedCommit != nil {
207+ selectedCommitSha = selectedCommit .Sha
208+ }
209+ }
210+ return presentation .GetCommitListDisplayStrings (
211+ gui .State .SubCommits ,
212+ gui .State .ScreenMode != SCREEN_NORMAL ,
213+ gui .cherryPickedCommitShaMap (),
214+ gui .State .Modes .Diffing .Ref ,
215+ parseEmoji ,
216+ selectedCommitSha ,
217+ startIdx ,
218+ length ,
219+ gui .shouldShowGraph (),
220+ )
221+ },
222+ SelectedItem : func () (ListItem , bool ) {
223+ item := gui .getSelectedSubCommit ()
224+ return item , item != nil
225+ },
226+ RenderSelection : true ,
227+ }
228+ }
229+
189230func (gui * Gui ) shouldShowGraph () bool {
190231 value := gui .Config .GetUserConfig ().Git .Log .ShowGraph
191232 switch value {
@@ -230,47 +271,6 @@ func (gui *Gui) reflogCommitsListContext() IListContext {
230271 }
231272}
232273
233- func (gui * Gui ) subCommitsListContext () IListContext {
234- parseEmoji := gui .Config .GetUserConfig ().Git .ParseEmoji
235- return & ListContext {
236- BasicContext : & BasicContext {
237- ViewName : "branches" ,
238- WindowName : "branches" ,
239- Key : SUB_COMMITS_CONTEXT_KEY ,
240- Kind : SIDE_CONTEXT ,
241- },
242- GetItemsLength : func () int { return len (gui .State .SubCommits ) },
243- OnGetPanelState : func () IListPanelState { return gui .State .Panels .SubCommits },
244- OnFocus : gui .handleSubCommitSelect ,
245- Gui : gui ,
246- GetDisplayStrings : func (startIdx int , length int ) [][]string {
247- selectedCommitSha := ""
248- if gui .currentContext ().GetKey () == SUB_COMMITS_CONTEXT_KEY {
249- selectedCommit := gui .getSelectedSubCommit ()
250- if selectedCommit != nil {
251- selectedCommitSha = selectedCommit .Sha
252- }
253- }
254- return presentation .GetCommitListDisplayStrings (
255- gui .State .SubCommits ,
256- gui .State .ScreenMode != SCREEN_NORMAL ,
257- gui .cherryPickedCommitShaMap (),
258- gui .State .Modes .Diffing .Ref ,
259- parseEmoji ,
260- selectedCommitSha ,
261- 0 ,
262- len (gui .State .SubCommits ),
263- gui .shouldShowGraph (),
264- )
265- },
266- SelectedItem : func () (ListItem , bool ) {
267- item := gui .getSelectedSubCommit ()
268- return item , item != nil
269- },
270- RenderSelection : true ,
271- }
272- }
273-
274274func (gui * Gui ) stashListContext () IListContext {
275275 return & ListContext {
276276 BasicContext : & BasicContext {
0 commit comments