Skip to content

highlight path separators #136

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
wants to merge 5 commits into from
Closed

highlight path separators #136

wants to merge 5 commits into from

Conversation

blaenk
Copy link

@blaenk blaenk commented Jan 31, 2014

This adds support for highlighting path separators. Let me know what you think.

Jorge Israel Peña and others added 2 commits January 30, 2014 23:56
Thanks to m0viefreak!

Conflicts:
	highlighters/main/main-highlighter.zsh
@blaenk
Copy link
Author

blaenk commented Feb 1, 2014

@m0vie helped to provide a much more efficient implementation.

His changes only perform the highlighting on the matched chunk of text, instead of the entire $BUFFER. He also added a [[ -z $style ]] check so that if the style is empty, it does nothing. Finally, he rearranged the time at which the highlighting is performed to avoid collisions with the path style.

Thanks again @m0vie!

@nicoulaj
Copy link
Member

Can you also update highlighters/main/README.md with the new styles ?

@blaenk
Copy link
Author

blaenk commented Sep 25, 2014

@nicoulaj Sure, added with 3350c4a.

@danielshahaf
Copy link
Member

(Sorry for the late response; I was only granted push access here last week.)

Quick review: the implementation seems reasonable.

  • Using := for $style_override seems wrong, since that sets the variable after the place that tests its value.
  • In mkdir -p /etc/foo/bar/baz, path separators are not highlighted if there are two or more non-existent path components. From a user's point of view, this would be nice to have; from an implementor's, I'm not sure how complicated this would be to implement (without too many false positives, complexity, etc).

I currently focus on bugfixes, not on new features.

m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request Dec 31, 2015
This commit is a squash of the work done by
Jorge Israel Peña (blaenk) in zsh-users#136,
rebased on the latest master branch.

For now, this is disabled in tests.
@m0vie m0vie mentioned this pull request Dec 31, 2015
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request Apr 10, 2016
This commit is a squash of the work done by
Jorge Israel Peña (blaenk) in zsh-users#136,
rebased on the latest master branch.

For now, this is disabled in tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request Apr 16, 2016
This commit is a squash of the work done by
Jorge Israel Peña (blaenk) in zsh-users#136,
rebased on the latest master branch.

For now, this is disabled in tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request Apr 24, 2016
This commit is a squash of the work done by
Jorge Israel Peña (blaenk) in zsh-users#136,
rebased on the latest master branch.

For now, this is disabled in tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request Apr 24, 2016
This commit is a squash of the work done by
Jorge Israel Peña (blaenk) in zsh-users#136,
rebased on the latest master branch.

For now, this is disabled in tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request Apr 24, 2016
This commit is a squash of the work done by
Jorge Israel Peña (blaenk) in zsh-users#136,
rebased on the latest master branch.

For now, this is disabled in tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request Apr 24, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request Apr 24, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request Apr 24, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request Apr 29, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request May 27, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request May 27, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request May 27, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request May 27, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request May 27, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request May 27, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request May 27, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request May 27, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request May 27, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request May 27, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
m0vie added a commit to m0vie/zsh-syntax-highlighting that referenced this pull request May 27, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in zsh-users#136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
danielshahaf pushed a commit that referenced this pull request May 31, 2016
This commit is based on the work done by
Jorge Israel Peña (blaenk) in #136.

Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
  improve performance.
* Tests.
@danielshahaf
Copy link
Member

This was resubmitted as #260 and merged. Thanks for the patch!

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

Successfully merging this pull request may close these issues.

4 participants