MCPcopy
hub / github.com/rgburke/grv / HandleAction

Method HandleAction

cmd/grv/diff_view.go:785–801  ·  view source on GitHub ↗

HandleAction checks if the diff view supports the provided action and executes it if so

(action Action)

Source from the content-addressed store, hash-verified

783
784// HandleAction checks if the diff view supports the provided action and executes it if so
785func (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
803func (diffView *DiffView) line(lineIndex uint) (line string) {
804 diffLines, ok := diffView.diffs[diffView.activeDiff]

Callers

nothing calls this directly

Calls 3

LockMethod · 0.65
UnlockMethod · 0.65
HandleActionMethod · 0.65

Tested by

no test coverage detected