-
Notifications
You must be signed in to change notification settings - Fork 1.3k
highlight path separators #260
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
Conversation
4a422d1
to
317dc0f
Compare
Updated the commit. Removed the global option and adjusted the test framework to disable separator highlighting by default. Tests that actually test the separator handling override these defaults. |
317dc0f
to
38a803e
Compare
Rebased on latest master for changes to the tests. |
I haven't tested this nor reviewed the code in context; so far, I only read the diff. |
Re the arithmetic for loop: see #295 (comment) |
5654e82
to
d595569
Compare
Agreed. Changed to use the same colors as the regular path highlighter.
Tested by loading zprof, entering a very long path, hitting backspace till the buffer was cleared, ran zprof:
I added a further check to return early from the function if the override style is the same as the original and the loop would be useless:
Regarding the arithmetic for loop: |
ca63fde
to
e728764
Compare
Thanks for the performance investigations! It seems the updated version has next-to-nil performance effect on people who don't opt-in to the new feature, which is good. I'm concerned about the test changes that stop setting [path_prefix] to What do you think of my suggestion from earlier? I see you haven't applied it but you haven't explained why.
|
e728764
to
7605fd8
Compare
Done
I totally misread that. Fixed now. |
7605fd8
to
d932266
Compare
6ed77e6
to
3c3555a
Compare
(When pushing a PR'd branch, please also add a comment to the PR so that a github notification would be generated to those following the PR.) |
Good work! |
Please add documentation for the new feature. (At least the style names need to be mentioned in |
If the separator feature is disabled, this makes it possible to change the main 'path' styles in a running session without the need to touch the '_pathseparator' styles, too.
I updated the documentation and also made a small change to the style initialization: Set the default styles to the empty string. This has the same initial effect and the advantage, that the main styles can be changed in a running shell without the need to change the _separator styles too, to keep the feature disabled. |
|
Fixed 1) and 2) |
I've changed a comma to semicolon and merged. Thanks! |
(By the way: I wouldn't have capitalized the "P" of "Path separators" in the first line of the log message, since it's neither a proper noun nor a sentence start; it's just a topical noun phrase. But I didn't want to drive you crazy with minor changes..) |
This commit is a squash of the work done by
Jorge Israel Peña (blaenk) in #136,
rebased on the latest master branch.
For now, this is disabled in tests, because they all would need to be adjusted.
TODO: If the ZSH_HIGHLIGHT_DISABLE_PATHSEP option should stay, it needs to be documented.