Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warning + some icons proposal #76

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions autoload/promptline/slices/battery.vim
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ fun! promptline#slices#battery#function_body(options)
\' fi',
\'',
\' # linux',
\' if $( ls /sys/class/power_supply/ | grep BAT > /dev/null ) ; then',
\' for possible_battery_dir in /sys/class/power_supply/BAT*; do',
\' if [[ -d $possible_battery_dir && -f "$possible_battery_dir/energy_full" && -f "$possible_battery_dir/energy_now" ]]; then',
\' current_capacity=$( <"$possible_battery_dir/energy_now" )',
Expand All @@ -44,6 +45,7 @@ fun! promptline#slices#battery#function_body(options)
\' return',
\' fi',
\' done',
\' fi',
\'',
\'return 1',
\'}']
Expand Down
2 changes: 1 addition & 1 deletion autoload/promptline/slices/cwd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fun! promptline#slices#cwd#function_body( options )
\' local part_count=0',
\' local formatted_cwd=""',
\' local dir_sep="' . dir_sep . '"',
\' local tilde="~"',
\' local tilde=""',
\'',
\' local cwd="${PWD/#$HOME/$tilde}"',
\'',
Expand Down
13 changes: 9 additions & 4 deletions autoload/promptline/slices/vcs_branch.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ fun! promptline#slices#vcs_branch#function_body(options)
let branch_symbol = promptline#symbols#get().vcs_branch
let git = get(a:options, 'git', 1)
let svn = get(a:options, 'svn', 0)
let hg = get(a:options, 'hg', 0)
let hg = get(a:options, 'hg', 1)
let fossil = get(a:options, 'fossil', 0)
let git_icon = ' '
let github_icon = ' '
let hg_icon = ' '

let lines = [
\'function __promptline_vcs_branch {',
\' local branch',
\' local branch_symbol="' . branch_symbol . '"']
\' local branch_symbol="' . branch_symbol . '"',
\' local hg_icon="' . hg_icon . '"',
\' local git_icon="' . git_icon . '"']

if git
let lines += [
Expand All @@ -17,7 +22,7 @@ fun! promptline#slices#vcs_branch#function_body(options)
\' if hash git 2>/dev/null; then',
\' if branch=$( { git symbolic-ref --quiet HEAD || git rev-parse --short HEAD; } 2>/dev/null ); then',
\' branch=${branch##*/}',
\' printf "%s" "${branch_symbol}${branch:-unknown}"',
\' printf "%s" "${git_icon}${branch:-unknown}"',
\' return',
\' fi',
\' fi']
Expand All @@ -29,7 +34,7 @@ fun! promptline#slices#vcs_branch#function_body(options)
\' # mercurial',
\' if hash hg 2>/dev/null; then',
\' if branch=$(hg branch 2>/dev/null); then',
\' printf "%s" "${branch_symbol}${branch:-unknown}"',
\' printf "%s" "${hg_icon}${branch:-unknown}"',
\' return',
\' fi',
\' fi']
Expand Down