Skip to content

Commit 50e8fe0

Browse files
committed
Clean up
1 parent 20a5fbb commit 50e8fe0

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

theme.bash

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ function __color {
7676
}
7777

7878
function __powerline_user_info_prompt {
79-
80-
8179
local user_info=""
8280
local color=${USER_INFO_PROMPT_COLOR}
8381
if [[ -n "${SSH_CLIENT}" ]]; then
@@ -93,7 +91,6 @@ function __powerline_cwd_prompt {
9391
}
9492

9593
function __powerline_scm_prompt {
96-
9794
git_local_branch=""
9895
git_branch=""
9996
git_dirty=""
@@ -105,7 +102,6 @@ function __powerline_scm_prompt {
105102

106103
find_git_branch() {
107104
# Based on: http://stackoverflow.com/a/13003854/170413
108-
109105
git_local_branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
110106

111107
if [[ -n "$git_local_branch" ]]; then
@@ -122,7 +118,6 @@ function __powerline_scm_prompt {
122118
}
123119

124120
find_git_dirty() {
125-
126121
# All dirty files (modified and untracked)
127122
local status_count=$(git status --porcelain 2> /dev/null | wc -l)
128123

@@ -136,7 +131,6 @@ function __powerline_scm_prompt {
136131
}
137132

138133
find_git_ahead_behind() {
139-
140134
if [[ -n "$git_local_branch" ]] && [[ "$git_branch" != "HEAD" ]]; then
141135
local upstream_branch=$(git rev-parse --abbrev-ref "@{upstream}" 2> /dev/null)
142136
# If we get back what we put in, then that means the upstream branch was not found. (This was observed on git 1.7.10.4 on Ubuntu)
@@ -171,51 +165,40 @@ function __powerline_scm_prompt {
171165

172166
scm_info="${SCM_GIT_CHAR}${git_branch}"
173167
[[ -n "$git_dirty" ]] && color=${SCM_PROMPT_DIRTY_COLOR} || color=${SCM_PROMPT_CLEAN_COLOR}
174-
175168
[[ -n "$git_behind" ]] && scm_info+="${SCM_PROMPT_BEHIND}${git_behind_count}"
176169
[[ -n "$git_ahead" ]] && scm_info+="${SCM_PROMPT_AHEAD}${git_ahead_count}"
177170

178-
179171
[[ -n "${scm_info}" ]] && echo "${scm_info}|${color}"
180172
}
181173

182174
function __powerline_left_segment {
183175
local OLD_IFS="${IFS}"; IFS="|"
184176
local params=( $1 )
185-
186177
IFS="${OLD_IFS}"
187-
188178
local separator_char="${POWERLINE_LEFT_SEPARATOR}"
189179
local separator=""
190180
local styles=( ${params[1]} )
191181

192-
193182
if [[ "${SEGMENTS_AT_LEFT}" -gt 0 ]]; then
194183
styles[1]=${LAST_SEGMENT_COLOR}
195184
styles[2]=""
196-
197185
separator="$(__color ${styles[@]})${separator_char}"
198186
fi
199187

200188
styles=( ${params[1]} )
201189
LEFT_PROMPT+="${separator}$(__color ${styles[@]})${params[0]}"
202190

203-
204191
#Save last background for next segment
205192
LAST_SEGMENT_COLOR=${styles[0]}
206193
(( SEGMENTS_AT_LEFT += 1 ))
207194
}
208195

209196
function __powerline_last_status_prompt {
210-
211-
212197
local symbols=()
213198
[[ $last_status -ne 0 ]] && symbols+="$(__color ${STATUS_PROMPT_ERROR_COLOR})${STATUS_PROMPT_ERROR}"
214199
[[ $UID -eq 0 ]] && symbols+="$(__color ${STATUS_PROMPT_ROOT_COLOR})${STATUS_PROMPT_ROOT}"
215200
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="$(__color ${STATUS_PROMPT_JOBS_COLOR})${STATUS_PROMPT_JOBS}"
216201

217-
218-
219202
[[ -n "$symbols" ]] && echo "$symbols|${STATUS_PROMPT_COLOR}"
220203
}
221204

@@ -234,7 +217,6 @@ function __powerline_prompt_command {
234217
done
235218

236219
[[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(__color - ${LAST_SEGMENT_COLOR})${separator_char}$(__color)"
237-
238220
PS1="${LEFT_PROMPT} "
239221

240222
## cleanup ##

0 commit comments

Comments
 (0)