Merge branch 'master' into feature/disk_usage

This commit is contained in:
Thomas Cherry 2017-11-25 23:08:21 -06:00
commit 3d75185458
4 changed files with 31 additions and 21 deletions

View file

@ -1,5 +1,11 @@
# Changes
2017-11-25 (version 0.4.3)
* New option for `cwd` segment that allows the last directory to not be
shortened when `max_dir_size` is used
([@jceaser](https://github.com/banga/powerline-shell/pull/321)).
2017-10-16 (version 0.4.2)
* VCS segments will use ASCII `?` instead of a unicode symbol for new files.

View file

@ -248,6 +248,8 @@ The options for the `cwd` segment are:
- `max_depth`: Maximum number of directories to show in path
- `max_dir_size`: Maximum number of characters displayed for each directory in
the path
- `full_cwd`: If true, the last directory will not be shortened when
`max_dir_size` is used.
The `hostname` segment provides one option:

View file

@ -64,6 +64,7 @@ def add_cwd_segment(powerline):
names = split_path_into_names(cwd)
full_cwd = powerline.segment_conf("cwd", "full_cwd", False)
max_depth = powerline.segment_conf("cwd", "max_depth", 5)
if max_depth <= 0:
warn("Ignoring cwd.max_depth option since it's not greater than 0")
@ -93,9 +94,9 @@ def add_cwd_segment(powerline):
separator = None
separator_fg = None
powerline.append(' %s ' % maybe_shorten_name(powerline, name), fg, bg,
separator, separator_fg)
if not (is_last_dir and full_cwd):
name = maybe_shorten_name(powerline, name)
powerline.append(' %s ' % name, fg, bg, separator, separator_fg)
class Segment(BasicSegment):
def add_to_powerline(self):

View file

@ -1,22 +1,23 @@
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(name="powerline-shell",
version="0.4.2",
description="A pretty prompt for your shell",
author="Buck Ryan",
url="https://github.com/banga/powerline-shell",
classifiers=[],
packages=[
"powerline_shell",
"powerline_shell.segments",
"powerline_shell.themes",
],
install_requires=[
"argparse",
],
entry_points="""
[console_scripts]
powerline-shell=powerline_shell:main
""",
setup(
name="powerline-shell",
version="0.4.3",
description="A pretty prompt for your shell",
author="Buck Ryan",
url="https://github.com/banga/powerline-shell",
classifiers=[],
packages=[
"powerline_shell",
"powerline_shell.segments",
"powerline_shell.themes",
],
install_requires=[
"argparse",
],
entry_points="""
[console_scripts]
powerline-shell=powerline_shell:main
""",
)