mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-08-28 02:24:49 -05:00
Give the list views the same edge autoscroll during drag selection that the staging view already has; the new mouse-release binding stops the autoscroll when the drag ends.
48 lines
1.2 KiB
Go
48 lines
1.2 KiB
Go
package ui
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
var RangeSelectWithAutoscroll = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Keep scrolling while creating a range selection at the panel edge",
|
|
ExtraCmdArgs: []string{},
|
|
Skip: false,
|
|
Width: 120,
|
|
Height: 30,
|
|
SetupConfig: func(config *config.AppConfig) {
|
|
config.GetUserConfig().Gui.UseHunkModeInStagingView = false
|
|
},
|
|
SetupRepo: func(shell *Shell) {
|
|
shell.CreateNCommits(40)
|
|
fileContent := "base\n"
|
|
shell.CreateFileAndAdd("file1", fileContent)
|
|
for i := 1; i <= 40; i++ {
|
|
fileContent += fmt.Sprintf("line %d\n", i)
|
|
}
|
|
shell.UpdateFile("file1", fileContent)
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.Views().Branches().Focus()
|
|
t.Views().Commits().
|
|
ClickAndHold(1, 0).
|
|
MouseMoveToBottom(1).
|
|
OriginYAtLeast(3).
|
|
SelectedLineIdxAtLeast(3).
|
|
MouseRelease()
|
|
|
|
t.Views().Files().
|
|
Focus().
|
|
PressEnter()
|
|
t.Views().Staging().
|
|
ClickAndHold(1, 6).
|
|
MouseMoveToBottom(1).
|
|
OriginYAtLeast(3).
|
|
SelectedLineIdxAtLeast(9).
|
|
MouseRelease()
|
|
},
|
|
})
|