mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-14 17:46:26 -04:00
Carry hunk mode into the other pane on a cross-pane click
Clicking the staged/unstaged pane you weren't focused on selected a single line the first time, even in hunk mode, because that pane's select mode was still its default until it had been focused once (tabbing to it and back was the workaround). Seed the clicked pane's mode from the one we're leaving so the very first click there behaves like every later one. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0aab64e362
commit
e03f4b1321
|
|
@ -977,6 +977,12 @@ func (self *MainViewController) editClickedLine(opts gocui.ViewMouseBindingOpts)
|
|||
}
|
||||
|
||||
func (self *MainViewController) onClickInOtherViewOfMainViewPair(opts gocui.ViewMouseBindingOpts) error {
|
||||
// Carry the select mode over from the pane we're leaving, so clicking into the
|
||||
// other pane keeps hunk mode even the first time we enter it — without this its
|
||||
// mode would still be the default single line until it had been focused at least
|
||||
// once (e.g. by tabbing to it). selectClickedDiffLine then preserves or collapses
|
||||
// that mode depending on where we clicked.
|
||||
*self.context.DiffSelectState() = *self.otherContext.DiffSelectState()
|
||||
self.c.Context().Push(self.context, types.OnFocusOpts{})
|
||||
return self.selectClickedDiffLine(opts)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue