Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Fixed home abbreviation not being exclusive with circular navigation #773

Merged
merged 3 commits into from Apr 14, 2018
Merged

Fixed home abbreviation not being exclusive with circular navigation #773

merged 3 commits into from Apr 14, 2018

Conversation

conradhaupt
Copy link
Contributor

When navigating to a sub-folder of $HOME and then back up to $HOME, the shortened directory incorrectly contains the shorten delimiter (cd; cd Documents; cd ..;' results in .../~ as the directory shown). This only seems to occur if the shorten strategy environment variable is left blank.

To solve this I added a conditional check to apply the default switch statement case only if the current_path is not $HOME (i.e. not equal to "~").

Just in case this may be more specific to my configuration, my PowerLevel9K config is shown below:

export POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir_writable dir ssh anaconda vcs)
export POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator time) 
export POWERLEVEL9K_STATUS_VERBOSE=true
export POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
export POWERLVEL9K_BACKGROUND_JOBS_VERBOSE=true```

conradhaupt and others added 3 commits March 12, 2018 14:28
This happens if a user switches from a subdirectory of $HOME
back to the home folder and truncation strategy is "truncate
folders from left". Then the folder is displayed as .../~

PR: #773
@bhilburn bhilburn changed the base branch from next to master April 14, 2018 01:52
@bhilburn
Copy link
Member

bhilburn commented Apr 14, 2018

@conradhaupt - Thanks so much for taking the time to debug this, implement a solution, and submit it as a PR! Other users were also affected by this bug, and you had to dive right into the meat of one of our most complicated segments to fix this. Thanks so much, and welcome to P9k! =)

And thank you, @dritter, for reviewing!

@bhilburn bhilburn merged commit 0d8bfb6 into Powerlevel9k:master Apr 14, 2018
@conradhaupt conradhaupt deleted the fix_dir_nav branch April 17, 2018 06:58
@conradhaupt
Copy link
Contributor Author

@bhilburn It's an absolute pleasure to help out. powerlevel9k is a fantastic theme and I'm glad I could help resolve the bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants