mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
Allow using <
/>
and ,
/.
in sticky range select mode in patch explorer
They still cancel hunk selection mode, setting it to line selection mode, but if range selection mode is on, we keep it on.
This commit is contained in:
parent
56a6ee6afb
commit
d3940729eb
2 changed files with 14 additions and 8 deletions
|
@ -123,6 +123,12 @@ func (s *State) SetLineSelectMode() {
|
|||
s.selectMode = LINE
|
||||
}
|
||||
|
||||
func (s *State) DismissHunkSelectMode() {
|
||||
if s.SelectingHunk() {
|
||||
s.selectMode = LINE
|
||||
}
|
||||
}
|
||||
|
||||
// For when you move the cursor without holding shift (meaning if we're in
|
||||
// a non-sticky range select, we'll cancel it)
|
||||
func (s *State) SelectLine(newSelectedLineIdx int) {
|
||||
|
@ -239,7 +245,7 @@ func (s *State) CurrentLineNumber() int {
|
|||
}
|
||||
|
||||
func (s *State) AdjustSelectedLineIdx(change int) {
|
||||
s.SetLineSelectMode()
|
||||
s.DismissHunkSelectMode()
|
||||
s.SelectLine(s.selectedLineIdx + change)
|
||||
}
|
||||
|
||||
|
@ -256,12 +262,12 @@ func (s *State) PlainRenderSelected() string {
|
|||
}
|
||||
|
||||
func (s *State) SelectBottom() {
|
||||
s.SetLineSelectMode()
|
||||
s.DismissHunkSelectMode()
|
||||
s.SelectLine(s.patch.LineCount() - 1)
|
||||
}
|
||||
|
||||
func (s *State) SelectTop() {
|
||||
s.SetLineSelectMode()
|
||||
s.DismissHunkSelectMode()
|
||||
s.SelectLine(0)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue