-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
251d760
commit 555dd82
Showing
30 changed files
with
2,200 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
package commands | ||
|
||
type Dependency struct { | ||
Name string | ||
Version string | ||
Name string | ||
Version string | ||
LinkPath string | ||
Present bool | ||
LocalVersion string | ||
} | ||
|
||
func (d *Dependency) Linked() bool { | ||
return d.LinkPath != "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package gui | ||
|
||
import ( | ||
"github.com/jesseduffield/gocui" | ||
"github.com/jesseduffield/lazynpm/pkg/commands" | ||
) | ||
|
||
// list panel functions | ||
|
||
func (gui *Gui) getSelectedDependency() *commands.Dependency { | ||
currentPackage := gui.currentPackage() | ||
|
||
deps := currentPackage.SortedDependencies() | ||
if len(deps) == 0 { | ||
return nil | ||
} | ||
return deps[gui.State.Panels.Deps.SelectedLine] | ||
} | ||
|
||
func (gui *Gui) handleDepSelect(g *gocui.Gui, v *gocui.View) error { | ||
dep := gui.getSelectedDependency() | ||
if dep == nil { | ||
gui.getMainView().Title = "" | ||
return gui.newStringTask("main", gui.Tr.SLocalize("NoDependencies")) | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.