-
Notifications
You must be signed in to change notification settings - Fork 456
Merge lightline + adjust lightline & airline #72
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, all systems go. Will review airline code when pushed.
A quick test (without lightline) shows no breakages; would recommend someone who uses lightline test just in case.
let s:p.normal.error = [ [ s:red, s:black ] ] | ||
let s:p.normal.warning = [ [ s:yellow, s:black ] ] | ||
|
||
let g:lightline#colorscheme#Dracula#palette = lightline#colorscheme#flatten(s:p) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't pretend to know anything about lightline, although I spent some time browsing the repo/code and it looks nice. Assuming this works, LGTM, but I haven't experimented with it or its colors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I had no experience with it either.
I downloaded it and made sure it worked while after I wrote this in so I can confirm that it looks at least as good as it did before. And I can also confirm that placement of the lightline plugin with respect to this theme doesn't matter either when loading using (at least) vim-plug.
@@ -53,6 +53,20 @@ let s:yellow = ['#F1FA8C', 228] | |||
|
|||
let s:none = ['NONE', 'NONE'] | |||
|
|||
let g:dracula_palette = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be super useful for other plugin integrations (looking at you, airline). Good call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so to, thanks. I ended up adding in the extended colors as well. Figured some other UI themes might want to use those as well. 👍
Thanks for the review @benknoble 🙏 🙏 Just finished up the airline update. Check it out and let me know what you think. I added a couple little helper functions in the airline file that makes it easier to use our palette with their requirements. It also makes it a bit more readable. Side note: Assuming you didn't change your mind, I'm gonna add you as a maintainer here to this theme in the readme file (tomorrow at some point). You have push/pull access here, right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad to hear lightline doesn't have any issues; I think there's a problem with the Airline inactive section I'd like to see fixed, but if you'd rather I open a new issue for that (as opposed to fixing it in this PR) that's ok too.
I do think we should document the functions, just for readability.
let g:airline#themes#dracula#palette.visual.airline_error = s:ERROR | ||
let g:airline#themes#dracula#palette.replace.airline_error = s:ERROR | ||
|
||
" File modified and not saved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we keeping a "file modified and not saved" section in the color scheme ? I couldn't find one below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it because the color that was defined was so closely similar to the regular section that I couldn't really even notice a difference.
Also, on my system, once a file is changed, it switches over to the _modified
variant permanently, even after it is saved, so it didn't seem very useful.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I did notice it because it when from a dark black/purple color to a grey (with the little [+]
). The grey and the little [+]
go away after I save.
With the current patch, the middle of the status line is just always the grey modified color.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm.. maybe my system is different or neovim handles it differently because I definitely didn't notice that.
The color that was used for the "gray" was out of spec. Thoughts on using the bgdark
color instead if I add it back in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final thought: Would it be useful/helpful to also enable italics for changed filenames if the user has italics enabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shrugs I could go either way on that one, since I don't use them. Is that typical in other IDEs? Your call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what they do in VS Code. But I don't particularly find it useful or necessary. I generally know if a buffer has been modified or not if I try to quit out and it doesn't let me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Vim let's us know in it's own way. That's one reason I like the color change/indicator. I'm so used to it I don't have to look at it; the corner of my eye sees the change and it's instant feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. So we'll keep as-is for the time being then.. Merging!
autoload/airline/themes/dracula.vim
Outdated
"}}} | ||
" Helpers: {{{ | ||
|
||
func! s:clr(fg, bg, ...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would enjoy seeing some documentation (read: comments) on the usage of the script-local functions, here and elsewhere, since Vimscript isn't necessarily the easiest thing to read and we're dealing with a very specific data structure for airline. For future maintenance, it could be nice.
|
||
"}}} | ||
|
||
let g:airline#themes#dracula#palette = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clean; love it.
autoload/airline/themes/dracula.vim
Outdated
\ 'airline_error': s:clr('bg', 'red'), | ||
\ }, | ||
\ ), | ||
\ 'inactive': s:color_map( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In inactive mode (i.e., with multiple windows open) the airline on regular buffers (not help, quickfix, or netrw with my testing) is unreadable in the left gutter. It appears the text becomes the same color as the grey background, becoming impossible to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, come to think of it, this was present before this commit... is this expected behavior ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screenshot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, ignore this. I found my problem. What happens is airline collapses the mode
and branch
sections, leaving the file name. I had been experimenting on a new file without a name. Editing a named file is the same as it was (readable but subtle and not in the way).
@dsifford As for the maintainer-ship, I'm still interested. I have pull access, but I don't think push since I'm not in the 'vim team' ? I'll request to join... |
@benknoble Your suggestions have all been addressed. Let me know when you get a chance if we're good to merge Thanks again 👍 |
Added you to the readme @benknoble -- Feel free to adjust once @zenorocha gives you push access. I added you as "David Ben Knoble" but, judging by your username, I assume you go by your middle name generally? |
Co-authored-by: adamalbrecht <[email protected]>
892b9ba
to
f2d84cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything LGTM. Correct about the naming. Either is fine, it's been a life of Ben, David, David-Ben, Ben-David, &c.
autoload/airline/themes/dracula.vim
Outdated
@@ -10,6 +10,9 @@ | |||
"}}} | |||
" Helpers: {{{ | |||
|
|||
" Takes a foreground color name, background color name, and optionally one or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! Now I know what's going on!
* Updates team list * Fixes typo * Fixes link * Merge lightline + adjust lightline & airline (dracula#72) * add built-in lightline support Co-authored-by: adamalbrecht <[email protected]> * finish lightline merge * finish airline update * add inline doc comments to airline script functions * add back modified groups to airline * adjust maintainers + add @benknoble in README.md * remove lambda for better backwards compat. closes dracula#73
WIP. Don't merge yet
This PR merges the lightline theme over from the lightline repo to here as well as adjusts the colors of both lightline and airline so that they use the same exact palette as the main theme.
Lightline merge is a co-authored commit with @adamalbrecht so he gets credit for his work.
TODO: