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

Bug Fix Array Element Removal in _tide_pwd.fish #533

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

psycoder-sup
Copy link

Description

This pull request addresses an error occurring in the Fish shell prompt function _tide_pwd.fish. The original line of code attempts to remove an element from the glob array using an incorrect approach involving the contains command. When the list is empty this code shows error:

~/.config/fish/functions/_tide_pwd.fish (line 23):
            set -e glob[(contains -i $parent_dir/$dir_section/ $glob)] # This is faster than inverse string match
            ^
in function '_tide_pwd'
in command substitution
in command substitution
in function '__fish_prompt_orig'
	called on line 47 of file -
in function 'fish_prompt'
in command substitution

So I fixed this line of code to handle empty list situation.

Motivation and Context

Closes #

Screenshots (if appropriate)

How Has This Been Tested

  • I have tested using Linux.
  • I have tested using MacOS.

Checklist

  • I am ready to update the wiki accordingly.
  • I have updated the tests accordingly.

@psycoder-sup psycoder-sup changed the title Fix Array Element Removal in _tide_pwd.fish Bug Fix Array Element Removal in _tide_pwd.fish Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant