Skip to content

Commit

Permalink
refactor: remove DisplayModeNever
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Dec 31, 2020
1 parent abfbb27 commit 8c68b89
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/segment_language.go
Expand Up @@ -21,8 +21,6 @@ const (
DisplayModeAlways string = "always"
// DisplayModeContext displays the segment when the current folder contains certain extensions
DisplayModeContext string = "context"
// DisplayModeNever hides the segment
DisplayModeNever string = "never"
// MissingCommandProperty sets the text to display when the command is not present in the system
MissingCommandTextProperty Property = "missing_command_text"
// MissingCommand displays empty string by default
Expand All @@ -49,8 +47,6 @@ func (l *language) enabled() bool {
switch displayMode {
case DisplayModeAlways:
return (!displayVersion || l.hasCommand())
case DisplayModeNever:
return false
case DisplayModeContext:
fallthrough
default:
Expand All @@ -72,7 +68,7 @@ func (l *language) isInContext() bool {
return true
}

// getVersion returns the version an exit code returned by the exexutable
// getVersion returns the version and exit code returned by the executable
func (l *language) getVersion() bool {
versionInfo, err := l.env.runCommand(l.executable, l.versionParam)
var exerr *commandError
Expand All @@ -88,7 +84,7 @@ func (l *language) getVersion() bool {
return true
}

// hasCommand checks if one of the commands exists and set it as executablr
// hasCommand checks if one of the commands exists and sets it as executable
func (l *language) hasCommand() bool {
for i, command := range l.commands {
commandPath, commandExists := l.env.hasCommand(command)
Expand Down

0 comments on commit 8c68b89

Please sign in to comment.