-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat: hide_separator option for powerline; new theme: powerlevel10k_rainbow #697
Conversation
theme: powerlevel10k_rainbow.omp
@uruz-7 can you give me a screenshot the result? Maybe we can go about this another way (or not). |
The result is like this. What issues is that by default, a separator will be rendered between diamond and powerline 1(or 4), which I personally didn't want. I have tried to change powerline 1 and 2 to diamond with customized color leading and trailing diamonds, but the Anyway, I'll appreciate it if there is a better way,. |
It looks so pretty. Let me check if we can fix this without an additional property 👍🏻 |
@uruz-7 if I do the following change I get the same result by leaving either trailing or leading diamond empty: diff --git a/src/block.go b/src/block.go
index d6f2f5c7..d6e444a0 100644
--- a/src/block.go
+++ b/src/block.go
@@ -89,9 +89,10 @@ func (b *Block) renderSegments() string {
}
func (b *Block) endPowerline() {
- if b.activeSegment != nil &&
- b.activeSegment.Style != Powerline &&
- b.previousActiveSegment != nil &&
+ if b.previousActiveSegment == nil || b.activeSegment == nil {
+ return
+ }
+ if b.activeSegment.Style != Powerline &&
b.previousActiveSegment.Style == Powerline {
b.writePowerLineSeparator(b.getPowerlineColor(false), b.previousActiveSegment.background(), true)
}
@@ -113,6 +114,12 @@ func (b *Block) getPowerlineColor(foreground bool) string {
if b.previousActiveSegment == nil {
return Transparent
}
+ if b.previousActiveSegment.Style == Diamond && len(b.previousActiveSegment.TrailingDiamond) == 0 {
+ return b.previousActiveSegment.background()
+ }
+ if b.activeSegment.Style == Diamond && len(b.activeSegment.LeadingDiamond) == 0 {
+ return b.activeSegment.background()
+ }
if !foreground && b.activeSegment.Style != Powerline {
return Transparent
} |
Wonderful job! Let me check it! |
@JanDeDobbeleer This worked perfect for my case. Thanks! And it influenced some other themes which could be fixed easily in #700. This PR could be closed :) (Please just ignore my mistake in branching above.) |
Prerequisites
CONTRIBUTING
guideDescription
I wanted an option that could hide the separator between a powerline segment and others, so I could make a powerlevel10k rainbow style based on the fascinating jandedobbeleer theme.