File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,14 +181,21 @@ func (m mainModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
181181 }
182182
183183 // Route messages: key messages go only to active panel, other messages go to both.
184- switch msg .(type ) {
184+ // Exception: ctrl+d/ctrl+u always go to diffViewer for scrolling.
185+ switch msg := msg .(type ) {
185186 case tea.KeyMsg :
186- if m .activePanel == DiffViewerPanel {
187+ switch msg .String () {
188+ case "ctrl+d" , "ctrl+u" :
187189 m .diffViewer , cmd = m .diffViewer .Update (msg )
188190 cmds = append (cmds , cmd )
189- } else {
190- m .fileTree , cmd = m .fileTree .Update (msg )
191- cmds = append (cmds , cmd )
191+ default :
192+ if m .activePanel == DiffViewerPanel {
193+ m .diffViewer , cmd = m .diffViewer .Update (msg )
194+ cmds = append (cmds , cmd )
195+ } else {
196+ m .fileTree , cmd = m .fileTree .Update (msg )
197+ cmds = append (cmds , cmd )
198+ }
192199 }
193200 default :
194201 m .diffViewer , cmd = m .diffViewer .Update (msg )
You can’t perform that action at this time.
0 commit comments