Skip to content

path_approx: Apply restrictions for command word #187

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

Closed
danielshahaf opened this issue Sep 5, 2015 · 2 comments
Closed

path_approx: Apply restrictions for command word #187

danielshahaf opened this issue Sep 5, 2015 · 2 comments

Comments

@danielshahaf
Copy link
Member

(Spun off from #148)

When the word being completed is the command word, path_approx should only glob things that could be a valid command word: only absolute paths and things in $PATH, which are either executable or (if AUTO_CD is set) directories.

@danielshahaf
Copy link
Member Author

path_approx was added by @Valodim in #115, alongside path_prefix. The latter has a clear use-case, but I honestly don't see why highlighting things that are similar to existing paths, but are not themselves valid paths, is useful at all. (By comparison, we don't highlight misspelled commands — for example, ifcofnig is red — and it wouldn't be useful to do so.)

To be honest, my hunch is that path_approx should simply be dropped, or at least made optional and disabled by default. But I'm open to the possibility that I'm missing some important use-case, in which case, I would love to be enlightened.

@Valodim
Copy link
Member

Valodim commented Sep 6, 2015

Hm. path_approx was one of these "hey that'd be cool maybe?" features. The use case is mild reassurance (i.e. other than a non-highlighted parameter) that a file does not already exist but a similar one does, which is usually a very distinct scenario from working with an actually existing file name. I admit it's not super important to have in any particular situation, but it has never annoyed me either.

I don't mind either way, feel free to keep or ditch it :)

danielshahaf added a commit to danielshahaf/zsh-syntax-highlighting that referenced this issue Oct 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants