HandleAction checks if the diff view supports the provided action and executes it if so
(action Action)
| 783 | |
| 784 | // HandleAction checks if the diff view supports the provided action and executes it if so |
| 785 | func (diffView *DiffView) HandleAction(action Action) (err error) { |
| 786 | log.Debugf("DiffView handling action %v", action) |
| 787 | diffView.lock.Lock() |
| 788 | defer diffView.lock.Unlock() |
| 789 | |
| 790 | var handled bool |
| 791 | if handler, ok := diffView.handlers[action.ActionType]; ok { |
| 792 | log.Debugf("Action handled by DiffView") |
| 793 | err = handler(diffView, action) |
| 794 | } else if handled, err = diffView.AbstractWindowView.HandleAction(action); handled { |
| 795 | log.Debugf("Action handled by AbstractWindowView") |
| 796 | } else { |
| 797 | log.Debugf("Action not handled") |
| 798 | } |
| 799 | |
| 800 | return |
| 801 | } |
| 802 | |
| 803 | func (diffView *DiffView) line(lineIndex uint) (line string) { |
| 804 | diffLines, ok := diffView.diffs[diffView.activeDiff] |
nothing calls this directly
no test coverage detected