File tree Expand file tree Collapse file tree 4 files changed +31
-0
lines changed Expand file tree Collapse file tree 4 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -402,6 +402,8 @@ neogit.setup {
402
402
[" ]c" ] = " OpenOrScrollDown" ,
403
403
[" <c-k>" ] = " PeekUp" ,
404
404
[" <c-j>" ] = " PeekDown" ,
405
+ [" <c-n>" ] = " NextSection" ,
406
+ [" <c-p>" ] = " PreviousSection" ,
405
407
},
406
408
},
407
409
}
Original file line number Diff line number Diff line change @@ -1479,4 +1479,29 @@ M.n_command = function(self)
1479
1479
})
1480
1480
end )
1481
1481
end
1482
+
1483
+ --- @param self StatusBuffer
1484
+ M .n_next_section = function (self )
1485
+ return function ()
1486
+ local section = self .buffer .ui :get_current_section ()
1487
+ if section then
1488
+ local position = section .position .row_end + 2
1489
+ self .buffer :move_cursor (position )
1490
+ end
1491
+ end
1492
+ end
1493
+
1494
+ --- @param self StatusBuffer
1495
+ M .n_prev_section = function (self )
1496
+ return function ()
1497
+ local section = self .buffer .ui :get_current_section ()
1498
+ if section then
1499
+ local prev_section = self .buffer .ui :get_current_section (section .position .row_start - 1 )
1500
+ if prev_section then
1501
+ self .buffer :move_cursor (prev_section .position .row_start + 1 )
1502
+ end
1503
+ end
1504
+ end
1505
+ end
1506
+
1482
1507
return M
Original file line number Diff line number Diff line change @@ -171,6 +171,8 @@ function M:open(kind)
171
171
[mappings [" TabOpen" ]] = self :_action (" n_tab_open" ),
172
172
[mappings [" SplitOpen" ]] = self :_action (" n_split_open" ),
173
173
[mappings [" VSplitOpen" ]] = self :_action (" n_vertical_split_open" ),
174
+ [mappings [" NextSection" ]] = self :_action (" n_next_section" ),
175
+ [mappings [" PreviousSection" ]] = self :_action (" n_prev_section" ),
174
176
[popups .mapping_for (" BisectPopup" )] = self :_action (" n_bisect_popup" ),
175
177
[popups .mapping_for (" BranchPopup" )] = self :_action (" n_branch_popup" ),
176
178
[popups .mapping_for (" CherryPickPopup" )] = self :_action (" n_cherry_pick_popup" ),
Original file line number Diff line number Diff line change @@ -633,6 +633,8 @@ function M.get_default_values()
633
633
[" ]c" ] = " OpenOrScrollDown" ,
634
634
[" <c-k>" ] = " PeekUp" ,
635
635
[" <c-j>" ] = " PeekDown" ,
636
+ [" <c-n>" ] = " NextSection" ,
637
+ [" <c-p>" ] = " PreviousSection" ,
636
638
},
637
639
},
638
640
}
You can’t perform that action at this time.
0 commit comments